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_icon:
11436 * @type: a content type string
11438 * Gets the icon for a content type.
11440 * Returns: (transfer full): #GIcon corresponding to the content type. Free the returned object with g_object_unref()
11445 * g_content_type_get_mime_type:
11446 * @type: a content type string
11448 * Gets the mime type for the content type, if one is registered.
11450 * Returns: (allow-none): the registered mime type for the given @type, or %NULL if unknown.
11455 * g_content_type_get_symbolic_icon:
11456 * @type: a content type string
11458 * Gets the symbolic icon for a content type.
11460 * Returns: (transfer full): symbolic #GIcon corresponding to the content type. Free the returned object with g_object_unref()
11466 * g_content_type_guess:
11467 * @filename: (allow-none): a string, or %NULL
11468 * @data: (allow-none) (array length=data_size): a stream of data, or %NULL
11469 * @data_size: the size of @data
11470 * @result_uncertain: (allow-none) (out): return location for the certainty of the result, or %NULL
11472 * Guesses the content type based on example data. If the function is
11473 * uncertain, @result_uncertain will be set to %TRUE. Either @filename
11474 * or @data may be %NULL, in which case the guess will be based solely
11475 * on the other argument.
11477 * Returns: a string indicating a guessed content type for the given data. Free with g_free()
11482 * g_content_type_guess_for_tree:
11483 * @root: the root of the tree to guess a type for
11485 * Tries to guess the type of the tree with root @root, by
11486 * looking at the files it contains. The result is an array
11487 * of content types, with the best guess coming first.
11489 * The types returned all have the form x-content/foo, e.g.
11490 * x-content/audio-cdda (for audio CDs) or x-content/image-dcf
11491 * (for a camera memory card). See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
11492 * specification for more on x-content types.
11494 * This function is useful in the implementation of
11495 * g_mount_guess_content_type().
11497 * Returns: (transfer full) (array zero-terminated=1): an %NULL-terminated array of zero or more content types. Free with g_strfreev()
11503 * g_content_type_is_a:
11504 * @type: a content type string
11505 * @supertype: a content type string
11507 * Determines if @type is a subset of @supertype.
11509 * Returns: %TRUE if @type is a kind of @supertype, %FALSE otherwise.
11514 * g_content_type_is_unknown:
11515 * @type: a content type string
11517 * Checks if the content type is the generic "unknown" type.
11518 * On UNIX this is the "application/octet-stream" mimetype,
11519 * while on win32 it is "*".
11521 * Returns: %TRUE if the type is the unknown type.
11526 * g_content_types_get_registered:
11528 * Gets a list of strings containing all the registered content types
11529 * known to the system. The list and its data should be freed using
11531 * g_list_free_full (list, g_free);
11532 * </programlisting>
11534 * Returns: (element-type utf8) (transfer full): #GList of the registered content types
11539 * g_converter_convert:
11540 * @converter: a #GConverter.
11541 * @inbuf: (array length=inbuf_size) (element-type guint8): the buffer containing the data to convert.
11542 * @inbuf_size: the number of bytes in @inbuf
11543 * @outbuf: a buffer to write converted data in.
11544 * @outbuf_size: the number of bytes in @outbuf, must be at least one
11545 * @flags: a #GConverterFlags controlling the conversion details
11546 * @bytes_read: (out): will be set to the number of bytes read from @inbuf on success
11547 * @bytes_written: (out): will be set to the number of bytes written to @outbuf on success
11548 * @error: location to store the error occurring, or %NULL to ignore
11550 * This is the main operation used when converting data. It is to be called
11551 * multiple times in a loop, and each time it will do some work, i.e.
11552 * producing some output (in @outbuf) or consuming some input (from @inbuf) or
11553 * both. If its not possible to do any work an error is returned.
11555 * Note that a single call may not consume all input (or any input at all).
11556 * Also a call may produce output even if given no input, due to state stored
11557 * in the converter producing output.
11559 * If any data was either produced or consumed, and then an error happens, then
11560 * only the successful conversion is reported and the error is returned on the
11563 * A full conversion loop involves calling this method repeatedly, each time
11564 * giving it new input and space output space. When there is no more input
11565 * data after the data in @inbuf, the flag %G_CONVERTER_INPUT_AT_END must be set.
11566 * The loop will be (unless some error happens) returning %G_CONVERTER_CONVERTED
11567 * each time until all data is consumed and all output is produced, then
11568 * %G_CONVERTER_FINISHED is returned instead. Note, that %G_CONVERTER_FINISHED
11569 * may be returned even if %G_CONVERTER_INPUT_AT_END is not set, for instance
11570 * in a decompression converter where the end of data is detectable from the
11571 * data (and there might even be other data after the end of the compressed data).
11573 * When some data has successfully been converted @bytes_read and is set to
11574 * the number of bytes read from @inbuf, and @bytes_written is set to indicate
11575 * how many bytes was written to @outbuf. If there are more data to output
11576 * or consume (i.e. unless the %G_CONVERTER_INPUT_AT_END is specified) then
11577 * %G_CONVERTER_CONVERTED is returned, and if no more data is to be output
11578 * then %G_CONVERTER_FINISHED is returned.
11580 * On error %G_CONVERTER_ERROR is returned and @error is set accordingly.
11581 * Some errors need special handling:
11583 * %G_IO_ERROR_NO_SPACE is returned if there is not enough space
11584 * to write the resulting converted data, the application should
11585 * call the function again with a larger @outbuf to continue.
11587 * %G_IO_ERROR_PARTIAL_INPUT is returned if there is not enough
11588 * input to fully determine what the conversion should produce,
11589 * and the %G_CONVERTER_INPUT_AT_END flag is not set. This happens for
11590 * example with an incomplete multibyte sequence when converting text,
11591 * or when a regexp matches up to the end of the input (and may match
11592 * further input). It may also happen when @inbuf_size is zero and
11593 * there is no more data to produce.
11595 * When this happens the application should read more input and then
11596 * call the function again. If further input shows that there is no
11597 * more data call the function again with the same data but with
11598 * the %G_CONVERTER_INPUT_AT_END flag set. This may cause the conversion
11599 * to finish as e.g. in the regexp match case (or, to fail again with
11600 * %G_IO_ERROR_PARTIAL_INPUT in e.g. a charset conversion where the
11601 * input is actually partial).
11603 * After g_converter_convert() has returned %G_CONVERTER_FINISHED the
11604 * converter object is in an invalid state where its not allowed
11605 * to call g_converter_convert() anymore. At this time you can only
11606 * free the object or call g_converter_reset() to reset it to the
11609 * If the flag %G_CONVERTER_FLUSH is set then conversion is modified
11610 * to try to write out all internal state to the output. The application
11611 * has to call the function multiple times with the flag set, and when
11612 * the available input has been consumed and all internal state has
11613 * been produced then %G_CONVERTER_FLUSHED (or %G_CONVERTER_FINISHED if
11614 * really at the end) is returned instead of %G_CONVERTER_CONVERTED.
11615 * This is somewhat similar to what happens at the end of the input stream,
11616 * but done in the middle of the data.
11618 * This has different meanings for different conversions. For instance
11619 * in a compression converter it would mean that we flush all the
11620 * compression state into output such that if you uncompress the
11621 * compressed data you get back all the input data. Doing this may
11622 * make the final file larger due to padding though. Another example
11623 * is a regexp conversion, where if you at the end of the flushed data
11624 * have a match, but there is also a potential longer match. In the
11625 * non-flushed case we would ask for more input, but when flushing we
11626 * treat this as the end of input and do the match.
11628 * Flushing is not always possible (like if a charset converter flushes
11629 * at a partial multibyte sequence). Converters are supposed to try
11630 * to produce as much output as possible and then return an error
11631 * (typically %G_IO_ERROR_PARTIAL_INPUT).
11633 * Returns: a #GConverterResult, %G_CONVERTER_ERROR on error.
11639 * g_converter_input_stream_get_converter:
11640 * @converter_stream: a #GConverterInputStream
11642 * Gets the #GConverter that is used by @converter_stream.
11644 * Returns: (transfer none): the converter of the converter input stream
11650 * g_converter_input_stream_new:
11651 * @base_stream: a #GInputStream
11652 * @converter: a #GConverter
11654 * Creates a new converter input stream for the @base_stream.
11656 * Returns: a new #GInputStream.
11661 * g_converter_output_stream_get_converter:
11662 * @converter_stream: a #GConverterOutputStream
11664 * Gets the #GConverter that is used by @converter_stream.
11666 * Returns: (transfer none): the converter of the converter output stream
11672 * g_converter_output_stream_new:
11673 * @base_stream: a #GOutputStream
11674 * @converter: a #GConverter
11676 * Creates a new converter output stream for the @base_stream.
11678 * Returns: a new #GOutputStream.
11683 * g_converter_reset:
11684 * @converter: a #GConverter.
11686 * Resets all internal state in the converter, making it behave
11687 * as if it was just created. If the converter has any internal
11688 * state that would produce output then that output is lost.
11695 * g_credentials_get_native: (skip)
11696 * @credentials: A #GCredentials.
11697 * @native_type: The type of native credentials to get.
11699 * Gets a pointer to native credentials of type @native_type from
11702 * It is a programming error (which will cause an warning to be
11703 * logged) to use this method if there is no #GCredentials support for
11704 * the OS or if @native_type isn't supported by the OS.
11706 * 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.
11712 * g_credentials_get_unix_user:
11713 * @credentials: A #GCredentials
11714 * @error: Return location for error or %NULL.
11716 * Tries to get the UNIX user identifier from @credentials. This
11717 * method is only available on UNIX platforms.
11719 * This operation can fail if #GCredentials is not supported on the
11720 * OS or if the native credentials type does not contain information
11721 * about the UNIX user.
11723 * Returns: The UNIX user identifier or -1 if @error is set.
11729 * g_credentials_is_same_user:
11730 * @credentials: A #GCredentials.
11731 * @other_credentials: A #GCredentials.
11732 * @error: Return location for error or %NULL.
11734 * Checks if @credentials and @other_credentials is the same user.
11736 * This operation can fail if #GCredentials is not supported on the
11739 * Returns: %TRUE if @credentials and @other_credentials has the same user, %FALSE otherwise or if @error is set.
11745 * g_credentials_new:
11747 * Creates a new #GCredentials object with credentials matching the
11748 * the current process.
11750 * Returns: A #GCredentials. Free with g_object_unref().
11756 * g_credentials_set_native:
11757 * @credentials: A #GCredentials.
11758 * @native_type: The type of native credentials to set.
11759 * @native: A pointer to native credentials.
11761 * Copies the native credentials of type @native_type from @native
11762 * into @credentials.
11764 * It is a programming error (which will cause an warning to be
11765 * logged) to use this method if there is no #GCredentials support for
11766 * the OS or if @native_type isn't supported by the OS.
11773 * g_credentials_set_unix_user:
11774 * @credentials: A #GCredentials.
11775 * @uid: The UNIX user identifier to set.
11776 * @error: Return location for error or %NULL.
11778 * Tries to set the UNIX user identifier on @credentials. This method
11779 * is only available on UNIX platforms.
11781 * This operation can fail if #GCredentials is not supported on the
11782 * OS or if the native credentials type does not contain information
11783 * about the UNIX user.
11785 * Returns: %TRUE if @uid was set, %FALSE if error is set.
11791 * g_credentials_to_string:
11792 * @credentials: A #GCredentials object.
11794 * Creates a human-readable textual representation of @credentials
11795 * that can be used in logging and debug messages. The format of the
11796 * returned string may change in future GLib release.
11798 * Returns: A string that should be freed with g_free().
11804 * g_data_input_stream_get_byte_order:
11805 * @stream: a given #GDataInputStream.
11807 * Gets the byte order for the data input stream.
11809 * Returns: the @stream's current #GDataStreamByteOrder.
11814 * g_data_input_stream_get_newline_type:
11815 * @stream: a given #GDataInputStream.
11817 * Gets the current newline type for the @stream.
11819 * Returns: #GDataStreamNewlineType for the given @stream.
11824 * g_data_input_stream_new:
11825 * @base_stream: a #GInputStream.
11827 * Creates a new data input stream for the @base_stream.
11829 * Returns: a new #GDataInputStream.
11834 * g_data_input_stream_read_byte:
11835 * @stream: a given #GDataInputStream.
11836 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11837 * @error: #GError for error reporting.
11839 * Reads an unsigned 8-bit/1-byte value from @stream.
11841 * Returns: an unsigned 8-bit/1-byte value read from the @stream or %0 if an error occurred.
11846 * g_data_input_stream_read_int16:
11847 * @stream: a given #GDataInputStream.
11848 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11849 * @error: #GError for error reporting.
11851 * Reads a 16-bit/2-byte value from @stream.
11853 * In order to get the correct byte order for this read operation,
11854 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11856 * Returns: a signed 16-bit/2-byte value read from @stream or %0 if an error occurred.
11861 * g_data_input_stream_read_int32:
11862 * @stream: a given #GDataInputStream.
11863 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11864 * @error: #GError for error reporting.
11866 * Reads a signed 32-bit/4-byte value from @stream.
11868 * In order to get the correct byte order for this read operation,
11869 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11871 * If @cancellable is not %NULL, then the operation can be cancelled by
11872 * triggering the cancellable object from another thread. If the operation
11873 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11875 * Returns: a signed 32-bit/4-byte value read from the @stream or %0 if an error occurred.
11880 * g_data_input_stream_read_int64:
11881 * @stream: a given #GDataInputStream.
11882 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11883 * @error: #GError for error reporting.
11885 * Reads a 64-bit/8-byte value from @stream.
11887 * In order to get the correct byte order for this read operation,
11888 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11890 * If @cancellable is not %NULL, then the operation can be cancelled by
11891 * triggering the cancellable object from another thread. If the operation
11892 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11894 * Returns: a signed 64-bit/8-byte value read from @stream or %0 if an error occurred.
11899 * g_data_input_stream_read_line:
11900 * @stream: a given #GDataInputStream.
11901 * @length: (out): a #gsize to get the length of the data read in.
11902 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11903 * @error: #GError for error reporting.
11905 * Reads a line from the data input stream. Note that no encoding
11906 * checks or conversion is performed; the input is not guaranteed to
11907 * be UTF-8, and may in fact have embedded NUL characters.
11909 * If @cancellable is not %NULL, then the operation can be cancelled by
11910 * triggering the cancellable object from another thread. If the operation
11911 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11913 * 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.
11918 * g_data_input_stream_read_line_async:
11919 * @stream: a given #GDataInputStream.
11920 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
11921 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11922 * @callback: (scope async): callback to call when the request is satisfied.
11923 * @user_data: (closure): the data to pass to callback function.
11925 * The asynchronous version of g_data_input_stream_read_line(). It is
11926 * an error to have two outstanding calls to this function.
11928 * When the operation is finished, @callback will be called. You
11929 * can then call g_data_input_stream_read_line_finish() to get
11930 * the result of the operation.
11937 * g_data_input_stream_read_line_finish:
11938 * @stream: a given #GDataInputStream.
11939 * @result: the #GAsyncResult that was provided to the callback.
11940 * @length: (out): a #gsize to get the length of the data read in.
11941 * @error: #GError for error reporting.
11943 * Finish an asynchronous call started by
11944 * g_data_input_stream_read_line_async(). Note the warning about
11945 * string encoding in g_data_input_stream_read_line() applies here as
11948 * 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.
11954 * g_data_input_stream_read_line_finish_utf8:
11955 * @stream: a given #GDataInputStream.
11956 * @result: the #GAsyncResult that was provided to the callback.
11957 * @length: (out): a #gsize to get the length of the data read in.
11958 * @error: #GError for error reporting.
11960 * Finish an asynchronous call started by
11961 * g_data_input_stream_read_line_async().
11963 * 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.
11969 * g_data_input_stream_read_line_utf8:
11970 * @stream: a given #GDataInputStream.
11971 * @length: (out): a #gsize to get the length of the data read in.
11972 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11973 * @error: #GError for error reporting.
11975 * Reads a UTF-8 encoded line from the data input stream.
11977 * If @cancellable is not %NULL, then the operation can be cancelled by
11978 * triggering the cancellable object from another thread. If the operation
11979 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11981 * 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.
11987 * g_data_input_stream_read_uint16:
11988 * @stream: a given #GDataInputStream.
11989 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11990 * @error: #GError for error reporting.
11992 * Reads an unsigned 16-bit/2-byte value from @stream.
11994 * In order to get the correct byte order for this read operation,
11995 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11997 * Returns: an unsigned 16-bit/2-byte value read from the @stream or %0 if an error occurred.
12002 * g_data_input_stream_read_uint32:
12003 * @stream: a given #GDataInputStream.
12004 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12005 * @error: #GError for error reporting.
12007 * Reads an unsigned 32-bit/4-byte value from @stream.
12009 * In order to get the correct byte order for this read operation,
12010 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12012 * If @cancellable is not %NULL, then the operation can be cancelled by
12013 * triggering the cancellable object from another thread. If the operation
12014 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12016 * Returns: an unsigned 32-bit/4-byte value read from the @stream or %0 if an error occurred.
12021 * g_data_input_stream_read_uint64:
12022 * @stream: a given #GDataInputStream.
12023 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12024 * @error: #GError for error reporting.
12026 * Reads an unsigned 64-bit/8-byte value from @stream.
12028 * In order to get the correct byte order for this read operation,
12029 * see g_data_input_stream_get_byte_order().
12031 * If @cancellable is not %NULL, then the operation can be cancelled by
12032 * triggering the cancellable object from another thread. If the operation
12033 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12035 * Returns: an unsigned 64-bit/8-byte read from @stream or %0 if an error occurred.
12040 * g_data_input_stream_read_until:
12041 * @stream: a given #GDataInputStream.
12042 * @stop_chars: characters to terminate the read.
12043 * @length: (out): a #gsize to get the length of the data read in.
12044 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12045 * @error: #GError for error reporting.
12047 * Reads a string from the data input stream, up to the first
12048 * occurrence of any of the stop characters.
12050 * Note that, in contrast to g_data_input_stream_read_until_async(),
12051 * this function consumes the stop character that it finds.
12053 * Don't use this function in new code. Its functionality is
12054 * inconsistent with g_data_input_stream_read_until_async(). Both
12055 * functions will be marked as deprecated in a future release. Use
12056 * g_data_input_stream_read_upto() instead, but note that that function
12057 * does not consume the stop character.
12059 * 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.
12064 * g_data_input_stream_read_until_async:
12065 * @stream: a given #GDataInputStream.
12066 * @stop_chars: characters to terminate the read.
12067 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
12068 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12069 * @callback: (scope async): callback to call when the request is satisfied.
12070 * @user_data: (closure): the data to pass to callback function.
12072 * The asynchronous version of g_data_input_stream_read_until().
12073 * It is an error to have two outstanding calls to this function.
12075 * Note that, in contrast to g_data_input_stream_read_until(),
12076 * this function does not consume the stop character that it finds. You
12077 * must read it for yourself.
12079 * When the operation is finished, @callback will be called. You
12080 * can then call g_data_input_stream_read_until_finish() to get
12081 * the result of the operation.
12083 * Don't use this function in new code. Its functionality is
12084 * inconsistent with g_data_input_stream_read_until(). Both functions
12085 * will be marked as deprecated in a future release. Use
12086 * g_data_input_stream_read_upto_async() instead.
12093 * g_data_input_stream_read_until_finish:
12094 * @stream: a given #GDataInputStream.
12095 * @result: the #GAsyncResult that was provided to the callback.
12096 * @length: (out): a #gsize to get the length of the data read in.
12097 * @error: #GError for error reporting.
12099 * Finish an asynchronous call started by
12100 * g_data_input_stream_read_until_async().
12103 * 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.
12108 * g_data_input_stream_read_upto:
12109 * @stream: a #GDataInputStream
12110 * @stop_chars: characters to terminate the read
12111 * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
12112 * @length: (out): a #gsize to get the length of the data read in
12113 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
12114 * @error: #GError for error reporting
12116 * Reads a string from the data input stream, up to the first
12117 * occurrence of any of the stop characters.
12119 * In contrast to g_data_input_stream_read_until(), this function
12120 * does <emphasis>not</emphasis> consume the stop character. You have
12121 * to use g_data_input_stream_read_byte() to get it before calling
12122 * g_data_input_stream_read_upto() again.
12124 * Note that @stop_chars may contain '\0' if @stop_chars_len is
12127 * 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
12133 * g_data_input_stream_read_upto_async:
12134 * @stream: a #GDataInputStream
12135 * @stop_chars: characters to terminate the read
12136 * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
12137 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
12138 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
12139 * @callback: (scope async): callback to call when the request is satisfied
12140 * @user_data: (closure): the data to pass to callback function
12142 * The asynchronous version of g_data_input_stream_read_upto().
12143 * It is an error to have two outstanding calls to this function.
12145 * In contrast to g_data_input_stream_read_until(), this function
12146 * does <emphasis>not</emphasis> consume the stop character. You have
12147 * to use g_data_input_stream_read_byte() to get it before calling
12148 * g_data_input_stream_read_upto() again.
12150 * Note that @stop_chars may contain '\0' if @stop_chars_len is
12153 * When the operation is finished, @callback will be called. You
12154 * can then call g_data_input_stream_read_upto_finish() to get
12155 * the result of the operation.
12162 * g_data_input_stream_read_upto_finish:
12163 * @stream: a #GDataInputStream
12164 * @result: the #GAsyncResult that was provided to the callback
12165 * @length: (out): a #gsize to get the length of the data read in
12166 * @error: #GError for error reporting
12168 * Finish an asynchronous call started by
12169 * g_data_input_stream_read_upto_async().
12171 * Note that this function does <emphasis>not</emphasis> consume the
12172 * stop character. You have to use g_data_input_stream_read_byte() to
12173 * get it before calling g_data_input_stream_read_upto_async() again.
12175 * 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.
12181 * g_data_input_stream_set_byte_order:
12182 * @stream: a given #GDataInputStream.
12183 * @order: a #GDataStreamByteOrder to set.
12185 * This function sets the byte order for the given @stream. All subsequent
12186 * reads from the @stream will be read in the given @order.
12191 * g_data_input_stream_set_newline_type:
12192 * @stream: a #GDataInputStream.
12193 * @type: the type of new line return as #GDataStreamNewlineType.
12195 * Sets the newline type for the @stream.
12197 * Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read
12198 * chunk ends in "CR" we must read an additional byte to know if this is "CR" or
12199 * "CR LF", and this might block if there is no more data available.
12204 * g_data_output_stream_get_byte_order:
12205 * @stream: a #GDataOutputStream.
12207 * Gets the byte order for the stream.
12209 * Returns: the #GDataStreamByteOrder for the @stream.
12214 * g_data_output_stream_new:
12215 * @base_stream: a #GOutputStream.
12217 * Creates a new data output stream for @base_stream.
12219 * Returns: #GDataOutputStream.
12224 * g_data_output_stream_put_byte:
12225 * @stream: a #GDataOutputStream.
12226 * @data: a #guchar.
12227 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12228 * @error: a #GError, %NULL to ignore.
12230 * Puts a byte into the output stream.
12232 * Returns: %TRUE if @data was successfully added to the @stream.
12237 * g_data_output_stream_put_int16:
12238 * @stream: a #GDataOutputStream.
12239 * @data: a #gint16.
12240 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12241 * @error: a #GError, %NULL to ignore.
12243 * Puts a signed 16-bit integer into the output stream.
12245 * Returns: %TRUE if @data was successfully added to the @stream.
12250 * g_data_output_stream_put_int32:
12251 * @stream: a #GDataOutputStream.
12252 * @data: a #gint32.
12253 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12254 * @error: a #GError, %NULL to ignore.
12256 * Puts a signed 32-bit integer into the output stream.
12258 * Returns: %TRUE if @data was successfully added to the @stream.
12263 * g_data_output_stream_put_int64:
12264 * @stream: a #GDataOutputStream.
12265 * @data: a #gint64.
12266 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12267 * @error: a #GError, %NULL to ignore.
12269 * Puts a signed 64-bit integer into the stream.
12271 * Returns: %TRUE if @data was successfully added to the @stream.
12276 * g_data_output_stream_put_string:
12277 * @stream: a #GDataOutputStream.
12279 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12280 * @error: a #GError, %NULL to ignore.
12282 * Puts a string into the output stream.
12284 * Returns: %TRUE if @string was successfully added to the @stream.
12289 * g_data_output_stream_put_uint16:
12290 * @stream: a #GDataOutputStream.
12291 * @data: a #guint16.
12292 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12293 * @error: a #GError, %NULL to ignore.
12295 * Puts an unsigned 16-bit integer into the output stream.
12297 * Returns: %TRUE if @data was successfully added to the @stream.
12302 * g_data_output_stream_put_uint32:
12303 * @stream: a #GDataOutputStream.
12304 * @data: a #guint32.
12305 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12306 * @error: a #GError, %NULL to ignore.
12308 * Puts an unsigned 32-bit integer into the stream.
12310 * Returns: %TRUE if @data was successfully added to the @stream.
12315 * g_data_output_stream_put_uint64:
12316 * @stream: a #GDataOutputStream.
12317 * @data: a #guint64.
12318 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12319 * @error: a #GError, %NULL to ignore.
12321 * Puts an unsigned 64-bit integer into the stream.
12323 * Returns: %TRUE if @data was successfully added to the @stream.
12328 * g_data_output_stream_set_byte_order:
12329 * @stream: a #GDataOutputStream.
12330 * @order: a %GDataStreamByteOrder.
12332 * Sets the byte order of the data output stream to @order.
12337 * g_dbus_action_group_get:
12338 * @connection: A #GDBusConnection
12339 * @bus_name: the bus name which exports the action group
12340 * @object_path: the object path at which the action group is exported
12342 * Obtains a #GDBusActionGroup for the action group which is exported at
12343 * the given @bus_name and @object_path.
12345 * The thread default main context is taken at the time of this call.
12346 * All signals on the menu model (and any linked models) are reported
12347 * with respect to this context. All calls on the returned menu model
12348 * (and linked models) must also originate from this same context, with
12349 * the thread default main context unchanged.
12351 * This call is non-blocking. The returned action group may or may not
12352 * already be filled in. The correct thing to do is connect the signals
12353 * for the action group to monitor for changes and then to call
12354 * g_action_group_list_actions() to get the initial list.
12356 * Returns: (transfer full): a #GDBusActionGroup
12362 * g_dbus_address_get_for_bus_sync:
12363 * @bus_type: A #GBusType.
12364 * @cancellable: (allow-none): A #GCancellable or %NULL.
12365 * @error: Return location for error or %NULL.
12367 * Synchronously looks up the D-Bus address for the well-known message
12368 * bus instance specified by @bus_type. This may involve using various
12369 * platform specific mechanisms.
12371 * Returns: A valid D-Bus address string for @bus_type or %NULL if @error is set.
12377 * g_dbus_address_get_stream:
12378 * @address: A valid D-Bus address.
12379 * @cancellable: (allow-none): A #GCancellable or %NULL.
12380 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12381 * @user_data: Data to pass to @callback.
12383 * Asynchronously connects to an endpoint specified by @address and
12384 * sets up the connection so it is in a state to run the client-side
12385 * of the D-Bus authentication conversation.
12387 * When the operation is finished, @callback will be invoked. You can
12388 * then call g_dbus_address_get_stream_finish() to get the result of
12391 * This is an asynchronous failable function. See
12392 * g_dbus_address_get_stream_sync() for the synchronous version.
12399 * g_dbus_address_get_stream_finish:
12400 * @res: A #GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream().
12401 * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
12402 * @error: Return location for error or %NULL.
12404 * Finishes an operation started with g_dbus_address_get_stream().
12406 * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
12412 * g_dbus_address_get_stream_sync:
12413 * @address: A valid D-Bus address.
12414 * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
12415 * @cancellable: (allow-none): A #GCancellable or %NULL.
12416 * @error: Return location for error or %NULL.
12418 * Synchronously connects to an endpoint specified by @address and
12419 * sets up the connection so it is in a state to run the client-side
12420 * of the D-Bus authentication conversation.
12422 * This is a synchronous failable function. See
12423 * g_dbus_address_get_stream() for the asynchronous version.
12425 * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
12431 * g_dbus_annotation_info_lookup:
12432 * @annotations: (array zero-terminated=1) (allow-none): A %NULL-terminated array of annotations or %NULL.
12433 * @name: The name of the annotation to look up.
12435 * Looks up the value of an annotation.
12437 * This cost of this function is O(n) in number of annotations.
12439 * Returns: The value or %NULL if not found. Do not free, it is owned by @annotations.
12445 * g_dbus_annotation_info_ref:
12446 * @info: A #GDBusNodeInfo
12448 * If @info is statically allocated does nothing. Otherwise increases
12449 * the reference count.
12451 * Returns: The same @info.
12457 * g_dbus_annotation_info_unref:
12458 * @info: A #GDBusAnnotationInfo.
12460 * If @info is statically allocated, does nothing. Otherwise decreases
12461 * the reference count of @info. When its reference count drops to 0,
12462 * the memory used is freed.
12469 * g_dbus_arg_info_ref:
12470 * @info: A #GDBusArgInfo
12472 * If @info is statically allocated does nothing. Otherwise increases
12473 * the reference count.
12475 * Returns: The same @info.
12481 * g_dbus_arg_info_unref:
12482 * @info: A #GDBusArgInfo.
12484 * If @info is statically allocated, does nothing. Otherwise decreases
12485 * the reference count of @info. When its reference count drops to 0,
12486 * the memory used is freed.
12493 * g_dbus_auth_observer_allow_mechanism:
12494 * @observer: A #GDBusAuthObserver.
12495 * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
12497 * Emits the #GDBusAuthObserver::allow-mechanism signal on @observer.
12499 * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
12505 * g_dbus_auth_observer_authorize_authenticated_peer:
12506 * @observer: A #GDBusAuthObserver.
12507 * @stream: A #GIOStream for the #GDBusConnection.
12508 * @credentials: (allow-none): Credentials received from the peer or %NULL.
12510 * Emits the #GDBusAuthObserver::authorize-authenticated-peer signal on @observer.
12512 * Returns: %TRUE if the peer is authorized, %FALSE if not.
12518 * g_dbus_auth_observer_new:
12520 * Creates a new #GDBusAuthObserver object.
12522 * Returns: A #GDBusAuthObserver. Free with g_object_unref().
12528 * g_dbus_connection_add_filter:
12529 * @connection: A #GDBusConnection.
12530 * @filter_function: A filter function.
12531 * @user_data: User data to pass to @filter_function.
12532 * @user_data_free_func: Function to free @user_data with when filter is removed or %NULL.
12534 * Adds a message filter. Filters are handlers that are run on all
12535 * incoming and outgoing messages, prior to standard dispatch. Filters
12536 * are run in the order that they were added. The same handler can be
12537 * added as a filter more than once, in which case it will be run more
12538 * than once. Filters added during a filter callback won't be run on
12539 * the message being processed. Filter functions are allowed to modify
12540 * and even drop messages.
12542 * Note that filters are run in a dedicated message handling thread so
12543 * they can't block and, generally, can't do anything but signal a
12544 * worker thread. Also note that filters are rarely needed - use API
12545 * such as g_dbus_connection_send_message_with_reply(),
12546 * g_dbus_connection_signal_subscribe() or g_dbus_connection_call() instead.
12548 * If a filter consumes an incoming message the message is not
12549 * dispatched anywhere else - not even the standard dispatch machinery
12550 * (that API such as g_dbus_connection_signal_subscribe() and
12551 * g_dbus_connection_send_message_with_reply() relies on) will see the
12552 * message. Similary, if a filter consumes an outgoing message, the
12553 * message will not be sent to the other peer.
12555 * Returns: A filter identifier that can be used with g_dbus_connection_remove_filter().
12561 * g_dbus_connection_call:
12562 * @connection: A #GDBusConnection.
12563 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12564 * @object_path: Path of remote object.
12565 * @interface_name: D-Bus interface to invoke method on.
12566 * @method_name: The name of the method to invoke.
12567 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12568 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12569 * @flags: Flags from the #GDBusCallFlags enumeration.
12570 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12571 * @cancellable: (allow-none): A #GCancellable or %NULL.
12572 * @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.
12573 * @user_data: The data to pass to @callback.
12575 * Asynchronously invokes the @method_name method on the
12576 * @interface_name D-Bus interface on the remote object at
12577 * @object_path owned by @bus_name.
12579 * If @connection is closed then the operation will fail with
12580 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
12581 * fail with %G_IO_ERROR_CANCELLED. If @parameters contains a value
12582 * not compatible with the D-Bus protocol, the operation fails with
12583 * %G_IO_ERROR_INVALID_ARGUMENT.
12585 * If @reply_type is non-%NULL then the reply will be checked for having this type and an
12586 * error will be raised if it does not match. Said another way, if you give a @reply_type
12587 * then any non-%NULL return value will be of this type.
12589 * If the @parameters #GVariant is floating, it is consumed. This allows
12590 * convenient 'inline' use of g_variant_new(), e.g.:
12592 * g_dbus_connection_call (connection,
12593 * "org.freedesktop.StringThings",
12594 * "/org/freedesktop/StringThings",
12595 * "org.freedesktop.StringThings",
12597 * g_variant_new ("(ss)",
12601 * G_DBUS_CALL_FLAGS_NONE,
12604 * (GAsyncReadyCallback) two_strings_done,
12608 * This is an asynchronous method. When the operation is finished, @callback will be invoked
12609 * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
12610 * of the thread you are calling this method from. You can then call
12611 * g_dbus_connection_call_finish() to get the result of the operation.
12612 * See g_dbus_connection_call_sync() for the synchronous version of this
12615 * If @callback is %NULL then the D-Bus method call message will be sent with
12616 * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
12623 * g_dbus_connection_call_finish:
12624 * @connection: A #GDBusConnection.
12625 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call().
12626 * @error: Return location for error or %NULL.
12628 * Finishes an operation started with g_dbus_connection_call().
12630 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12636 * g_dbus_connection_call_sync:
12637 * @connection: A #GDBusConnection.
12638 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12639 * @object_path: Path of remote object.
12640 * @interface_name: D-Bus interface to invoke method on.
12641 * @method_name: The name of the method to invoke.
12642 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12643 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12644 * @flags: Flags from the #GDBusCallFlags enumeration.
12645 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12646 * @cancellable: (allow-none): A #GCancellable or %NULL.
12647 * @error: Return location for error or %NULL.
12649 * Synchronously invokes the @method_name method on the
12650 * @interface_name D-Bus interface on the remote object at
12651 * @object_path owned by @bus_name.
12653 * If @connection is closed then the operation will fail with
12654 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the
12655 * operation will fail with %G_IO_ERROR_CANCELLED. If @parameters
12656 * contains a value not compatible with the D-Bus protocol, the operation
12657 * fails with %G_IO_ERROR_INVALID_ARGUMENT.
12659 * If @reply_type is non-%NULL then the reply will be checked for having
12660 * this type and an error will be raised if it does not match. Said
12661 * another way, if you give a @reply_type then any non-%NULL return
12662 * value will be of this type.
12664 * If the @parameters #GVariant is floating, it is consumed.
12665 * This allows convenient 'inline' use of g_variant_new(), e.g.:
12667 * g_dbus_connection_call_sync (connection,
12668 * "org.freedesktop.StringThings",
12669 * "/org/freedesktop/StringThings",
12670 * "org.freedesktop.StringThings",
12672 * g_variant_new ("(ss)",
12676 * G_DBUS_CALL_FLAGS_NONE,
12682 * The calling thread is blocked until a reply is received. See
12683 * g_dbus_connection_call() for the asynchronous version of
12686 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12692 * g_dbus_connection_call_with_unix_fd_list:
12693 * @connection: A #GDBusConnection.
12694 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12695 * @object_path: Path of remote object.
12696 * @interface_name: D-Bus interface to invoke method on.
12697 * @method_name: The name of the method to invoke.
12698 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12699 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12700 * @flags: Flags from the #GDBusCallFlags enumeration.
12701 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12702 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
12703 * @cancellable: (allow-none): A #GCancellable or %NULL.
12704 * @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.
12705 * @user_data: The data to pass to @callback.
12707 * Like g_dbus_connection_call() but also takes a #GUnixFDList object.
12709 * This method is only available on UNIX.
12716 * g_dbus_connection_call_with_unix_fd_list_finish:
12717 * @connection: A #GDBusConnection.
12718 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
12719 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call_with_unix_fd_list().
12720 * @error: Return location for error or %NULL.
12722 * Finishes an operation started with g_dbus_connection_call_with_unix_fd_list().
12724 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12730 * g_dbus_connection_call_with_unix_fd_list_sync:
12731 * @connection: A #GDBusConnection.
12732 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12733 * @object_path: Path of remote object.
12734 * @interface_name: D-Bus interface to invoke method on.
12735 * @method_name: The name of the method to invoke.
12736 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12737 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12738 * @flags: Flags from the #GDBusCallFlags enumeration.
12739 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12740 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
12741 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
12742 * @cancellable: (allow-none): A #GCancellable or %NULL.
12743 * @error: Return location for error or %NULL.
12745 * Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects.
12747 * This method is only available on UNIX.
12749 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12755 * g_dbus_connection_close:
12756 * @connection: A #GDBusConnection.
12757 * @cancellable: (allow-none): A #GCancellable or %NULL.
12758 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12759 * @user_data: The data to pass to @callback.
12761 * Closes @connection. Note that this never causes the process to
12762 * exit (this might only happen if the other end of a shared message
12763 * bus connection disconnects, see #GDBusConnection:exit-on-close).
12765 * Once the connection is closed, operations such as sending a message
12766 * will return with the error %G_IO_ERROR_CLOSED. Closing a connection
12767 * will not automatically flush the connection so queued messages may
12768 * be lost. Use g_dbus_connection_flush() if you need such guarantees.
12770 * If @connection is already closed, this method fails with
12771 * %G_IO_ERROR_CLOSED.
12773 * When @connection has been closed, the #GDBusConnection::closed
12774 * signal is emitted in the <link
12775 * linkend="g-main-context-push-thread-default">thread-default main
12776 * loop</link> of the thread that @connection was constructed in.
12778 * This is an asynchronous method. When the operation is finished,
12779 * @callback will be invoked in the <link
12780 * linkend="g-main-context-push-thread-default">thread-default main
12781 * loop</link> of the thread you are calling this method from. You can
12782 * then call g_dbus_connection_close_finish() to get the result of the
12783 * operation. See g_dbus_connection_close_sync() for the synchronous
12791 * g_dbus_connection_close_finish:
12792 * @connection: A #GDBusConnection.
12793 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_close().
12794 * @error: Return location for error or %NULL.
12796 * Finishes an operation started with g_dbus_connection_close().
12798 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12804 * g_dbus_connection_close_sync:
12805 * @connection: A #GDBusConnection.
12806 * @cancellable: (allow-none): A #GCancellable or %NULL.
12807 * @error: Return location for error or %NULL.
12809 * Synchronously closees @connection. The calling thread is blocked
12810 * until this is done. See g_dbus_connection_close() for the
12811 * asynchronous version of this method and more details about what it
12814 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12820 * g_dbus_connection_emit_signal:
12821 * @connection: A #GDBusConnection.
12822 * @destination_bus_name: (allow-none): The unique bus name for the destination for the signal or %NULL to emit to all listeners.
12823 * @object_path: Path of remote object.
12824 * @interface_name: D-Bus interface to emit a signal on.
12825 * @signal_name: The name of the signal to emit.
12826 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
12827 * @error: Return location for error or %NULL.
12831 * If the parameters GVariant is floating, it is consumed.
12833 * This can only fail if @parameters is not compatible with the D-Bus protocol.
12835 * Returns: %TRUE unless @error is set.
12841 * g_dbus_connection_export_action_group:
12842 * @connection: a #GDBusConnection
12843 * @object_path: a D-Bus object path
12844 * @action_group: a #GActionGroup
12845 * @error: a pointer to a %NULL #GError, or %NULL
12847 * Exports @action_group on @connection at @object_path.
12849 * The implemented D-Bus API should be considered private. It is
12850 * subject to change in the future.
12852 * A given object path can only have one action group exported on it.
12853 * If this constraint is violated, the export will fail and 0 will be
12854 * returned (with @error set accordingly).
12856 * You can unexport the action group using
12857 * g_dbus_connection_unexport_action_group() with the return value of
12860 * The thread default main context is taken at the time of this call.
12861 * All incoming action activations and state change requests are
12862 * reported from this context. Any changes on the action group that
12863 * cause it to emit signals must also come from this same context.
12864 * Since incoming action activations and state change requests are
12865 * rather likely to cause changes on the action group, this effectively
12866 * limits a given action group to being exported from only one main
12869 * Returns: the ID of the export (never zero), or 0 in case of failure
12875 * g_dbus_connection_export_menu_model:
12876 * @connection: a #GDBusConnection
12877 * @object_path: a D-Bus object path
12878 * @menu: a #GMenuModel
12879 * @error: return location for an error, or %NULL
12881 * Exports @menu on @connection at @object_path.
12883 * The implemented D-Bus API should be considered private.
12884 * It is subject to change in the future.
12886 * An object path can only have one action group exported on it. If this
12887 * constraint is violated, the export will fail and 0 will be
12888 * returned (with @error set accordingly).
12890 * You can unexport the menu model using
12891 * g_dbus_connection_unexport_menu_model() with the return value of
12894 * Returns: the ID of the export (never zero), or 0 in case of failure
12900 * g_dbus_connection_flush:
12901 * @connection: A #GDBusConnection.
12902 * @cancellable: (allow-none): A #GCancellable or %NULL.
12903 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12904 * @user_data: The data to pass to @callback.
12906 * Asynchronously flushes @connection, that is, writes all queued
12907 * outgoing message to the transport and then flushes the transport
12908 * (using g_output_stream_flush_async()). This is useful in programs
12909 * that wants to emit a D-Bus signal and then exit
12910 * immediately. Without flushing the connection, there is no guarantee
12911 * that the message has been sent to the networking buffers in the OS
12914 * This is an asynchronous method. When the operation is finished,
12915 * @callback will be invoked in the <link
12916 * linkend="g-main-context-push-thread-default">thread-default main
12917 * loop</link> of the thread you are calling this method from. You can
12918 * then call g_dbus_connection_flush_finish() to get the result of the
12919 * operation. See g_dbus_connection_flush_sync() for the synchronous
12927 * g_dbus_connection_flush_finish:
12928 * @connection: A #GDBusConnection.
12929 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_flush().
12930 * @error: Return location for error or %NULL.
12932 * Finishes an operation started with g_dbus_connection_flush().
12934 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12940 * g_dbus_connection_flush_sync:
12941 * @connection: A #GDBusConnection.
12942 * @cancellable: (allow-none): A #GCancellable or %NULL.
12943 * @error: Return location for error or %NULL.
12945 * Synchronously flushes @connection. The calling thread is blocked
12946 * until this is done. See g_dbus_connection_flush() for the
12947 * asynchronous version of this method and more details about what it
12950 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12956 * g_dbus_connection_get_capabilities:
12957 * @connection: A #GDBusConnection.
12959 * Gets the capabilities negotiated with the remote peer
12961 * Returns: Zero or more flags from the #GDBusCapabilityFlags enumeration.
12967 * g_dbus_connection_get_exit_on_close:
12968 * @connection: A #GDBusConnection.
12970 * Gets whether the process is terminated when @connection is
12971 * closed by the remote peer. See
12972 * #GDBusConnection:exit-on-close for more details.
12974 * Returns: Whether the process is terminated when @connection is closed by the remote peer.
12980 * g_dbus_connection_get_guid:
12981 * @connection: A #GDBusConnection.
12983 * The GUID of the peer performing the role of server when
12984 * authenticating. See #GDBusConnection:guid for more details.
12986 * Returns: The GUID. Do not free this string, it is owned by @connection.
12992 * g_dbus_connection_get_last_serial:
12993 * @connection: A #GDBusConnection.
12995 * Retrieves the last serial number assigned to a #GDBusMessage on
12996 * the current thread. This includes messages sent via both low-level
12997 * API such as g_dbus_connection_send_message() as well as
12998 * high-level API such as g_dbus_connection_emit_signal(),
12999 * g_dbus_connection_call() or g_dbus_proxy_call().
13001 * Returns: the last used serial or zero when no message has been sent within the current thread.
13007 * g_dbus_connection_get_peer_credentials:
13008 * @connection: A #GDBusConnection.
13010 * Gets the credentials of the authenticated peer. This will always
13011 * return %NULL unless @connection acted as a server
13012 * (e.g. %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed)
13013 * when set up and the client passed credentials as part of the
13014 * authentication process.
13016 * In a message bus setup, the message bus is always the server and
13017 * each application is a client. So this method will always return
13018 * %NULL for message bus clients.
13020 * Returns: (transfer none): A #GCredentials or %NULL if not available. Do not free this object, it is owned by @connection.
13026 * g_dbus_connection_get_stream:
13027 * @connection: a #GDBusConnection
13029 * Gets the underlying stream used for IO.
13031 * While the #GDBusConnection is active, it will interact with this
13032 * stream from a worker thread, so it is not safe to interact with
13033 * the stream directly.
13035 * Returns: (transfer none): the stream used for IO
13041 * g_dbus_connection_get_unique_name:
13042 * @connection: A #GDBusConnection.
13044 * Gets the unique name of @connection as assigned by the message
13045 * bus. This can also be used to figure out if @connection is a
13046 * message bus connection.
13048 * Returns: The unique name or %NULL if @connection is not a message bus connection. Do not free this string, it is owned by @connection.
13054 * g_dbus_connection_is_closed:
13055 * @connection: A #GDBusConnection.
13057 * Gets whether @connection is closed.
13059 * Returns: %TRUE if the connection is closed, %FALSE otherwise.
13065 * g_dbus_connection_new:
13066 * @stream: A #GIOStream.
13067 * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
13068 * @flags: Flags describing how to make the connection.
13069 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13070 * @cancellable: (allow-none): A #GCancellable or %NULL.
13071 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
13072 * @user_data: The data to pass to @callback.
13074 * Asynchronously sets up a D-Bus connection for exchanging D-Bus messages
13075 * with the end represented by @stream.
13077 * If @stream is a #GSocketConnection, then the corresponding #GSocket
13078 * will be put into non-blocking mode.
13080 * The D-Bus connection will interact with @stream from a worker thread.
13081 * As a result, the caller should not interact with @stream after this
13082 * method has been called, except by calling g_object_unref() on it.
13084 * If @observer is not %NULL it may be used to control the
13085 * authentication process.
13087 * When the operation is finished, @callback will be invoked. You can
13088 * then call g_dbus_connection_new_finish() to get the result of the
13091 * This is a asynchronous failable constructor. See
13092 * g_dbus_connection_new_sync() for the synchronous
13100 * g_dbus_connection_new_finish:
13101 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
13102 * @error: Return location for error or %NULL.
13104 * Finishes an operation started with g_dbus_connection_new().
13106 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13112 * g_dbus_connection_new_for_address:
13113 * @address: A D-Bus address.
13114 * @flags: Flags describing how to make the connection.
13115 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13116 * @cancellable: (allow-none): A #GCancellable or %NULL.
13117 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
13118 * @user_data: The data to pass to @callback.
13120 * Asynchronously connects and sets up a D-Bus client connection for
13121 * exchanging D-Bus messages with an endpoint specified by @address
13122 * which must be in the D-Bus address format.
13124 * This constructor can only be used to initiate client-side
13125 * connections - use g_dbus_connection_new() if you need to act as the
13126 * server. In particular, @flags cannot contain the
13127 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
13128 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
13130 * When the operation is finished, @callback will be invoked. You can
13131 * then call g_dbus_connection_new_finish() to get the result of the
13134 * If @observer is not %NULL it may be used to control the
13135 * authentication process.
13137 * This is a asynchronous failable constructor. See
13138 * g_dbus_connection_new_for_address_sync() for the synchronous
13146 * g_dbus_connection_new_for_address_finish:
13147 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
13148 * @error: Return location for error or %NULL.
13150 * Finishes an operation started with g_dbus_connection_new_for_address().
13152 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13158 * g_dbus_connection_new_for_address_sync:
13159 * @address: A D-Bus address.
13160 * @flags: Flags describing how to make the connection.
13161 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13162 * @cancellable: (allow-none): A #GCancellable or %NULL.
13163 * @error: Return location for error or %NULL.
13165 * Synchronously connects and sets up a D-Bus client connection for
13166 * exchanging D-Bus messages with an endpoint specified by @address
13167 * which must be in the D-Bus address format.
13169 * This constructor can only be used to initiate client-side
13170 * connections - use g_dbus_connection_new_sync() if you need to act
13171 * as the server. In particular, @flags cannot contain the
13172 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
13173 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
13175 * This is a synchronous failable constructor. See
13176 * g_dbus_connection_new_for_address() for the asynchronous version.
13178 * If @observer is not %NULL it may be used to control the
13179 * authentication process.
13181 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13187 * g_dbus_connection_new_sync:
13188 * @stream: A #GIOStream.
13189 * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
13190 * @flags: Flags describing how to make the connection.
13191 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13192 * @cancellable: (allow-none): A #GCancellable or %NULL.
13193 * @error: Return location for error or %NULL.
13195 * Synchronously sets up a D-Bus connection for exchanging D-Bus messages
13196 * with the end represented by @stream.
13198 * If @stream is a #GSocketConnection, then the corresponding #GSocket
13199 * will be put into non-blocking mode.
13201 * The D-Bus connection will interact with @stream from a worker thread.
13202 * As a result, the caller should not interact with @stream after this
13203 * method has been called, except by calling g_object_unref() on it.
13205 * If @observer is not %NULL it may be used to control the
13206 * authentication process.
13208 * This is a synchronous failable constructor. See
13209 * g_dbus_connection_new() for the asynchronous version.
13211 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13217 * g_dbus_connection_register_object:
13218 * @connection: A #GDBusConnection.
13219 * @object_path: The object path to register at.
13220 * @interface_info: Introspection data for the interface.
13221 * @vtable: (allow-none): A #GDBusInterfaceVTable to call into or %NULL.
13222 * @user_data: (allow-none): Data to pass to functions in @vtable.
13223 * @user_data_free_func: Function to call when the object path is unregistered.
13224 * @error: Return location for error or %NULL.
13226 * Registers callbacks for exported objects at @object_path with the
13227 * D-Bus interface that is described in @interface_info.
13229 * Calls to functions in @vtable (and @user_data_free_func) will
13230 * happen in the <link linkend="g-main-context-push-thread-default">thread-default main
13231 * loop</link> of the thread you are calling this method from.
13233 * Note that all #GVariant values passed to functions in @vtable will match
13234 * the signature given in @interface_info - if a remote caller passes
13235 * incorrect values, the <literal>org.freedesktop.DBus.Error.InvalidArgs</literal>
13236 * is returned to the remote caller.
13238 * Additionally, if the remote caller attempts to invoke methods or
13239 * access properties not mentioned in @interface_info the
13240 * <literal>org.freedesktop.DBus.Error.UnknownMethod</literal> resp.
13241 * <literal>org.freedesktop.DBus.Error.InvalidArgs</literal> errors
13242 * are returned to the caller.
13244 * It is considered a programming error if the
13245 * #GDBusInterfaceGetPropertyFunc function in @vtable returns a
13246 * #GVariant of incorrect type.
13248 * If an existing callback is already registered at @object_path and
13249 * @interface_name, then @error is set to #G_IO_ERROR_EXISTS.
13251 * GDBus automatically implements the standard D-Bus interfaces
13252 * org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable
13253 * and org.freedesktop.Peer, so you don't have to implement those for
13254 * the objects you export. You <emphasis>can</emphasis> implement
13255 * org.freedesktop.DBus.Properties yourself, e.g. to handle getting
13256 * and setting of properties asynchronously.
13258 * Note that the reference count on @interface_info will be
13259 * incremented by 1 (unless allocated statically, e.g. if the
13260 * reference count is -1, see g_dbus_interface_info_ref()) for as long
13261 * as the object is exported. Also note that @vtable will be copied.
13263 * See <xref linkend="gdbus-server"/> for an example of how to use this method.
13265 * Returns: 0 if @error is set, otherwise a registration id (never 0) that can be used with g_dbus_connection_unregister_object() .
13271 * g_dbus_connection_register_subtree:
13272 * @connection: A #GDBusConnection.
13273 * @object_path: The object path to register the subtree at.
13274 * @vtable: A #GDBusSubtreeVTable to enumerate, introspect and dispatch nodes in the subtree.
13275 * @flags: Flags used to fine tune the behavior of the subtree.
13276 * @user_data: Data to pass to functions in @vtable.
13277 * @user_data_free_func: Function to call when the subtree is unregistered.
13278 * @error: Return location for error or %NULL.
13280 * Registers a whole subtree of <quote>dynamic</quote> objects.
13282 * The @enumerate and @introspection functions in @vtable are used to
13283 * convey, to remote callers, what nodes exist in the subtree rooted
13286 * When handling remote calls into any node in the subtree, first the
13287 * @enumerate function is used to check if the node exists. If the node exists
13288 * or the #G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is set
13289 * the @introspection function is used to check if the node supports the
13290 * requested method. If so, the @dispatch function is used to determine
13291 * where to dispatch the call. The collected #GDBusInterfaceVTable and
13292 * #gpointer will be used to call into the interface vtable for processing
13295 * All calls into user-provided code will be invoked in the <link
13296 * linkend="g-main-context-push-thread-default">thread-default main
13297 * loop</link> of the thread you are calling this method from.
13299 * If an existing subtree is already registered at @object_path or
13300 * then @error is set to #G_IO_ERROR_EXISTS.
13302 * Note that it is valid to register regular objects (using
13303 * g_dbus_connection_register_object()) in a subtree registered with
13304 * g_dbus_connection_register_subtree() - if so, the subtree handler
13305 * is tried as the last resort. One way to think about a subtree
13306 * handler is to consider it a <quote>fallback handler</quote>
13307 * for object paths not registered via g_dbus_connection_register_object()
13308 * or other bindings.
13310 * Note that @vtable will be copied so you cannot change it after
13313 * See <xref linkend="gdbus-subtree-server"/> for an example of how to use this method.
13315 * Returns: 0 if @error is set, otherwise a subtree registration id (never 0) that can be used with g_dbus_connection_unregister_subtree() .
13321 * g_dbus_connection_remove_filter:
13322 * @connection: a #GDBusConnection
13323 * @filter_id: an identifier obtained from g_dbus_connection_add_filter()
13325 * Removes a filter.
13332 * g_dbus_connection_send_message:
13333 * @connection: A #GDBusConnection.
13334 * @message: A #GDBusMessage
13335 * @flags: Flags affecting how the message is sent.
13336 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13337 * @error: Return location for error or %NULL.
13339 * Asynchronously sends @message to the peer represented by @connection.
13341 * Unless @flags contain the
13342 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13343 * will be assigned by @connection and set on @message via
13344 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13345 * serial number used will be written to this location prior to
13346 * submitting the message to the underlying transport.
13348 * If @connection is closed then the operation will fail with
13349 * %G_IO_ERROR_CLOSED. If @message is not well-formed,
13350 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13352 * See <xref linkend="gdbus-server"/> and <xref
13353 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13354 * low-level API to send and receive UNIX file descriptors.
13356 * Note that @message must be unlocked, unless @flags contain the
13357 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13359 * Returns: %TRUE if the message was well-formed and queued for transmission, %FALSE if @error is set.
13365 * g_dbus_connection_send_message_with_reply:
13366 * @connection: A #GDBusConnection.
13367 * @message: A #GDBusMessage.
13368 * @flags: Flags affecting how the message is sent.
13369 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13370 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13371 * @cancellable: (allow-none): A #GCancellable or %NULL.
13372 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
13373 * @user_data: The data to pass to @callback.
13375 * Asynchronously sends @message to the peer represented by @connection.
13377 * Unless @flags contain the
13378 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13379 * will be assigned by @connection and set on @message via
13380 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13381 * serial number used will be written to this location prior to
13382 * submitting the message to the underlying transport.
13384 * If @connection is closed then the operation will fail with
13385 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13386 * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
13387 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13389 * This is an asynchronous method. When the operation is finished, @callback will be invoked
13390 * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
13391 * of the thread you are calling this method from. You can then call
13392 * g_dbus_connection_send_message_with_reply_finish() to get the result of the operation.
13393 * See g_dbus_connection_send_message_with_reply_sync() for the synchronous version.
13395 * Note that @message must be unlocked, unless @flags contain the
13396 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13398 * See <xref linkend="gdbus-server"/> and <xref
13399 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13400 * low-level API to send and receive UNIX file descriptors.
13407 * g_dbus_connection_send_message_with_reply_finish:
13408 * @connection: a #GDBusConnection
13409 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_send_message_with_reply().
13410 * @error: Return location for error or %NULL.
13412 * Finishes an operation started with g_dbus_connection_send_message_with_reply().
13414 * Note that @error is only set if a local in-process error
13415 * occurred. That is to say that the returned #GDBusMessage object may
13416 * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
13417 * g_dbus_message_to_gerror() to transcode this to a #GError.
13419 * See <xref linkend="gdbus-server"/> and <xref
13420 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13421 * low-level API to send and receive UNIX file descriptors.
13423 * Returns: (transfer full): A locked #GDBusMessage or %NULL if @error is set.
13429 * g_dbus_connection_send_message_with_reply_sync:
13430 * @connection: A #GDBusConnection.
13431 * @message: A #GDBusMessage.
13432 * @flags: Flags affecting how the message is sent.
13433 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13434 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13435 * @cancellable: (allow-none): A #GCancellable or %NULL.
13436 * @error: Return location for error or %NULL.
13438 * Synchronously sends @message to the peer represented by @connection
13439 * and blocks the calling thread until a reply is received or the
13440 * timeout is reached. See g_dbus_connection_send_message_with_reply()
13441 * for the asynchronous version of this method.
13443 * Unless @flags contain the
13444 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13445 * will be assigned by @connection and set on @message via
13446 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13447 * serial number used will be written to this location prior to
13448 * submitting the message to the underlying transport.
13450 * If @connection is closed then the operation will fail with
13451 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13452 * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
13453 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13455 * Note that @error is only set if a local in-process error
13456 * occurred. That is to say that the returned #GDBusMessage object may
13457 * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
13458 * g_dbus_message_to_gerror() to transcode this to a #GError.
13460 * See <xref linkend="gdbus-server"/> and <xref
13461 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13462 * low-level API to send and receive UNIX file descriptors.
13464 * Note that @message must be unlocked, unless @flags contain the
13465 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13467 * Returns: (transfer full): A locked #GDBusMessage that is the reply to @message or %NULL if @error is set.
13473 * g_dbus_connection_set_exit_on_close:
13474 * @connection: A #GDBusConnection.
13475 * @exit_on_close: Whether the process should be terminated when @connection is closed by the remote peer.
13477 * Sets whether the process should be terminated when @connection is
13478 * closed by the remote peer. See #GDBusConnection:exit-on-close for
13481 * Note that this function should be used with care. Most modern UNIX
13482 * desktops tie the notion of a user session the session bus, and expect
13483 * all of a users applications to quit when their bus connection goes away.
13484 * If you are setting @exit_on_close to %FALSE for the shared session
13485 * bus connection, you should make sure that your application exits
13486 * when the user session ends.
13493 * g_dbus_connection_signal_subscribe:
13494 * @connection: A #GDBusConnection.
13495 * @sender: (allow-none): Sender name to match on (unique or well-known name) or %NULL to listen from all senders.
13496 * @interface_name: (allow-none): D-Bus interface name to match on or %NULL to match on all interfaces.
13497 * @member: (allow-none): D-Bus signal name to match on or %NULL to match on all signals.
13498 * @object_path: (allow-none): Object path to match on or %NULL to match on all object paths.
13499 * @arg0: (allow-none): Contents of first string argument to match on or %NULL to match on all kinds of arguments.
13500 * @flags: Flags describing how to subscribe to the signal (currently unused).
13501 * @callback: Callback to invoke when there is a signal matching the requested data.
13502 * @user_data: User data to pass to @callback.
13503 * @user_data_free_func: (allow-none): Function to free @user_data with when subscription is removed or %NULL.
13505 * Subscribes to signals on @connection and invokes @callback with a
13506 * whenever the signal is received. Note that @callback
13507 * will be invoked in the <link
13508 * linkend="g-main-context-push-thread-default">thread-default main
13509 * loop</link> of the thread you are calling this method from.
13511 * If @connection is not a message bus connection, @sender must be
13514 * If @sender is a well-known name note that @callback is invoked with
13515 * the unique name for the owner of @sender, not the well-known name
13516 * as one would expect. This is because the message bus rewrites the
13517 * name. As such, to avoid certain race conditions, users should be
13518 * tracking the name owner of the well-known name and use that when
13519 * processing the received signal.
13521 * Returns: A subscription identifier that can be used with g_dbus_connection_signal_unsubscribe().
13527 * g_dbus_connection_signal_unsubscribe:
13528 * @connection: A #GDBusConnection.
13529 * @subscription_id: A subscription id obtained from g_dbus_connection_signal_subscribe().
13531 * Unsubscribes from signals.
13538 * g_dbus_connection_start_message_processing:
13539 * @connection: A #GDBusConnection.
13541 * If @connection was created with
13542 * %G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method
13543 * starts processing messages. Does nothing on if @connection wasn't
13544 * created with this flag or if the method has already been called.
13551 * g_dbus_connection_unexport_action_group:
13552 * @connection: a #GDBusConnection
13553 * @export_id: the ID from g_dbus_connection_export_action_group()
13555 * Reverses the effect of a previous call to
13556 * g_dbus_connection_export_action_group().
13558 * It is an error to call this function with an ID that wasn't returned
13559 * from g_dbus_connection_export_action_group() or to call it with the
13560 * same ID more than once.
13567 * g_dbus_connection_unexport_menu_model:
13568 * @connection: a #GDBusConnection
13569 * @export_id: the ID from g_dbus_connection_export_menu_model()
13571 * Reverses the effect of a previous call to
13572 * g_dbus_connection_export_menu_model().
13574 * It is an error to call this function with an ID that wasn't returned
13575 * from g_dbus_connection_export_menu_model() or to call it with the
13576 * same ID more than once.
13583 * g_dbus_connection_unregister_object:
13584 * @connection: A #GDBusConnection.
13585 * @registration_id: A registration id obtained from g_dbus_connection_register_object().
13587 * Unregisters an object.
13589 * Returns: %TRUE if the object was unregistered, %FALSE otherwise.
13595 * g_dbus_connection_unregister_subtree:
13596 * @connection: A #GDBusConnection.
13597 * @registration_id: A subtree registration id obtained from g_dbus_connection_register_subtree().
13599 * Unregisters a subtree.
13601 * Returns: %TRUE if the subtree was unregistered, %FALSE otherwise.
13607 * g_dbus_error_encode_gerror:
13608 * @error: A #GError.
13610 * Creates a D-Bus error name to use for @error. If @error matches
13611 * a registered error (cf. g_dbus_error_register_error()), the corresponding
13612 * D-Bus error name will be returned.
13614 * Otherwise the a name of the form
13615 * <literal>org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE</literal>
13616 * will be used. This allows other GDBus applications to map the error
13617 * on the wire back to a #GError using g_dbus_error_new_for_dbus_error().
13619 * This function is typically only used in object mappings to put a
13620 * #GError on the wire. Regular applications should not use it.
13622 * Returns: A D-Bus error name (never %NULL). Free with g_free().
13628 * g_dbus_error_get_remote_error:
13629 * @error: A #GError.
13631 * Gets the D-Bus error name used for @error, if any.
13633 * This function is guaranteed to return a D-Bus error name for all
13634 * #GError<!-- -->s returned from functions handling remote method
13635 * calls (e.g. g_dbus_connection_call_finish()) unless
13636 * g_dbus_error_strip_remote_error() has been used on @error.
13638 * Returns: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
13644 * g_dbus_error_is_remote_error:
13645 * @error: A #GError.
13647 * Checks if @error represents an error received via D-Bus from a remote peer. If so,
13648 * use g_dbus_error_get_remote_error() to get the name of the error.
13650 * Returns: %TRUE if @error represents an error from a remote peer, %FALSE otherwise.
13656 * g_dbus_error_new_for_dbus_error:
13657 * @dbus_error_name: D-Bus error name.
13658 * @dbus_error_message: D-Bus error message.
13660 * Creates a #GError based on the contents of @dbus_error_name and
13661 * @dbus_error_message.
13663 * Errors registered with g_dbus_error_register_error() will be looked
13664 * up using @dbus_error_name and if a match is found, the error domain
13665 * and code is used. Applications can use g_dbus_error_get_remote_error()
13666 * to recover @dbus_error_name.
13668 * If a match against a registered error is not found and the D-Bus
13669 * error name is in a form as returned by g_dbus_error_encode_gerror()
13670 * the error domain and code encoded in the name is used to
13671 * create the #GError. Also, @dbus_error_name is added to the error message
13672 * such that it can be recovered with g_dbus_error_get_remote_error().
13674 * Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR
13675 * in the #G_IO_ERROR error domain is returned. Also, @dbus_error_name is
13676 * added to the error message such that it can be recovered with
13677 * g_dbus_error_get_remote_error().
13679 * In all three cases, @dbus_error_name can always be recovered from the
13680 * returned #GError using the g_dbus_error_get_remote_error() function
13681 * (unless g_dbus_error_strip_remote_error() hasn't been used on the returned error).
13683 * This function is typically only used in object mappings to prepare
13684 * #GError instances for applications. Regular applications should not use
13687 * Returns: An allocated #GError. Free with g_error_free().
13693 * g_dbus_error_register_error:
13694 * @error_domain: A #GQuark for a error domain.
13695 * @error_code: An error code.
13696 * @dbus_error_name: A D-Bus error name.
13698 * Creates an association to map between @dbus_error_name and
13699 * #GError<!-- -->s specified by @error_domain and @error_code.
13701 * This is typically done in the routine that returns the #GQuark for
13704 * Returns: %TRUE if the association was created, %FALSE if it already exists.
13710 * g_dbus_error_register_error_domain:
13711 * @error_domain_quark_name: The error domain name.
13712 * @quark_volatile: A pointer where to store the #GQuark.
13713 * @entries: A pointer to @num_entries #GDBusErrorEntry struct items.
13714 * @num_entries: Number of items to register.
13716 * Helper function for associating a #GError error domain with D-Bus error names.
13723 * g_dbus_error_set_dbus_error:
13724 * @error: A pointer to a #GError or %NULL.
13725 * @dbus_error_name: D-Bus error name.
13726 * @dbus_error_message: D-Bus error message.
13727 * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
13728 * @...: Arguments for @format.
13730 * Does nothing if @error is %NULL. Otherwise sets *@error to
13731 * a new #GError created with g_dbus_error_new_for_dbus_error()
13732 * with @dbus_error_message prepend with @format (unless %NULL).
13739 * g_dbus_error_set_dbus_error_valist:
13740 * @error: A pointer to a #GError or %NULL.
13741 * @dbus_error_name: D-Bus error name.
13742 * @dbus_error_message: D-Bus error message.
13743 * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
13744 * @var_args: Arguments for @format.
13746 * Like g_dbus_error_set_dbus_error() but intended for language bindings.
13753 * g_dbus_error_strip_remote_error:
13754 * @error: A #GError.
13756 * Looks for extra information in the error message used to recover
13757 * the D-Bus error name and strips it if found. If stripped, the
13758 * message field in @error will correspond exactly to what was
13759 * received on the wire.
13761 * This is typically used when presenting errors to the end user.
13763 * Returns: %TRUE if information was stripped, %FALSE otherwise.
13769 * g_dbus_error_unregister_error:
13770 * @error_domain: A #GQuark for a error domain.
13771 * @error_code: An error code.
13772 * @dbus_error_name: A D-Bus error name.
13774 * Destroys an association previously set up with g_dbus_error_register_error().
13776 * Returns: %TRUE if the association was destroyed, %FALSE if it wasn't found.
13782 * g_dbus_generate_guid:
13784 * Generate a D-Bus GUID that can be used with
13785 * e.g. g_dbus_connection_new().
13787 * See the D-Bus specification regarding what strings are valid D-Bus
13788 * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
13790 * Returns: A valid D-Bus GUID. Free with g_free().
13796 * g_dbus_gvalue_to_gvariant:
13797 * @gvalue: A #GValue to convert to a #GVariant.
13798 * @type: A #GVariantType.
13800 * Converts a #GValue to a #GVariant of the type indicated by the @type parameter.
13802 * The conversion is using the following rules:
13803 * <table frame='all'>
13804 * <title>#GValue / #GVariant conversion rules</title>
13805 * <tgroup cols='2' align='left' colsep='1' rowsep='1'>
13808 * <entry>If the #GType for @gvalue is...</entry>
13809 * <entry>... then @type must be</entry>
13814 * <entry>#G_TYPE_STRING</entry>
13815 * <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>
13818 * <entry>#G_TYPE_STRV</entry>
13819 * <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>
13822 * <entry>#G_TYPE_BOOLEAN</entry>
13823 * <entry><link linkend="G-VARIANT-TYPE-BOOLEAN:CAPS">'b'</link></entry>
13826 * <entry>#G_TYPE_UCHAR</entry>
13827 * <entry><link linkend="G-VARIANT-TYPE-BYTE:CAPS">'y'</link></entry>
13830 * <entry>#G_TYPE_INT</entry>
13831 * <entry><link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link> or <link linkend="G-VARIANT-TYPE-INT16:CAPS">'n'</link></entry>
13834 * <entry>#G_TYPE_UINT</entry>
13835 * <entry><link linkend="G-VARIANT-TYPE-UINT32:CAPS">'u'</link> or <link linkend="G-VARIANT-TYPE-UINT16:CAPS">'q'</link></entry>
13838 * <entry>#G_TYPE_INT64</entry>
13839 * <entry><link linkend="G-VARIANT-TYPE-INT64:CAPS">'x'</link></entry>
13842 * <entry>#G_TYPE_UINT64</entry>
13843 * <entry><link linkend="G-VARIANT-TYPE-UINT64:CAPS">'t'</link></entry>
13846 * <entry>#G_TYPE_DOUBLE</entry>
13847 * <entry><link linkend="G-VARIANT-TYPE-DOUBLE:CAPS">'d'</link></entry>
13850 * <entry>#G_TYPE_VARIANT</entry>
13851 * <entry>Any #GVariantType</entry>
13856 * This can fail if e.g. @gvalue is of type #G_TYPE_STRING and @type
13857 * is <link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link>. It will
13858 * also fail for any #GType (including e.g. #G_TYPE_OBJECT and
13859 * #G_TYPE_BOXED derived-types) not in the table above.
13861 * Note that if @gvalue is of type #G_TYPE_VARIANT and its value is
13862 * %NULL, the <emphasis>empty</emphasis> #GVariant instance (never
13863 * %NULL) for @type is returned (e.g. 0 for scalar types, the empty
13864 * string for string types, <literal>'/'</literal> for object path
13865 * types, the empty array for any array type and so on).
13867 * See the g_dbus_gvariant_to_gvalue() function for how to convert a
13868 * #GVariant to a #GValue.
13870 * Returns: A #GVariant (never floating) of #GVariantType @type holding the data from @gvalue or %NULL in case of failure. Free with g_variant_unref().
13876 * g_dbus_gvariant_to_gvalue:
13877 * @value: A #GVariant.
13878 * @out_gvalue: (out): Return location pointing to a zero-filled (uninitialized) #GValue.
13880 * Converts a #GVariant to a #GValue. If @value is floating, it is consumed.
13882 * The rules specified in the g_dbus_gvalue_to_gvariant() function are
13883 * used - this function is essentially its reverse form.
13885 * The conversion never fails - a valid #GValue is always returned in
13893 * g_dbus_interface_dup_object:
13894 * @interface_: An exported D-Bus interface.
13896 * Gets the #GDBusObject that @interface_ belongs to, if any.
13898 * Returns: (transfer full): A #GDBusObject or %NULL. The returned reference should be freed with g_object_unref().
13900 * Rename to: g_dbus_interface_get_object
13905 * g_dbus_interface_get_info:
13906 * @interface_: An exported D-Bus interface.
13908 * Gets D-Bus introspection information for the D-Bus interface
13909 * implemented by @interface_.
13911 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
13917 * g_dbus_interface_get_object: (skip)
13918 * @interface_: An exported D-Bus interface.
13920 * Gets the #GDBusObject that @interface_ belongs to, if any.
13922 * <warning>It is not safe to use the returned object if @interface_
13923 * or the returned object is being used from other threads. See
13924 * g_dbus_interface_dup_object() for a thread-safe
13925 * alternative.</warning>
13927 * Returns: (transfer none): A #GDBusObject or %NULL. The returned reference belongs to @interface_ and should not be freed.
13933 * g_dbus_interface_info_cache_build:
13934 * @info: A #GDBusInterfaceInfo.
13936 * Builds a lookup-cache to speed up
13937 * g_dbus_interface_info_lookup_method(),
13938 * g_dbus_interface_info_lookup_signal() and
13939 * g_dbus_interface_info_lookup_property().
13941 * If this has already been called with @info, the existing cache is
13942 * used and its use count is increased.
13944 * Note that @info cannot be modified until
13945 * g_dbus_interface_info_cache_release() is called.
13952 * g_dbus_interface_info_cache_release:
13953 * @info: A GDBusInterfaceInfo
13955 * Decrements the usage count for the cache for @info built by
13956 * g_dbus_interface_info_cache_build() (if any) and frees the
13957 * resources used by the cache if the usage count drops to zero.
13964 * g_dbus_interface_info_generate_xml:
13965 * @info: A #GDBusNodeInfo
13966 * @indent: Indentation level.
13967 * @string_builder: (out): A #GString to to append XML data to.
13969 * Appends an XML representation of @info (and its children) to @string_builder.
13971 * This function is typically used for generating introspection XML
13972 * documents at run-time for handling the
13973 * <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>
13981 * g_dbus_interface_info_lookup_method:
13982 * @info: A #GDBusInterfaceInfo.
13983 * @name: A D-Bus method name (typically in CamelCase)
13985 * Looks up information about a method.
13987 * This cost of this function is O(n) in number of methods unless
13988 * g_dbus_interface_info_cache_build() has been used on @info.
13990 * Returns: (transfer none): A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info.
13996 * g_dbus_interface_info_lookup_property:
13997 * @info: A #GDBusInterfaceInfo.
13998 * @name: A D-Bus property name (typically in CamelCase).
14000 * Looks up information about a property.
14002 * This cost of this function is O(n) in number of properties unless
14003 * g_dbus_interface_info_cache_build() has been used on @info.
14005 * Returns: (transfer none): A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info.
14011 * g_dbus_interface_info_lookup_signal:
14012 * @info: A #GDBusInterfaceInfo.
14013 * @name: A D-Bus signal name (typically in CamelCase)
14015 * Looks up information about a signal.
14017 * This cost of this function is O(n) in number of signals unless
14018 * g_dbus_interface_info_cache_build() has been used on @info.
14020 * Returns: (transfer none): A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info.
14026 * g_dbus_interface_info_ref:
14027 * @info: A #GDBusInterfaceInfo
14029 * If @info is statically allocated does nothing. Otherwise increases
14030 * the reference count.
14032 * Returns: The same @info.
14038 * g_dbus_interface_info_unref:
14039 * @info: A #GDBusInterfaceInfo.
14041 * If @info is statically allocated, does nothing. Otherwise decreases
14042 * the reference count of @info. When its reference count drops to 0,
14043 * the memory used is freed.
14050 * g_dbus_interface_set_object:
14051 * @interface_: An exported D-Bus interface.
14052 * @object: (allow-none): A #GDBusObject or %NULL.
14054 * Sets the #GDBusObject for @interface_ to @object.
14056 * Note that @interface_ will hold a weak reference to @object.
14063 * g_dbus_interface_skeleton_export:
14064 * @interface_: The D-Bus interface to export.
14065 * @connection: A #GDBusConnection to export @interface_ on.
14066 * @object_path: The path to export the interface at.
14067 * @error: Return location for error or %NULL.
14069 * Exports @interface_ at @object_path on @connection.
14071 * This can be called multiple times to export the same @interface_
14072 * onto multiple connections however the @object_path provided must be
14073 * the same for all connections.
14075 * Use g_dbus_interface_skeleton_unexport() to unexport the object.
14077 * Returns: %TRUE if the interface was exported on @connection, otherwise %FALSE with @error set.
14083 * g_dbus_interface_skeleton_flush:
14084 * @interface_: A #GDBusInterfaceSkeleton.
14086 * If @interface_ has outstanding changes, request for these changes to be
14087 * emitted immediately.
14089 * For example, an exported D-Bus interface may queue up property
14090 * changes and emit the
14091 * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
14092 * signal later (e.g. in an idle handler). This technique is useful
14093 * for collapsing multiple property changes into one.
14100 * g_dbus_interface_skeleton_get_connection:
14101 * @interface_: A #GDBusInterfaceSkeleton.
14103 * Gets the first connection that @interface_ is exported on, if any.
14105 * Returns: (transfer none): A #GDBusConnection or %NULL if @interface_ is not exported anywhere. Do not free, the object belongs to @interface_.
14111 * g_dbus_interface_skeleton_get_connections:
14112 * @interface_: A #GDBusInterfaceSkeleton.
14114 * Gets a list of the connections that @interface_ is exported on.
14116 * 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().
14122 * g_dbus_interface_skeleton_get_flags:
14123 * @interface_: A #GDBusInterfaceSkeleton.
14125 * Gets the #GDBusInterfaceSkeletonFlags that describes what the behavior
14128 * Returns: One or more flags from the #GDBusInterfaceSkeletonFlags enumeration.
14134 * g_dbus_interface_skeleton_get_info:
14135 * @interface_: A #GDBusInterfaceSkeleton.
14137 * Gets D-Bus introspection information for the D-Bus interface
14138 * implemented by @interface_.
14140 * Returns: (transfer none): A #GDBusInterfaceInfo (never %NULL). Do not free.
14146 * g_dbus_interface_skeleton_get_object_path:
14147 * @interface_: A #GDBusInterfaceSkeleton.
14149 * Gets the object path that @interface_ is exported on, if any.
14151 * Returns: A string owned by @interface_ or %NULL if @interface_ is not exported anywhere. Do not free, the string belongs to @interface_.
14157 * g_dbus_interface_skeleton_get_properties:
14158 * @interface_: A #GDBusInterfaceSkeleton.
14160 * Gets all D-Bus properties for @interface_.
14162 * Returns: (transfer full): A #GVariant of type <link linkend="G-VARIANT-TYPE-VARDICT:CAPS">'a{sv}'</link>. Free with g_variant_unref().
14168 * g_dbus_interface_skeleton_get_vtable: (skip)
14169 * @interface_: A #GDBusInterfaceSkeleton.
14171 * Gets the interface vtable for the D-Bus interface implemented by
14172 * @interface_. The returned function pointers should expect @interface_
14173 * itself to be passed as @user_data.
14175 * Returns: A #GDBusInterfaceVTable (never %NULL).
14181 * g_dbus_interface_skeleton_has_connection:
14182 * @interface_: A #GDBusInterfaceSkeleton.
14183 * @connection: A #GDBusConnection.
14185 * Checks if @interface_ is export on @connection.
14187 * Returns: %TRUE if @interface_ is exported on @connection, %FALSE otherwise.
14193 * g_dbus_interface_skeleton_set_flags:
14194 * @interface_: A #GDBusInterfaceSkeleton.
14195 * @flags: Flags from the #GDBusInterfaceSkeletonFlags enumeration.
14197 * Sets flags describing what the behavior of @skeleton should be.
14204 * g_dbus_interface_skeleton_unexport:
14205 * @interface_: A #GDBusInterfaceSkeleton.
14207 * Stops exporting @interface_ on all connections it is exported on.
14209 * To unexport @interface_ from only a single connection, use
14210 * g_dbus_interface_skeleton_unexport_from_connection()
14217 * g_dbus_interface_skeleton_unexport_from_connection:
14218 * @interface_: A #GDBusInterfaceSkeleton.
14219 * @connection: A #GDBusConnection.
14221 * Stops exporting @interface_ on @connection.
14223 * To stop exporting on all connections the interface is exported on,
14224 * use g_dbus_interface_skeleton_unexport().
14231 * g_dbus_is_address:
14232 * @string: A string.
14234 * Checks if @string is a D-Bus address.
14236 * This doesn't check if @string is actually supported by #GDBusServer
14237 * or #GDBusConnection - use g_dbus_is_supported_address() to do more
14240 * Returns: %TRUE if @string is a valid D-Bus address, %FALSE otherwise.
14247 * @string: The string to check.
14249 * Checks if @string is a D-Bus GUID.
14251 * See the D-Bus specification regarding what strings are valid D-Bus
14252 * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
14254 * Returns: %TRUE if @string is a guid, %FALSE otherwise.
14260 * g_dbus_is_interface_name:
14261 * @string: The string to check.
14263 * Checks if @string is a valid D-Bus interface name.
14265 * Returns: %TRUE if valid, %FALSE otherwise.
14271 * g_dbus_is_member_name:
14272 * @string: The string to check.
14274 * Checks if @string is a valid D-Bus member (e.g. signal or method) name.
14276 * Returns: %TRUE if valid, %FALSE otherwise.
14283 * @string: The string to check.
14285 * Checks if @string is a valid D-Bus bus name (either unique or well-known).
14287 * Returns: %TRUE if valid, %FALSE otherwise.
14293 * g_dbus_is_supported_address:
14294 * @string: A string.
14295 * @error: Return location for error or %NULL.
14297 * Like g_dbus_is_address() but also checks if the library suppors the
14298 * transports in @string and that key/value pairs for each transport
14301 * Returns: %TRUE if @string is a valid D-Bus address that is supported by this library, %FALSE if @error is set.
14307 * g_dbus_is_unique_name:
14308 * @string: The string to check.
14310 * Checks if @string is a valid D-Bus unique bus name.
14312 * Returns: %TRUE if valid, %FALSE otherwise.
14318 * g_dbus_menu_model_get:
14319 * @connection: a #GDBusConnection
14320 * @bus_name: the bus name which exports the menu model
14321 * @object_path: the object path at which the menu model is exported
14323 * Obtains a #GDBusMenuModel for the menu model which is exported
14324 * at the given @bus_name and @object_path.
14326 * The thread default main context is taken at the time of this call.
14327 * All signals on the menu model (and any linked models) are reported
14328 * with respect to this context. All calls on the returned menu model
14329 * (and linked models) must also originate from this same context, with
14330 * the thread default main context unchanged.
14332 * Returns: (transfer full): a #GDBusMenuModel object. Free with g_object_unref().
14338 * g_dbus_message_bytes_needed:
14339 * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
14340 * @blob_len: The length of @blob (must be at least 16).
14341 * @error: Return location for error or %NULL.
14343 * Utility function to calculate how many bytes are needed to
14344 * completely deserialize the D-Bus message stored at @blob.
14346 * 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).
14352 * g_dbus_message_copy:
14353 * @message: A #GDBusMessage.
14354 * @error: Return location for error or %NULL.
14356 * Copies @message. The copy is a deep copy and the returned
14357 * #GDBusMessage is completely identical except that it is guaranteed
14358 * to not be locked.
14360 * This operation can fail if e.g. @message contains file descriptors
14361 * and the per-process or system-wide open files limit is reached.
14363 * Returns: (transfer full): A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
14369 * g_dbus_message_get_arg0:
14370 * @message: A #GDBusMessage.
14372 * Convenience to get the first item in the body of @message.
14374 * Returns: The string item or %NULL if the first item in the body of @message is not a string.
14380 * g_dbus_message_get_body:
14381 * @message: A #GDBusMessage.
14383 * Gets the body of a message.
14385 * Returns: A #GVariant or %NULL if the body is empty. Do not free, it is owned by @message.
14391 * g_dbus_message_get_byte_order:
14392 * @message: A #GDBusMessage.
14394 * Gets the byte order of @message.
14396 * Returns: The byte order.
14401 * g_dbus_message_get_destination:
14402 * @message: A #GDBusMessage.
14404 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14406 * Returns: The value.
14412 * g_dbus_message_get_error_name:
14413 * @message: A #GDBusMessage.
14415 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
14417 * Returns: The value.
14423 * g_dbus_message_get_flags:
14424 * @message: A #GDBusMessage.
14426 * Gets the flags for @message.
14428 * Returns: Flags that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
14434 * g_dbus_message_get_header:
14435 * @message: A #GDBusMessage.
14436 * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
14438 * Gets a header field on @message.
14440 * Returns: A #GVariant with the value if the header was found, %NULL otherwise. Do not free, it is owned by @message.
14446 * g_dbus_message_get_header_fields:
14447 * @message: A #GDBusMessage.
14449 * Gets an array of all header fields on @message that are set.
14451 * 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().
14457 * g_dbus_message_get_interface:
14458 * @message: A #GDBusMessage.
14460 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
14462 * Returns: The value.
14468 * g_dbus_message_get_locked:
14469 * @message: A #GDBusMessage.
14471 * Checks whether @message is locked. To monitor changes to this
14472 * value, conncet to the #GObject::notify signal to listen for changes
14473 * on the #GDBusMessage:locked property.
14475 * Returns: %TRUE if @message is locked, %FALSE otherwise.
14481 * g_dbus_message_get_member:
14482 * @message: A #GDBusMessage.
14484 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
14486 * Returns: The value.
14492 * g_dbus_message_get_message_type:
14493 * @message: A #GDBusMessage.
14495 * Gets the type of @message.
14497 * Returns: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
14503 * g_dbus_message_get_num_unix_fds:
14504 * @message: A #GDBusMessage.
14506 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
14508 * Returns: The value.
14514 * g_dbus_message_get_path:
14515 * @message: A #GDBusMessage.
14517 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
14519 * Returns: The value.
14525 * g_dbus_message_get_reply_serial:
14526 * @message: A #GDBusMessage.
14528 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
14530 * Returns: The value.
14536 * g_dbus_message_get_sender:
14537 * @message: A #GDBusMessage.
14539 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
14541 * Returns: The value.
14547 * g_dbus_message_get_serial:
14548 * @message: A #GDBusMessage.
14550 * Gets the serial for @message.
14552 * Returns: A #guint32.
14558 * g_dbus_message_get_signature:
14559 * @message: A #GDBusMessage.
14561 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
14563 * Returns: The value.
14569 * g_dbus_message_get_unix_fd_list:
14570 * @message: A #GDBusMessage.
14572 * Gets the UNIX file descriptors associated with @message, if any.
14574 * This method is only available on UNIX.
14576 * Returns: (transfer none): A #GUnixFDList or %NULL if no file descriptors are associated. Do not free, this object is owned by @message.
14582 * g_dbus_message_lock:
14583 * @message: A #GDBusMessage.
14585 * If @message is locked, does nothing. Otherwise locks the message.
14592 * g_dbus_message_new:
14594 * Creates a new empty #GDBusMessage.
14596 * Returns: A #GDBusMessage. Free with g_object_unref().
14602 * g_dbus_message_new_from_blob:
14603 * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
14604 * @blob_len: The length of @blob.
14605 * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
14606 * @error: Return location for error or %NULL.
14608 * Creates a new #GDBusMessage from the data stored at @blob. The byte
14609 * order that the message was in can be retrieved using
14610 * g_dbus_message_get_byte_order().
14612 * Returns: A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
14618 * g_dbus_message_new_method_call:
14619 * @name: (allow-none): A valid D-Bus name or %NULL.
14620 * @path: A valid object path.
14621 * @interface_: (allow-none): A valid D-Bus interface name or %NULL.
14622 * @method: A valid method name.
14624 * Creates a new #GDBusMessage for a method call.
14626 * Returns: A #GDBusMessage. Free with g_object_unref().
14632 * g_dbus_message_new_method_error:
14633 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14634 * @error_name: A valid D-Bus error name.
14635 * @error_message_format: The D-Bus error message in a printf() format.
14636 * @...: Arguments for @error_message_format.
14638 * Creates a new #GDBusMessage that is an error reply to @method_call_message.
14640 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14646 * g_dbus_message_new_method_error_literal:
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: The D-Bus error message.
14651 * Creates a new #GDBusMessage that is an error reply to @method_call_message.
14653 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14659 * g_dbus_message_new_method_error_valist:
14660 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14661 * @error_name: A valid D-Bus error name.
14662 * @error_message_format: The D-Bus error message in a printf() format.
14663 * @var_args: Arguments for @error_message_format.
14665 * Like g_dbus_message_new_method_error() but intended for language bindings.
14667 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14673 * g_dbus_message_new_method_reply:
14674 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14676 * Creates a new #GDBusMessage that is a reply to @method_call_message.
14678 * Returns: (transfer full): #GDBusMessage. Free with g_object_unref().
14684 * g_dbus_message_new_signal:
14685 * @path: A valid object path.
14686 * @interface_: A valid D-Bus interface name.
14687 * @signal: A valid signal name.
14689 * Creates a new #GDBusMessage for a signal emission.
14691 * Returns: A #GDBusMessage. Free with g_object_unref().
14697 * g_dbus_message_print:
14698 * @message: A #GDBusMessage.
14699 * @indent: Indentation level.
14701 * Produces a human-readable multi-line description of @message.
14703 * The contents of the description has no ABI guarantees, the contents
14704 * and formatting is subject to change at any time. Typical output
14705 * looks something like this:
14707 * Type: method-call
14708 * Flags: none
14712 * path -> objectpath '/org/gtk/GDBus/TestObject'
14713 * interface -> 'org.gtk.GDBus.TestInterface'
14714 * member -> 'GimmeStdout'
14715 * destination -> ':1.146'
14717 * UNIX File Descriptors:
14719 * </programlisting>
14722 * Type: method-return
14723 * Flags: no-reply-expected
14725 * Serial: 477
14727 * reply-serial -> uint32 4
14728 * destination -> ':1.159'
14729 * sender -> ':1.146'
14730 * num-unix-fds -> uint32 1
14732 * UNIX File Descriptors:
14733 * fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635
14734 * </programlisting>
14736 * Returns: A string that should be freed with g_free().
14742 * g_dbus_message_set_body:
14743 * @message: A #GDBusMessage.
14744 * @body: Either %NULL or a #GVariant that is a tuple.
14746 * Sets the body @message. As a side-effect the
14747 * %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the
14748 * type string of @body (or cleared if @body is %NULL).
14750 * If @body is floating, @message assumes ownership of @body.
14757 * g_dbus_message_set_byte_order:
14758 * @message: A #GDBusMessage.
14759 * @byte_order: The byte order.
14761 * Sets the byte order of @message.
14766 * g_dbus_message_set_destination:
14767 * @message: A #GDBusMessage.
14768 * @value: The value to set.
14770 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14777 * g_dbus_message_set_error_name:
14778 * @message: A #GDBusMessage.
14779 * @value: The value to set.
14781 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
14788 * g_dbus_message_set_flags:
14789 * @message: A #GDBusMessage.
14790 * @flags: Flags for @message that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
14792 * Sets the flags to set on @message.
14799 * g_dbus_message_set_header:
14800 * @message: A #GDBusMessage.
14801 * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
14802 * @value: (allow-none): A #GVariant to set the header field or %NULL to clear the header field.
14804 * Sets a header field on @message.
14806 * If @value is floating, @message assumes ownership of @value.
14813 * g_dbus_message_set_interface:
14814 * @message: A #GDBusMessage.
14815 * @value: The value to set.
14817 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
14824 * g_dbus_message_set_member:
14825 * @message: A #GDBusMessage.
14826 * @value: The value to set.
14828 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
14835 * g_dbus_message_set_message_type:
14836 * @message: A #GDBusMessage.
14837 * @type: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
14839 * Sets @message to be of @type.
14846 * g_dbus_message_set_num_unix_fds:
14847 * @message: A #GDBusMessage.
14848 * @value: The value to set.
14850 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
14857 * g_dbus_message_set_path:
14858 * @message: A #GDBusMessage.
14859 * @value: The value to set.
14861 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
14868 * g_dbus_message_set_reply_serial:
14869 * @message: A #GDBusMessage.
14870 * @value: The value to set.
14872 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
14879 * g_dbus_message_set_sender:
14880 * @message: A #GDBusMessage.
14881 * @value: The value to set.
14883 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
14890 * g_dbus_message_set_serial:
14891 * @message: A #GDBusMessage.
14892 * @serial: A #guint32.
14894 * Sets the serial for @message.
14901 * g_dbus_message_set_signature:
14902 * @message: A #GDBusMessage.
14903 * @value: The value to set.
14905 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
14912 * g_dbus_message_set_unix_fd_list:
14913 * @message: A #GDBusMessage.
14914 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
14916 * Sets the UNIX file descriptors associated with @message. As a
14917 * side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header
14918 * field is set to the number of fds in @fd_list (or cleared if
14919 * @fd_list is %NULL).
14921 * This method is only available on UNIX.
14928 * g_dbus_message_to_blob:
14929 * @message: A #GDBusMessage.
14930 * @out_size: Return location for size of generated blob.
14931 * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
14932 * @error: Return location for error.
14934 * Serializes @message to a blob. The byte order returned by
14935 * g_dbus_message_get_byte_order() will be used.
14937 * 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().
14943 * g_dbus_message_to_gerror:
14944 * @message: A #GDBusMessage.
14945 * @error: The #GError to set.
14947 * If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR does
14948 * nothing and returns %FALSE.
14950 * Otherwise this method encodes the error in @message as a #GError
14951 * using g_dbus_error_set_dbus_error() using the information in the
14952 * %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as
14953 * well as the first string item in @message's body.
14955 * Returns: %TRUE if @error was set, %FALSE otherwise.
14961 * g_dbus_method_info_ref:
14962 * @info: A #GDBusMethodInfo
14964 * If @info is statically allocated does nothing. Otherwise increases
14965 * the reference count.
14967 * Returns: The same @info.
14973 * g_dbus_method_info_unref:
14974 * @info: A #GDBusMethodInfo.
14976 * If @info is statically allocated, does nothing. Otherwise decreases
14977 * the reference count of @info. When its reference count drops to 0,
14978 * the memory used is freed.
14985 * g_dbus_method_invocation_get_connection:
14986 * @invocation: A #GDBusMethodInvocation.
14988 * Gets the #GDBusConnection the method was invoked on.
14990 * Returns: (transfer none): A #GDBusConnection. Do not free, it is owned by @invocation.
14996 * g_dbus_method_invocation_get_interface_name:
14997 * @invocation: A #GDBusMethodInvocation.
14999 * Gets the name of the D-Bus interface the method was invoked on.
15001 * Returns: A string. Do not free, it is owned by @invocation.
15007 * g_dbus_method_invocation_get_message:
15008 * @invocation: A #GDBusMethodInvocation.
15010 * Gets the #GDBusMessage for the method invocation. This is useful if
15011 * you need to use low-level protocol features, such as UNIX file
15012 * descriptor passing, that cannot be properly expressed in the
15015 * See <xref linkend="gdbus-server"/> and <xref
15016 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
15017 * low-level API to send and receive UNIX file descriptors.
15019 * Returns: (transfer none): #GDBusMessage. Do not free, it is owned by @invocation.
15025 * g_dbus_method_invocation_get_method_info:
15026 * @invocation: A #GDBusMethodInvocation.
15028 * Gets information about the method call, if any.
15030 * Returns: A #GDBusMethodInfo or %NULL. Do not free, it is owned by @invocation.
15036 * g_dbus_method_invocation_get_method_name:
15037 * @invocation: A #GDBusMethodInvocation.
15039 * Gets the name of the method that was invoked.
15041 * Returns: A string. Do not free, it is owned by @invocation.
15047 * g_dbus_method_invocation_get_object_path:
15048 * @invocation: A #GDBusMethodInvocation.
15050 * Gets the object path the method was invoked on.
15052 * Returns: A string. Do not free, it is owned by @invocation.
15058 * g_dbus_method_invocation_get_parameters:
15059 * @invocation: A #GDBusMethodInvocation.
15061 * Gets the parameters of the method invocation. If there are no input
15062 * parameters then this will return a GVariant with 0 children rather than NULL.
15064 * Returns: (transfer none): A #GVariant tuple. Do not unref this because it is owned by @invocation.
15070 * g_dbus_method_invocation_get_sender:
15071 * @invocation: A #GDBusMethodInvocation.
15073 * Gets the bus name that invoked the method.
15075 * Returns: A string. Do not free, it is owned by @invocation.
15081 * g_dbus_method_invocation_get_user_data: (skip)
15082 * @invocation: A #GDBusMethodInvocation.
15084 * Gets the @user_data #gpointer passed to g_dbus_connection_register_object().
15086 * Returns: A #gpointer.
15092 * g_dbus_method_invocation_return_dbus_error:
15093 * @invocation: (transfer full): A #GDBusMethodInvocation.
15094 * @error_name: A valid D-Bus error name.
15095 * @error_message: A valid D-Bus error message.
15097 * Finishes handling a D-Bus method call by returning an error.
15099 * This method will free @invocation, you cannot use it afterwards.
15106 * g_dbus_method_invocation_return_error:
15107 * @invocation: (transfer full): A #GDBusMethodInvocation.
15108 * @domain: A #GQuark for the #GError error domain.
15109 * @code: The error code.
15110 * @format: printf()-style format.
15111 * @...: Parameters for @format.
15113 * Finishes handling a D-Bus method call by returning an error.
15115 * See g_dbus_error_encode_gerror() for details about what error name
15116 * will be returned on the wire. In a nutshell, if the given error is
15117 * registered using g_dbus_error_register_error() the name given
15118 * during registration is used. Otherwise, a name of the form
15119 * <literal>org.gtk.GDBus.UnmappedGError.Quark...</literal> is
15120 * used. This provides transparent mapping of #GError between
15121 * applications using GDBus.
15123 * If you are writing an application intended to be portable,
15124 * <emphasis>always</emphasis> register errors with g_dbus_error_register_error()
15125 * or use g_dbus_method_invocation_return_dbus_error().
15127 * This method will free @invocation, you cannot use it afterwards.
15134 * g_dbus_method_invocation_return_error_literal:
15135 * @invocation: (transfer full): A #GDBusMethodInvocation.
15136 * @domain: A #GQuark for the #GError error domain.
15137 * @code: The error code.
15138 * @message: The error message.
15140 * Like g_dbus_method_invocation_return_error() but without printf()-style formatting.
15142 * This method will free @invocation, you cannot use it afterwards.
15149 * g_dbus_method_invocation_return_error_valist:
15150 * @invocation: (transfer full): A #GDBusMethodInvocation.
15151 * @domain: A #GQuark for the #GError error domain.
15152 * @code: The error code.
15153 * @format: printf()-style format.
15154 * @var_args: #va_list of parameters for @format.
15156 * Like g_dbus_method_invocation_return_error() but intended for
15157 * language bindings.
15159 * This method will free @invocation, you cannot use it afterwards.
15166 * g_dbus_method_invocation_return_gerror:
15167 * @invocation: (transfer full): A #GDBusMethodInvocation.
15168 * @error: A #GError.
15170 * Like g_dbus_method_invocation_return_error() but takes a #GError
15171 * instead of the error domain, error code and message.
15173 * This method will free @invocation, you cannot use it afterwards.
15180 * g_dbus_method_invocation_return_value:
15181 * @invocation: (transfer full): A #GDBusMethodInvocation.
15182 * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15184 * Finishes handling a D-Bus method call by returning @parameters.
15185 * If the @parameters GVariant is floating, it is consumed.
15187 * It is an error if @parameters is not of the right format.
15189 * This method will free @invocation, you cannot use it afterwards.
15196 * g_dbus_method_invocation_return_value_with_unix_fd_list:
15197 * @invocation: (transfer full): A #GDBusMethodInvocation.
15198 * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15199 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15201 * Like g_dbus_method_invocation_return_value() but also takes a #GUnixFDList.
15203 * This method is only available on UNIX.
15205 * This method will free @invocation, you cannot use it afterwards.
15212 * g_dbus_method_invocation_take_error: (skip)
15213 * @invocation: (transfer full): A #GDBusMethodInvocation.
15214 * @error: (transfer full): A #GError.
15216 * Like g_dbus_method_invocation_return_gerror() but takes ownership
15217 * of @error so the caller does not need to free it.
15219 * This method will free @invocation, you cannot use it afterwards.
15226 * g_dbus_node_info_generate_xml:
15227 * @info: A #GDBusNodeInfo.
15228 * @indent: Indentation level.
15229 * @string_builder: (out): A #GString to to append XML data to.
15231 * Appends an XML representation of @info (and its children) to @string_builder.
15233 * This function is typically used for generating introspection XML documents at run-time for
15234 * handling the <literal>org.freedesktop.DBus.Introspectable.Introspect</literal> method.
15241 * g_dbus_node_info_lookup_interface:
15242 * @info: A #GDBusNodeInfo.
15243 * @name: A D-Bus interface name.
15245 * Looks up information about an interface.
15247 * This cost of this function is O(n) in number of interfaces.
15249 * Returns: (transfer none): A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info.
15255 * g_dbus_node_info_new_for_xml:
15256 * @xml_data: Valid D-Bus introspection XML.
15257 * @error: Return location for error.
15259 * Parses @xml_data and returns a #GDBusNodeInfo representing the data.
15261 * The introspection XML must contain exactly one top-level
15262 * <tag class="starttag">node</tag> element.
15264 * Note that this routine is using a
15265 * <link linkend="glib-Simple-XML-Subset-Parser.description">GMarkup</link>-based
15266 * parser that only accepts a subset of valid XML documents.
15268 * Returns: A #GDBusNodeInfo structure or %NULL if @error is set. Free with g_dbus_node_info_unref().
15274 * g_dbus_node_info_ref:
15275 * @info: A #GDBusNodeInfo
15277 * If @info is statically allocated does nothing. Otherwise increases
15278 * the reference count.
15280 * Returns: The same @info.
15286 * g_dbus_node_info_unref:
15287 * @info: A #GDBusNodeInfo.
15289 * If @info is statically allocated, does nothing. Otherwise decreases
15290 * the reference count of @info. When its reference count drops to 0,
15291 * the memory used is freed.
15298 * g_dbus_object_get_interface:
15299 * @object: A #GDBusObject.
15300 * @interface_name: A D-Bus interface name.
15302 * Gets the D-Bus interface with name @interface_name associated with
15305 * Returns: (transfer full): %NULL if not found, otherwise a #GDBusInterface that must be freed with g_object_unref().
15311 * g_dbus_object_get_interfaces:
15312 * @object: A #GDBusObject.
15314 * Gets the D-Bus interfaces associated with @object.
15316 * 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().
15322 * g_dbus_object_get_object_path:
15323 * @object: A #GDBusObject.
15325 * Gets the object path for @object.
15327 * Returns: A string owned by @object. Do not free.
15333 * g_dbus_object_manager_client_get_connection:
15334 * @manager: A #GDBusObjectManagerClient
15336 * Gets the #GDBusConnection used by @manager.
15338 * Returns: (transfer none): A #GDBusConnection object. Do not free, the object belongs to @manager.
15344 * g_dbus_object_manager_client_get_flags:
15345 * @manager: A #GDBusObjectManagerClient
15347 * Gets the flags that @manager was constructed with.
15349 * Returns: Zero of more flags from the #GDBusObjectManagerClientFlags enumeration.
15355 * g_dbus_object_manager_client_get_name:
15356 * @manager: A #GDBusObjectManagerClient
15358 * Gets the name that @manager is for.
15360 * Returns: A unique or well-known name. Do not free, the string belongs to @manager.
15366 * g_dbus_object_manager_client_get_name_owner:
15367 * @manager: A #GDBusObjectManagerClient.
15369 * The unique name that owns the name that @manager is for or %NULL if
15370 * no-one currently owns that name. You can connect to the
15371 * #GObject::notify signal to track changes to the
15372 * #GDBusObjectManagerClient:name-owner property.
15374 * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
15380 * g_dbus_object_manager_client_new:
15381 * @connection: A #GDBusConnection.
15382 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15383 * @name: The owner of the control object (unique or well-known name).
15384 * @object_path: The object path of the control object.
15385 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15386 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15387 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15388 * @cancellable: (allow-none): A #GCancellable or %NULL
15389 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
15390 * @user_data: The data to pass to @callback.
15392 * Asynchronously creates a new #GDBusObjectManagerClient object.
15394 * This is an asynchronous failable constructor. When the result is
15395 * ready, @callback will be invoked in the
15396 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15397 * of the thread you are calling this method from. You can
15398 * then call g_dbus_object_manager_client_new_finish() to get the result. See
15399 * g_dbus_object_manager_client_new_sync() for the synchronous version.
15406 * g_dbus_object_manager_client_new_finish:
15407 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new().
15408 * @error: Return location for error or %NULL.
15410 * Finishes an operation started with g_dbus_object_manager_client_new().
15412 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15418 * g_dbus_object_manager_client_new_for_bus:
15419 * @bus_type: A #GBusType.
15420 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15421 * @name: The owner of the control object (unique or well-known name).
15422 * @object_path: The object path of the control object.
15423 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15424 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15425 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15426 * @cancellable: (allow-none): A #GCancellable or %NULL
15427 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
15428 * @user_data: The data to pass to @callback.
15430 * Like g_dbus_object_manager_client_new() but takes a #GBusType instead of a
15431 * #GDBusConnection.
15433 * This is an asynchronous failable constructor. When the result is
15434 * ready, @callback will be invoked in the
15435 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15436 * of the thread you are calling this method from. You can
15437 * then call g_dbus_object_manager_client_new_for_bus_finish() to get the result. See
15438 * g_dbus_object_manager_client_new_for_bus_sync() for the synchronous version.
15445 * g_dbus_object_manager_client_new_for_bus_finish:
15446 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus().
15447 * @error: Return location for error or %NULL.
15449 * Finishes an operation started with g_dbus_object_manager_client_new_for_bus().
15451 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15457 * g_dbus_object_manager_client_new_for_bus_sync:
15458 * @bus_type: A #GBusType.
15459 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15460 * @name: The owner of the control object (unique or well-known name).
15461 * @object_path: The object path of the control object.
15462 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15463 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15464 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15465 * @cancellable: (allow-none): A #GCancellable or %NULL
15466 * @error: Return location for error or %NULL.
15468 * Like g_dbus_object_manager_client_new_sync() but takes a #GBusType instead
15469 * of a #GDBusConnection.
15471 * This is a synchronous failable constructor - the calling thread is
15472 * blocked until a reply is received. See g_dbus_object_manager_client_new_for_bus()
15473 * for the asynchronous version.
15475 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15481 * g_dbus_object_manager_client_new_sync:
15482 * @connection: A #GDBusConnection.
15483 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15484 * @name: The owner of the control object (unique or well-known name).
15485 * @object_path: The object path of the control object.
15486 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15487 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15488 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15489 * @cancellable: (allow-none): A #GCancellable or %NULL
15490 * @error: Return location for error or %NULL.
15492 * Creates a new #GDBusObjectManagerClient object.
15494 * This is a synchronous failable constructor - the calling thread is
15495 * blocked until a reply is received. See g_dbus_object_manager_client_new()
15496 * for the asynchronous version.
15498 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15504 * g_dbus_object_manager_get_interface:
15505 * @manager: A #GDBusObjectManager.
15506 * @object_path: Object path to lookup.
15507 * @interface_name: D-Bus interface name to lookup.
15509 * Gets the interface proxy for @interface_name at @object_path, if
15512 * Returns: (transfer full): A #GDBusInterface instance or %NULL. Free with g_object_unref().
15518 * g_dbus_object_manager_get_object:
15519 * @manager: A #GDBusObjectManager.
15520 * @object_path: Object path to lookup.
15522 * Gets the #GDBusObjectProxy at @object_path, if any.
15524 * Returns: (transfer full): A #GDBusObject or %NULL. Free with g_object_unref().
15530 * g_dbus_object_manager_get_object_path:
15531 * @manager: A #GDBusObjectManager.
15533 * Gets the object path that @manager is for.
15535 * Returns: A string owned by @manager. Do not free.
15541 * g_dbus_object_manager_get_objects:
15542 * @manager: A #GDBusObjectManager.
15544 * Gets all #GDBusObject objects known to @manager.
15546 * 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().
15552 * g_dbus_object_manager_server_export:
15553 * @manager: A #GDBusObjectManagerServer.
15554 * @object: A #GDBusObjectSkeleton.
15556 * Exports @object on @manager.
15558 * If there is already a #GDBusObject exported at the object path,
15559 * then the old object is removed.
15561 * The object path for @object must be in the hierarchy rooted by the
15562 * object path for @manager.
15564 * Note that @manager will take a reference on @object for as long as
15572 * g_dbus_object_manager_server_export_uniquely:
15573 * @manager: A #GDBusObjectManagerServer.
15574 * @object: An object.
15576 * Like g_dbus_object_manager_server_export() but appends a string of
15577 * the form <literal>_N</literal> (with N being a natural number) to
15578 * @object<!-- -->'s object path if an object with the given path
15579 * already exists. As such, the #GDBusObjectProxy:g-object-path property
15580 * of @object may be modified.
15587 * g_dbus_object_manager_server_get_connection:
15588 * @manager: A #GDBusObjectManagerServer
15590 * Gets the #GDBusConnection used by @manager.
15592 * 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().
15598 * g_dbus_object_manager_server_is_exported:
15599 * @manager: A #GDBusObjectManagerServer.
15600 * @object: An object.
15602 * Returns whether @object is currently exported on @manager.
15604 * Returns: %TRUE if @object is exported
15610 * g_dbus_object_manager_server_new:
15611 * @object_path: The object path to export the manager object at.
15613 * Creates a new #GDBusObjectManagerServer object.
15615 * The returned server isn't yet exported on any connection. To do so,
15616 * use g_dbus_object_manager_server_set_connection(). Normally you
15617 * want to export all of your objects before doing so to avoid <ulink
15618 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">InterfacesAdded</ulink>
15619 * signals being emitted.
15621 * Returns: A #GDBusObjectManagerServer object. Free with g_object_unref().
15627 * g_dbus_object_manager_server_set_connection:
15628 * @manager: A #GDBusObjectManagerServer.
15629 * @connection: (allow-none): A #GDBusConnection or %NULL.
15631 * Exports all objects managed by @manager on @connection. If
15632 * @connection is %NULL, stops exporting objects.
15637 * g_dbus_object_manager_server_unexport:
15638 * @manager: A #GDBusObjectManagerServer.
15639 * @object_path: An object path.
15641 * If @manager has an object at @path, removes the object. Otherwise
15644 * Note that @object_path must be in the hierarchy rooted by the
15645 * object path for @manager.
15647 * Returns: %TRUE if object at @object_path was removed, %FALSE otherwise.
15653 * g_dbus_object_proxy_get_connection:
15654 * @proxy: a #GDBusObjectProxy
15656 * Gets the connection that @proxy is for.
15658 * Returns: (transfer none): A #GDBusConnection. Do not free, the object is owned by @proxy.
15664 * g_dbus_object_proxy_new:
15665 * @connection: a #GDBusConnection
15666 * @object_path: the object path
15668 * Creates a new #GDBusObjectProxy for the given connection and
15671 * Returns: a new #GDBusObjectProxy
15677 * g_dbus_object_skeleton_add_interface:
15678 * @object: A #GDBusObjectSkeleton.
15679 * @interface_: A #GDBusInterfaceSkeleton.
15681 * Adds @interface_ to @object.
15683 * If @object already contains a #GDBusInterfaceSkeleton with the same
15684 * interface name, it is removed before @interface_ is added.
15686 * Note that @object takes its own reference on @interface_ and holds
15687 * it until removed.
15694 * g_dbus_object_skeleton_flush:
15695 * @object: A #GDBusObjectSkeleton.
15697 * This method simply calls g_dbus_interface_skeleton_flush() on all
15698 * interfaces belonging to @object. See that method for when flushing
15706 * g_dbus_object_skeleton_new:
15707 * @object_path: An object path.
15709 * Creates a new #GDBusObjectSkeleton.
15711 * Returns: A #GDBusObjectSkeleton. Free with g_object_unref().
15717 * g_dbus_object_skeleton_remove_interface:
15718 * @object: A #GDBusObjectSkeleton.
15719 * @interface_: A #GDBusInterfaceSkeleton.
15721 * Removes @interface_ from @object.
15728 * g_dbus_object_skeleton_remove_interface_by_name:
15729 * @object: A #GDBusObjectSkeleton.
15730 * @interface_name: A D-Bus interface name.
15732 * Removes the #GDBusInterface with @interface_name from @object.
15734 * If no D-Bus interface of the given interface exists, this function
15742 * g_dbus_object_skeleton_set_object_path:
15743 * @object: A #GDBusObjectSkeleton.
15744 * @object_path: A valid D-Bus object path.
15746 * Sets the object path for @object.
15753 * g_dbus_property_info_ref:
15754 * @info: A #GDBusPropertyInfo
15756 * If @info is statically allocated does nothing. Otherwise increases
15757 * the reference count.
15759 * Returns: The same @info.
15765 * g_dbus_property_info_unref:
15766 * @info: A #GDBusPropertyInfo.
15768 * If @info is statically allocated, does nothing. Otherwise decreases
15769 * the reference count of @info. When its reference count drops to 0,
15770 * the memory used is freed.
15777 * g_dbus_proxy_call:
15778 * @proxy: A #GDBusProxy.
15779 * @method_name: Name of method to invoke.
15780 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15781 * @flags: Flags from the #GDBusCallFlags enumeration.
15782 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15783 * @cancellable: (allow-none): A #GCancellable or %NULL.
15784 * @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.
15785 * @user_data: The data to pass to @callback.
15787 * Asynchronously invokes the @method_name method on @proxy.
15789 * If @method_name contains any dots, then @name is split into interface and
15790 * method name parts. This allows using @proxy for invoking methods on
15791 * other interfaces.
15793 * If the #GDBusConnection associated with @proxy is closed then
15794 * the operation will fail with %G_IO_ERROR_CLOSED. If
15795 * @cancellable is canceled, the operation will fail with
15796 * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
15797 * compatible with the D-Bus protocol, the operation fails with
15798 * %G_IO_ERROR_INVALID_ARGUMENT.
15800 * If the @parameters #GVariant is floating, it is consumed. This allows
15801 * convenient 'inline' use of g_variant_new(), e.g.:
15803 * g_dbus_proxy_call (proxy,
15805 * g_variant_new ("(ss)",
15808 * G_DBUS_CALL_FLAGS_NONE,
15811 * (GAsyncReadyCallback) two_strings_done,
15815 * If @proxy has an expected interface (see
15816 * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
15817 * then the return value is checked against the return type.
15819 * This is an asynchronous method. When the operation is finished,
15820 * @callback will be invoked in the
15821 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15822 * of the thread you are calling this method from.
15823 * You can then call g_dbus_proxy_call_finish() to get the result of
15824 * the operation. See g_dbus_proxy_call_sync() for the synchronous
15825 * version of this method.
15827 * If @callback is %NULL then the D-Bus method call message will be sent with
15828 * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
15835 * g_dbus_proxy_call_finish:
15836 * @proxy: A #GDBusProxy.
15837 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call().
15838 * @error: Return location for error or %NULL.
15840 * Finishes an operation started with g_dbus_proxy_call().
15842 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15848 * g_dbus_proxy_call_sync:
15849 * @proxy: A #GDBusProxy.
15850 * @method_name: Name of method to invoke.
15851 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15852 * @flags: Flags from the #GDBusCallFlags enumeration.
15853 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15854 * @cancellable: (allow-none): A #GCancellable or %NULL.
15855 * @error: Return location for error or %NULL.
15857 * Synchronously invokes the @method_name method on @proxy.
15859 * If @method_name contains any dots, then @name is split into interface and
15860 * method name parts. This allows using @proxy for invoking methods on
15861 * other interfaces.
15863 * If the #GDBusConnection associated with @proxy is disconnected then
15864 * the operation will fail with %G_IO_ERROR_CLOSED. If
15865 * @cancellable is canceled, the operation will fail with
15866 * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
15867 * compatible with the D-Bus protocol, the operation fails with
15868 * %G_IO_ERROR_INVALID_ARGUMENT.
15870 * If the @parameters #GVariant is floating, it is consumed. This allows
15871 * convenient 'inline' use of g_variant_new(), e.g.:
15873 * g_dbus_proxy_call_sync (proxy,
15875 * g_variant_new ("(ss)",
15878 * G_DBUS_CALL_FLAGS_NONE,
15884 * The calling thread is blocked until a reply is received. See
15885 * g_dbus_proxy_call() for the asynchronous version of this
15888 * If @proxy has an expected interface (see
15889 * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
15890 * then the return value is checked against the return type.
15892 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15898 * g_dbus_proxy_call_with_unix_fd_list:
15899 * @proxy: A #GDBusProxy.
15900 * @method_name: Name of method to invoke.
15901 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15902 * @flags: Flags from the #GDBusCallFlags enumeration.
15903 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15904 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15905 * @cancellable: (allow-none): A #GCancellable or %NULL.
15906 * @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.
15907 * @user_data: The data to pass to @callback.
15909 * Like g_dbus_proxy_call() but also takes a #GUnixFDList object.
15911 * This method is only available on UNIX.
15918 * g_dbus_proxy_call_with_unix_fd_list_finish:
15919 * @proxy: A #GDBusProxy.
15920 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
15921 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call_with_unix_fd_list().
15922 * @error: Return location for error or %NULL.
15924 * Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list().
15926 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15932 * g_dbus_proxy_call_with_unix_fd_list_sync:
15933 * @proxy: A #GDBusProxy.
15934 * @method_name: Name of method to invoke.
15935 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15936 * @flags: Flags from the #GDBusCallFlags enumeration.
15937 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15938 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15939 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
15940 * @cancellable: (allow-none): A #GCancellable or %NULL.
15941 * @error: Return location for error or %NULL.
15943 * Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects.
15945 * This method is only available on UNIX.
15947 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15953 * g_dbus_proxy_get_cached_property:
15954 * @proxy: A #GDBusProxy.
15955 * @property_name: Property name.
15957 * Looks up the value for a property from the cache. This call does no
15960 * If @proxy has an expected interface (see
15961 * #GDBusProxy:g-interface-info) and @property_name is referenced by
15962 * it, then @value is checked against the type of the property.
15964 * 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().
15970 * g_dbus_proxy_get_cached_property_names:
15971 * @proxy: A #GDBusProxy.
15973 * Gets the names of all cached properties on @proxy.
15975 * Returns: (transfer full): A %NULL-terminated array of strings or %NULL if @proxy has no cached properties. Free the returned array with g_strfreev().
15981 * g_dbus_proxy_get_connection:
15982 * @proxy: A #GDBusProxy.
15984 * Gets the connection @proxy is for.
15986 * Returns: (transfer none): A #GDBusConnection owned by @proxy. Do not free.
15992 * g_dbus_proxy_get_default_timeout:
15993 * @proxy: A #GDBusProxy.
15995 * Gets the timeout to use if -1 (specifying default timeout) is
15996 * passed as @timeout_msec in the g_dbus_proxy_call() and
15997 * g_dbus_proxy_call_sync() functions.
15999 * See the #GDBusProxy:g-default-timeout property for more details.
16001 * Returns: Timeout to use for @proxy.
16007 * g_dbus_proxy_get_flags:
16008 * @proxy: A #GDBusProxy.
16010 * Gets the flags that @proxy was constructed with.
16012 * Returns: Flags from the #GDBusProxyFlags enumeration.
16018 * g_dbus_proxy_get_interface_info:
16019 * @proxy: A #GDBusProxy
16021 * Returns the #GDBusInterfaceInfo, if any, specifying the interface
16022 * that @proxy conforms to. See the #GDBusProxy:g-interface-info
16023 * property for more details.
16025 * Returns: A #GDBusInterfaceInfo or %NULL. Do not unref the returned object, it is owned by @proxy.
16031 * g_dbus_proxy_get_interface_name:
16032 * @proxy: A #GDBusProxy.
16034 * Gets the D-Bus interface name @proxy is for.
16036 * Returns: A string owned by @proxy. Do not free.
16042 * g_dbus_proxy_get_name:
16043 * @proxy: A #GDBusProxy.
16045 * Gets the name that @proxy was constructed for.
16047 * Returns: A string owned by @proxy. Do not free.
16053 * g_dbus_proxy_get_name_owner:
16054 * @proxy: A #GDBusProxy.
16056 * The unique name that owns the name that @proxy is for or %NULL if
16057 * no-one currently owns that name. You may connect to the
16058 * #GObject::notify signal to track changes to the
16059 * #GDBusProxy:g-name-owner property.
16061 * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
16067 * g_dbus_proxy_get_object_path:
16068 * @proxy: A #GDBusProxy.
16070 * Gets the object path @proxy is for.
16072 * Returns: A string owned by @proxy. Do not free.
16078 * g_dbus_proxy_new:
16079 * @connection: A #GDBusConnection.
16080 * @flags: Flags used when constructing the proxy.
16081 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16082 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
16083 * @object_path: An object path.
16084 * @interface_name: A D-Bus interface name.
16085 * @cancellable: (allow-none): A #GCancellable or %NULL.
16086 * @callback: Callback function to invoke when the proxy is ready.
16087 * @user_data: User data to pass to @callback.
16089 * Creates a proxy for accessing @interface_name on the remote object
16090 * at @object_path owned by @name at @connection and asynchronously
16091 * loads D-Bus properties unless the
16092 * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. Connect to
16093 * the #GDBusProxy::g-properties-changed signal to get notified about
16094 * property changes.
16096 * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
16097 * match rules for signals. Connect to the #GDBusProxy::g-signal signal
16098 * to handle signals from the remote object.
16100 * If @name is a well-known name and the
16101 * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
16102 * owner currently exists, the message bus will be requested to launch
16103 * a name owner for the name.
16105 * This is a failable asynchronous constructor - when the proxy is
16106 * ready, @callback will be invoked and you can use
16107 * g_dbus_proxy_new_finish() to get the result.
16109 * See g_dbus_proxy_new_sync() and for a synchronous version of this constructor.
16111 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16118 * g_dbus_proxy_new_finish:
16119 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new().
16120 * @error: Return location for error or %NULL.
16122 * Finishes creating a #GDBusProxy.
16124 * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
16130 * g_dbus_proxy_new_for_bus:
16131 * @bus_type: A #GBusType.
16132 * @flags: Flags used when constructing the proxy.
16133 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16134 * @name: A bus name (well-known or unique).
16135 * @object_path: An object path.
16136 * @interface_name: A D-Bus interface name.
16137 * @cancellable: (allow-none): A #GCancellable or %NULL.
16138 * @callback: Callback function to invoke when the proxy is ready.
16139 * @user_data: User data to pass to @callback.
16141 * Like g_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
16143 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16150 * g_dbus_proxy_new_for_bus_finish:
16151 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new_for_bus().
16152 * @error: Return location for error or %NULL.
16154 * Finishes creating a #GDBusProxy.
16156 * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
16162 * g_dbus_proxy_new_for_bus_sync:
16163 * @bus_type: A #GBusType.
16164 * @flags: Flags used when constructing the proxy.
16165 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16166 * @name: A bus name (well-known or unique).
16167 * @object_path: An object path.
16168 * @interface_name: A D-Bus interface name.
16169 * @cancellable: (allow-none): A #GCancellable or %NULL.
16170 * @error: Return location for error or %NULL.
16172 * Like g_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
16174 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16176 * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16182 * g_dbus_proxy_new_sync:
16183 * @connection: A #GDBusConnection.
16184 * @flags: Flags used when constructing the proxy.
16185 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16186 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
16187 * @object_path: An object path.
16188 * @interface_name: A D-Bus interface name.
16189 * @cancellable: (allow-none): A #GCancellable or %NULL.
16190 * @error: (allow-none): Return location for error or %NULL.
16192 * Creates a proxy for accessing @interface_name on the remote object
16193 * at @object_path owned by @name at @connection and synchronously
16194 * loads D-Bus properties unless the
16195 * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used.
16197 * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
16198 * match rules for signals. Connect to the #GDBusProxy::g-signal signal
16199 * to handle signals from the remote object.
16201 * If @name is a well-known name and the
16202 * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
16203 * owner currently exists, the message bus will be requested to launch
16204 * a name owner for the name.
16206 * This is a synchronous failable constructor. See g_dbus_proxy_new()
16207 * and g_dbus_proxy_new_finish() for the asynchronous version.
16209 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16211 * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16217 * g_dbus_proxy_set_cached_property:
16218 * @proxy: A #GDBusProxy
16219 * @property_name: Property name.
16220 * @value: (allow-none): Value for the property or %NULL to remove it from the cache.
16222 * If @value is not %NULL, sets the cached value for the property with
16223 * name @property_name to the value in @value.
16225 * If @value is %NULL, then the cached value is removed from the
16228 * If @proxy has an expected interface (see
16229 * #GDBusProxy:g-interface-info) and @property_name is referenced by
16230 * it, then @value is checked against the type of the property.
16232 * If the @value #GVariant is floating, it is consumed. This allows
16233 * convenient 'inline' use of g_variant_new(), e.g.
16235 * g_dbus_proxy_set_cached_property (proxy,
16237 * g_variant_new ("(si)",
16242 * Normally you will not need to use this method since @proxy is
16243 * tracking changes using the
16244 * <literal>org.freedesktop.DBus.Properties.PropertiesChanged</literal>
16245 * D-Bus signal. However, for performance reasons an object may decide
16246 * to not use this signal for some properties and instead use a
16247 * proprietary out-of-band mechanism to transmit changes.
16249 * As a concrete example, consider an object with a property
16250 * <literal>ChatroomParticipants</literal> which is an array of
16251 * strings. Instead of transmitting the same (long) array every time
16252 * the property changes, it is more efficient to only transmit the
16253 * delta using e.g. signals <literal>ChatroomParticipantJoined(String
16254 * name)</literal> and <literal>ChatroomParticipantParted(String
16262 * g_dbus_proxy_set_default_timeout:
16263 * @proxy: A #GDBusProxy.
16264 * @timeout_msec: Timeout in milliseconds.
16266 * Sets the timeout to use if -1 (specifying default timeout) is
16267 * passed as @timeout_msec in the g_dbus_proxy_call() and
16268 * g_dbus_proxy_call_sync() functions.
16270 * See the #GDBusProxy:g-default-timeout property for more details.
16277 * g_dbus_proxy_set_interface_info:
16278 * @proxy: A #GDBusProxy
16279 * @info: (allow-none): Minimum interface this proxy conforms to or %NULL to unset.
16281 * Ensure that interactions with @proxy conform to the given
16282 * interface. See the #GDBusProxy:g-interface-info property for more
16290 * g_dbus_server_get_client_address:
16291 * @server: A #GDBusServer.
16293 * Gets a D-Bus address string that can be used by clients to connect
16296 * Returns: A D-Bus address string. Do not free, the string is owned by @server.
16302 * g_dbus_server_get_flags:
16303 * @server: A #GDBusServer.
16305 * Gets the flags for @server.
16307 * Returns: A set of flags from the #GDBusServerFlags enumeration.
16313 * g_dbus_server_get_guid:
16314 * @server: A #GDBusServer.
16316 * Gets the GUID for @server.
16318 * Returns: A D-Bus GUID. Do not free this string, it is owned by @server.
16324 * g_dbus_server_is_active:
16325 * @server: A #GDBusServer.
16327 * Gets whether @server is active.
16329 * Returns: %TRUE if server is active, %FALSE otherwise.
16335 * g_dbus_server_new_sync:
16336 * @address: A D-Bus address.
16337 * @flags: Flags from the #GDBusServerFlags enumeration.
16338 * @guid: A D-Bus GUID.
16339 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
16340 * @cancellable: (allow-none): A #GCancellable or %NULL.
16341 * @error: Return location for server or %NULL.
16343 * Creates a new D-Bus server that listens on the first address in
16344 * @address that works.
16346 * Once constructed, you can use g_dbus_server_get_client_address() to
16347 * get a D-Bus address string that clients can use to connect.
16349 * Connect to the #GDBusServer::new-connection signal to handle
16350 * incoming connections.
16352 * The returned #GDBusServer isn't active - you have to start it with
16353 * g_dbus_server_start().
16355 * See <xref linkend="gdbus-peer-to-peer"/> for how #GDBusServer can
16358 * This is a synchronous failable constructor. See
16359 * g_dbus_server_new() for the asynchronous version.
16361 * Returns: A #GDBusServer or %NULL if @error is set. Free with g_object_unref().
16367 * g_dbus_server_start:
16368 * @server: A #GDBusServer.
16377 * g_dbus_server_stop:
16378 * @server: A #GDBusServer.
16387 * g_dbus_signal_info_ref:
16388 * @info: A #GDBusSignalInfo
16390 * If @info is statically allocated does nothing. Otherwise increases
16391 * the reference count.
16393 * Returns: The same @info.
16399 * g_dbus_signal_info_unref:
16400 * @info: A #GDBusSignalInfo.
16402 * If @info is statically allocated, does nothing. Otherwise decreases
16403 * the reference count of @info. When its reference count drops to 0,
16404 * the memory used is freed.
16411 * g_desktop_app_info_get_categories:
16412 * @info: a #GDesktopAppInfo
16414 * Gets the categories from the desktop file.
16416 * Returns: The unparsed Categories key from the desktop file; i.e. no attempt is made to split it by ';' or validate it.
16421 * g_desktop_app_info_get_filename:
16422 * @info: a #GDesktopAppInfo
16424 * When @info was created from a known filename, return it. In some
16425 * situations such as the #GDesktopAppInfo returned from
16426 * g_desktop_app_info_new_from_keyfile(), this function will return %NULL.
16428 * Returns: The full path to the file for @info, or %NULL if not known.
16434 * g_desktop_app_info_get_generic_name:
16435 * @info: a #GDesktopAppInfo
16437 * Gets the generic name from the destkop file.
16439 * Returns: The value of the GenericName key
16444 * g_desktop_app_info_get_is_hidden:
16445 * @info: a #GDesktopAppInfo.
16447 * A desktop file is hidden if the Hidden key in it is
16450 * Returns: %TRUE if hidden, %FALSE otherwise.
16455 * g_desktop_app_info_get_keywords:
16456 * @info: a #GDesktopAppInfo
16458 * Gets the keywords from the desktop file.
16460 * Returns: (transfer none): The value of the Keywords key
16466 * g_desktop_app_info_get_nodisplay:
16467 * @info: a #GDesktopAppInfo
16469 * Gets the value of the NoDisplay key, which helps determine if the
16470 * application info should be shown in menus. See
16471 * #G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().
16473 * Returns: The value of the NoDisplay key
16479 * g_desktop_app_info_get_show_in:
16480 * @info: a #GDesktopAppInfo
16481 * @desktop_env: a string specifying a desktop name
16483 * Checks if the application info should be shown in menus that list available
16484 * applications for a specific name of the desktop, based on the
16485 * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys.
16487 * If @desktop_env is %NULL, then the name of the desktop set with
16488 * g_desktop_app_info_set_desktop_env() is used.
16490 * Note that g_app_info_should_show() for @info will include this check (with
16491 * %NULL for @desktop_env) as well as additional checks.
16493 * Returns: %TRUE if the @info should be shown in @desktop_env according to the <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys, %FALSE otherwise.
16499 * g_desktop_app_info_get_startup_wm_class:
16500 * @app_info: a #GDesktopAppInfo that supports startup notify
16502 * Retrieves the StartupWMClass field from @app_info. This represents the
16503 * WM_CLASS property of the main window of the application, if launched through
16506 * Returns: (transfer none): the startup WM class, or %NULL if none is set in the desktop file.
16512 * g_desktop_app_info_launch_uris_as_manager:
16513 * @appinfo: a #GDesktopAppInfo
16514 * @uris: (element-type utf8): List of URIs
16515 * @launch_context: a #GAppLaunchContext
16516 * @spawn_flags: #GSpawnFlags, used for each process
16517 * @user_setup: (scope call): a #GSpawnChildSetupFunc, used once for each process.
16518 * @user_setup_data: (closure user_setup): User data for @user_setup
16519 * @pid_callback: (scope call): Callback for child processes
16520 * @pid_callback_data: (closure pid_callback): User data for @callback
16521 * @error: return location for a #GError, or %NULL
16523 * This function performs the equivalent of g_app_info_launch_uris(),
16524 * but is intended primarily for operating system components that
16525 * launch applications. Ordinary applications should use
16526 * g_app_info_launch_uris().
16528 * In contrast to g_app_info_launch_uris(), all processes created will
16529 * always be run directly as children as if by the UNIX fork()/exec()
16532 * This guarantee allows additional control over the exact environment
16533 * of the child processes, which is provided via a setup function
16534 * @user_setup, as well as the process identifier of each child process
16535 * via @pid_callback. See g_spawn_async() for more information about the
16536 * semantics of the @user_setup function.
16538 * Returns: %TRUE on successful launch, %FALSE otherwise.
16543 * g_desktop_app_info_lookup_get_default_for_uri_scheme:
16544 * @lookup: a #GDesktopAppInfoLookup
16545 * @uri_scheme: a string containing a URI scheme.
16547 * Gets the default application for launching applications
16548 * using this URI scheme for a particular GDesktopAppInfoLookup
16551 * The GDesktopAppInfoLookup interface and this function is used
16552 * to implement g_app_info_get_default_for_uri_scheme() backends
16553 * in a GIO module. There is no reason for applications to use it
16554 * directly. Applications should use g_app_info_get_default_for_uri_scheme().
16556 * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
16557 * Deprecated: The #GDesktopAppInfoLookup interface is deprecated and unused by gio.
16562 * g_desktop_app_info_new:
16563 * @desktop_id: the desktop file id
16565 * Creates a new #GDesktopAppInfo based on a desktop file id.
16567 * A desktop file id is the basename of the desktop file, including the
16568 * .desktop extension. GIO is looking for a desktop file with this name
16569 * in the <filename>applications</filename> subdirectories of the XDG data
16570 * directories (i.e. the directories specified in the
16571 * <envar>XDG_DATA_HOME</envar> and <envar>XDG_DATA_DIRS</envar> environment
16572 * variables). GIO also supports the prefix-to-subdirectory mapping that is
16573 * described in the <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Menu Spec</ulink>
16574 * (i.e. a desktop id of kde-foo.desktop will match
16575 * <filename>/usr/share/applications/kde/foo.desktop</filename>).
16577 * Returns: a new #GDesktopAppInfo, or %NULL if no desktop file with that id
16582 * g_desktop_app_info_new_from_filename:
16583 * @filename: the path of a desktop file, in the GLib filename encoding
16585 * Creates a new #GDesktopAppInfo.
16587 * Returns: a new #GDesktopAppInfo or %NULL on error.
16592 * g_desktop_app_info_new_from_keyfile:
16593 * @key_file: an opened #GKeyFile
16595 * Creates a new #GDesktopAppInfo.
16597 * Returns: a new #GDesktopAppInfo or %NULL on error.
16603 * g_desktop_app_info_set_desktop_env:
16604 * @desktop_env: a string specifying what desktop this is
16606 * Sets the name of the desktop that the application is running in.
16607 * This is used by g_app_info_should_show() and
16608 * g_desktop_app_info_get_show_in() to evaluate the
16609 * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal>
16610 * desktop entry fields.
16612 * The <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Desktop
16613 * Menu specification</ulink> recognizes the following:
16615 * <member>GNOME</member>
16616 * <member>KDE</member>
16617 * <member>ROX</member>
16618 * <member>XFCE</member>
16619 * <member>LXDE</member>
16620 * <member>Unity</member>
16621 * <member>Old</member>
16624 * Should be called only once; subsequent calls are ignored.
16629 * g_drive_can_eject:
16630 * @drive: a #GDrive.
16632 * Checks if a drive can be ejected.
16634 * Returns: %TRUE if the @drive can be ejected, %FALSE otherwise.
16639 * g_drive_can_poll_for_media:
16640 * @drive: a #GDrive.
16642 * Checks if a drive can be polled for media changes.
16644 * Returns: %TRUE if the @drive can be polled for media changes, %FALSE otherwise.
16649 * g_drive_can_start:
16650 * @drive: a #GDrive.
16652 * Checks if a drive can be started.
16654 * Returns: %TRUE if the @drive can be started, %FALSE otherwise.
16660 * g_drive_can_start_degraded:
16661 * @drive: a #GDrive.
16663 * Checks if a drive can be started degraded.
16665 * Returns: %TRUE if the @drive can be started degraded, %FALSE otherwise.
16671 * g_drive_can_stop:
16672 * @drive: a #GDrive.
16674 * Checks if a drive can be stopped.
16676 * Returns: %TRUE if the @drive can be stopped, %FALSE otherwise.
16683 * @drive: a #GDrive.
16684 * @flags: flags affecting the unmount if required for eject
16685 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16686 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16687 * @user_data: user data to pass to @callback
16689 * Asynchronously ejects a drive.
16691 * When the operation is finished, @callback will be called.
16692 * You can then call g_drive_eject_finish() to obtain the
16693 * result of the operation.
16695 * Deprecated: 2.22: Use g_drive_eject_with_operation() instead.
16700 * g_drive_eject_finish:
16701 * @drive: a #GDrive.
16702 * @result: a #GAsyncResult.
16703 * @error: a #GError, or %NULL
16705 * Finishes ejecting a drive.
16707 * Returns: %TRUE if the drive has been ejected successfully, %FALSE otherwise.
16708 * Deprecated: 2.22: Use g_drive_eject_with_operation_finish() instead.
16713 * g_drive_eject_with_operation:
16714 * @drive: a #GDrive.
16715 * @flags: flags affecting the unmount if required for eject
16716 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16717 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16718 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16719 * @user_data: user data passed to @callback.
16721 * Ejects a drive. This is an asynchronous operation, and is
16722 * finished by calling g_drive_eject_with_operation_finish() with the @drive
16723 * and #GAsyncResult data returned in the @callback.
16730 * g_drive_eject_with_operation_finish:
16731 * @drive: a #GDrive.
16732 * @result: a #GAsyncResult.
16733 * @error: a #GError location to store the error occurring, or %NULL to ignore.
16735 * Finishes ejecting a drive. If any errors occurred during the operation,
16736 * @error will be set to contain the errors and %FALSE will be returned.
16738 * Returns: %TRUE if the drive was successfully ejected. %FALSE otherwise.
16744 * g_drive_enumerate_identifiers:
16745 * @drive: a #GDrive
16747 * Gets the kinds of identifiers that @drive has.
16748 * Use g_drive_get_identifier() to obtain the identifiers
16751 * Returns: (transfer full) (array zero-terminated=1): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
16756 * g_drive_get_icon:
16757 * @drive: a #GDrive.
16759 * Gets the icon for @drive.
16761 * Returns: (transfer full): #GIcon for the @drive. Free the returned object with g_object_unref().
16766 * g_drive_get_identifier:
16767 * @drive: a #GDrive
16768 * @kind: the kind of identifier to return
16770 * Gets the identifier of the given kind for @drive.
16772 * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GDrive doesn't have this kind of identifier.
16777 * g_drive_get_name:
16778 * @drive: a #GDrive.
16780 * Gets the name of @drive.
16782 * Returns: a string containing @drive's name. The returned string should be freed when no longer needed.
16787 * g_drive_get_sort_key:
16788 * @drive: A #GDrive.
16790 * Gets the sort key for @drive, if any.
16792 * Returns: Sorting key for @drive or %NULL if no such key is available.
16798 * g_drive_get_start_stop_type:
16799 * @drive: a #GDrive.
16801 * Gets a hint about how a drive can be started/stopped.
16803 * Returns: A value from the #GDriveStartStopType enumeration.
16809 * g_drive_get_symbolic_icon:
16810 * @drive: a #GDrive.
16812 * Gets the icon for @drive.
16814 * Returns: (transfer full): symbolic #GIcon for the @drive. Free the returned object with g_object_unref().
16820 * g_drive_get_volumes:
16821 * @drive: a #GDrive.
16823 * Get a list of mountable volumes for @drive.
16825 * The returned list should be freed with g_list_free(), after
16826 * its elements have been unreffed with g_object_unref().
16828 * Returns: (element-type GVolume) (transfer full): #GList containing any #GVolume objects on the given @drive.
16833 * g_drive_has_media:
16834 * @drive: a #GDrive.
16836 * Checks if the @drive has media. Note that the OS may not be polling
16837 * the drive for media changes; see g_drive_is_media_check_automatic()
16838 * for more details.
16840 * Returns: %TRUE if @drive has media, %FALSE otherwise.
16845 * g_drive_has_volumes:
16846 * @drive: a #GDrive.
16848 * Check if @drive has any mountable volumes.
16850 * Returns: %TRUE if the @drive contains volumes, %FALSE otherwise.
16855 * g_drive_is_media_check_automatic:
16856 * @drive: a #GDrive.
16858 * Checks if @drive is capabable of automatically detecting media changes.
16860 * Returns: %TRUE if the @drive is capabable of automatically detecting media changes, %FALSE otherwise.
16865 * g_drive_is_media_removable:
16866 * @drive: a #GDrive.
16868 * Checks if the @drive supports removable media.
16870 * Returns: %TRUE if @drive supports removable media, %FALSE otherwise.
16875 * g_drive_poll_for_media:
16876 * @drive: a #GDrive.
16877 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16878 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16879 * @user_data: user data to pass to @callback
16881 * Asynchronously polls @drive to see if media has been inserted or removed.
16883 * When the operation is finished, @callback will be called.
16884 * You can then call g_drive_poll_for_media_finish() to obtain the
16885 * result of the operation.
16890 * g_drive_poll_for_media_finish:
16891 * @drive: a #GDrive.
16892 * @result: a #GAsyncResult.
16893 * @error: a #GError, or %NULL
16895 * Finishes an operation started with g_drive_poll_for_media() on a drive.
16897 * Returns: %TRUE if the drive has been poll_for_mediaed successfully, %FALSE otherwise.
16903 * @drive: a #GDrive.
16904 * @flags: flags affecting the start operation.
16905 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16906 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16907 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16908 * @user_data: user data to pass to @callback
16910 * Asynchronously starts a drive.
16912 * When the operation is finished, @callback will be called.
16913 * You can then call g_drive_start_finish() to obtain the
16914 * result of the operation.
16921 * g_drive_start_finish:
16922 * @drive: a #GDrive.
16923 * @result: a #GAsyncResult.
16924 * @error: a #GError, or %NULL
16926 * Finishes starting a drive.
16928 * Returns: %TRUE if the drive has been started successfully, %FALSE otherwise.
16935 * @drive: a #GDrive.
16936 * @flags: flags affecting the unmount if required for stopping.
16937 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16938 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16939 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16940 * @user_data: user data to pass to @callback
16942 * Asynchronously stops a drive.
16944 * When the operation is finished, @callback will be called.
16945 * You can then call g_drive_stop_finish() to obtain the
16946 * result of the operation.
16953 * g_drive_stop_finish:
16954 * @drive: a #GDrive.
16955 * @result: a #GAsyncResult.
16956 * @error: a #GError, or %NULL
16958 * Finishes stopping a drive.
16960 * Returns: %TRUE if the drive has been stopped successfully, %FALSE otherwise.
16966 * g_emblem_get_icon:
16967 * @emblem: a #GEmblem from which the icon should be extracted.
16969 * Gives back the icon from @emblem.
16971 * Returns: (transfer none): a #GIcon. The returned object belongs to the emblem and should not be modified or freed.
16977 * g_emblem_get_origin:
16978 * @emblem: a #GEmblem
16980 * Gets the origin of the emblem.
16982 * Returns: (transfer none): the origin of the emblem
16989 * @icon: a GIcon containing the icon.
16991 * Creates a new emblem for @icon.
16993 * Returns: a new #GEmblem.
16999 * g_emblem_new_with_origin:
17000 * @icon: a GIcon containing the icon.
17001 * @origin: a GEmblemOrigin enum defining the emblem's origin
17003 * Creates a new emblem for @icon.
17005 * Returns: a new #GEmblem.
17011 * g_emblemed_icon_add_emblem:
17012 * @emblemed: a #GEmblemedIcon
17013 * @emblem: a #GEmblem
17015 * Adds @emblem to the #GList of #GEmblem <!-- -->s.
17022 * g_emblemed_icon_clear_emblems:
17023 * @emblemed: a #GEmblemedIcon
17025 * Removes all the emblems from @icon.
17032 * g_emblemed_icon_get_emblems:
17033 * @emblemed: a #GEmblemedIcon
17035 * Gets the list of emblems for the @icon.
17037 * Returns: (element-type Gio.Emblem) (transfer none): a #GList of #GEmblem <!-- -->s that is owned by @emblemed
17043 * g_emblemed_icon_get_icon:
17044 * @emblemed: a #GEmblemedIcon
17046 * Gets the main icon for @emblemed.
17048 * Returns: (transfer none): a #GIcon that is owned by @emblemed
17054 * g_emblemed_icon_new:
17056 * @emblem: (allow-none): a #GEmblem, or %NULL
17058 * Creates a new emblemed icon for @icon with the emblem @emblem.
17060 * Returns: (transfer full) (type GEmblemedIcon): a new #GIcon
17066 * g_file_append_to:
17067 * @file: input #GFile
17068 * @flags: a set of #GFileCreateFlags
17069 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17070 * @error: a #GError, or %NULL
17072 * Gets an output stream for appending data to the file.
17073 * If the file doesn't already exist it is created.
17075 * By default files created are generally readable by everyone,
17076 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17077 * will be made readable only to the current user, to the level that
17078 * is supported on the target filesystem.
17080 * If @cancellable is not %NULL, then the operation can be cancelled
17081 * by triggering the cancellable object from another thread. If the
17082 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17085 * Some file systems don't allow all file names, and may return an
17086 * %G_IO_ERROR_INVALID_FILENAME error. If the file is a directory the
17087 * %G_IO_ERROR_IS_DIRECTORY error will be returned. Other errors are
17088 * possible too, and depend on what kind of filesystem the file is on.
17090 * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
17095 * g_file_append_to_async:
17096 * @file: input #GFile
17097 * @flags: a set of #GFileCreateFlags
17098 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17099 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17100 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17101 * @user_data: (closure): the data to pass to callback function
17103 * Asynchronously opens @file for appending.
17105 * For more details, see g_file_append_to() which is
17106 * the synchronous version of this call.
17108 * When the operation is finished, @callback will be called.
17109 * You can then call g_file_append_to_finish() to get the result
17110 * of the operation.
17115 * g_file_append_to_finish:
17116 * @file: input #GFile
17117 * @res: #GAsyncResult
17118 * @error: a #GError, or %NULL
17120 * Finishes an asynchronous file append operation started with
17121 * g_file_append_to_async().
17123 * Returns: (transfer full): a valid #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
17128 * g_file_attribute_info_list_add:
17129 * @list: a #GFileAttributeInfoList.
17130 * @name: the name of the attribute to add.
17131 * @type: the #GFileAttributeType for the attribute.
17132 * @flags: #GFileAttributeInfoFlags for the attribute.
17134 * Adds a new attribute with @name to the @list, setting
17135 * its @type and @flags.
17140 * g_file_attribute_info_list_dup:
17141 * @list: a #GFileAttributeInfoList to duplicate.
17143 * Makes a duplicate of a file attribute info list.
17145 * Returns: a copy of the given @list.
17150 * g_file_attribute_info_list_lookup:
17151 * @list: a #GFileAttributeInfoList.
17152 * @name: the name of the attribute to lookup.
17154 * Gets the file attribute with the name @name from @list.
17156 * Returns: a #GFileAttributeInfo for the @name, or %NULL if an attribute isn't found.
17161 * g_file_attribute_info_list_new:
17163 * Creates a new file attribute info list.
17165 * Returns: a #GFileAttributeInfoList.
17170 * g_file_attribute_info_list_ref:
17171 * @list: a #GFileAttributeInfoList to reference.
17173 * References a file attribute info list.
17175 * Returns: #GFileAttributeInfoList or %NULL on error.
17180 * g_file_attribute_info_list_unref:
17181 * @list: The #GFileAttributeInfoList to unreference.
17183 * Removes a reference from the given @list. If the reference count
17184 * falls to zero, the @list is deleted.
17189 * g_file_attribute_matcher_enumerate_namespace:
17190 * @matcher: a #GFileAttributeMatcher.
17191 * @ns: a string containing a file attribute namespace.
17193 * Checks if the matcher will match all of the keys in a given namespace.
17194 * This will always return %TRUE if a wildcard character is in use (e.g. if
17195 * matcher was created with "standard::*" and @ns is "standard", or if matcher was created
17196 * using "*" and namespace is anything.)
17198 * TODO: this is awkwardly worded.
17200 * Returns: %TRUE if the matcher matches all of the entries in the given @ns, %FALSE otherwise.
17205 * g_file_attribute_matcher_enumerate_next:
17206 * @matcher: a #GFileAttributeMatcher.
17208 * Gets the next matched attribute from a #GFileAttributeMatcher.
17210 * Returns: a string containing the next attribute or %NULL if no more attribute exist.
17215 * g_file_attribute_matcher_matches:
17216 * @matcher: a #GFileAttributeMatcher.
17217 * @attribute: a file attribute key.
17219 * Checks if an attribute will be matched by an attribute matcher. If
17220 * the matcher was created with the "*" matching string, this function
17221 * will always return %TRUE.
17223 * Returns: %TRUE if @attribute matches @matcher. %FALSE otherwise.
17228 * g_file_attribute_matcher_matches_only:
17229 * @matcher: a #GFileAttributeMatcher.
17230 * @attribute: a file attribute key.
17232 * Checks if a attribute matcher only matches a given attribute. Always
17233 * returns %FALSE if "*" was used when creating the matcher.
17235 * Returns: %TRUE if the matcher only matches @attribute. %FALSE otherwise.
17240 * g_file_attribute_matcher_new:
17241 * @attributes: an attribute string to match.
17243 * Creates a new file attribute matcher, which matches attributes
17244 * against a given string. #GFileAttributeMatcher<!-- -->s are reference
17245 * counted structures, and are created with a reference count of 1. If
17246 * the number of references falls to 0, the #GFileAttributeMatcher is
17247 * automatically destroyed.
17249 * The @attribute string should be formatted with specific keys separated
17250 * from namespaces with a double colon. Several "namespace::key" strings may be
17251 * concatenated with a single comma (e.g. "standard::type,standard::is-hidden").
17252 * The wildcard "*" may be used to match all keys and namespaces, or
17253 * "namespace::*" will match all keys in a given namespace.
17255 * Examples of strings to use:
17257 * <title>File Attribute Matcher strings and results</title>
17258 * <tgroup cols='2' align='left'><thead>
17259 * <row><entry> Matcher String </entry><entry> Matches </entry></row></thead>
17261 * <row><entry>"*"</entry><entry>matches all attributes.</entry></row>
17262 * <row><entry>"standard::is-hidden"</entry><entry>matches only the key is-hidden in the standard namespace.</entry></row>
17263 * <row><entry>"standard::type,unix::*"</entry><entry>matches the type key in the standard namespace and
17264 * all keys in the unix namespace.</entry></row>
17265 * </tbody></tgroup>
17268 * Returns: a #GFileAttributeMatcher.
17273 * g_file_attribute_matcher_ref:
17274 * @matcher: a #GFileAttributeMatcher.
17276 * References a file attribute matcher.
17278 * Returns: a #GFileAttributeMatcher.
17283 * g_file_attribute_matcher_subtract:
17284 * @matcher: Matcher to subtract from
17285 * @subtract: The matcher to subtract
17287 * Subtracts all attributes of @subtract from @matcher and returns
17288 * a matcher that supports those attributes.
17290 * Note that currently it is not possible to remove a single
17291 * attribute when the @matcher matches the whole namespace - or remove
17292 * a namespace or attribute when the matcher matches everything. This
17293 * is a limitation of the current implementation, but may be fixed
17296 * Returns: A file attribute matcher matching all attributes of @matcher that are not matched by @subtract
17301 * g_file_attribute_matcher_to_string:
17302 * @matcher: (allow-none): a #GFileAttributeMatcher.
17304 * Prints what the matcher is matching against. The format will be
17305 * equal to the format passed to g_file_attribute_matcher_new().
17306 * The output however, might not be identical, as the matcher may
17307 * decide to use a different order or omit needless parts.
17309 * Returns: a string describing the attributes the matcher matches against or %NULL if @matcher was %NULL.
17315 * g_file_attribute_matcher_unref:
17316 * @matcher: a #GFileAttributeMatcher.
17318 * Unreferences @matcher. If the reference count falls below 1,
17319 * the @matcher is automatically freed.
17325 * @source: input #GFile
17326 * @destination: destination #GFile
17327 * @flags: set of #GFileCopyFlags
17328 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17329 * @progress_callback: (allow-none) (scope call): function to callback with progress information, or %NULL if progress information is not needed
17330 * @progress_callback_data: (closure): user data to pass to @progress_callback
17331 * @error: #GError to set on error, or %NULL
17333 * Copies the file @source to the location specified by @destination.
17334 * Can not handle recursive copies of directories.
17336 * If the flag #G_FILE_COPY_OVERWRITE is specified an already
17337 * existing @destination file is overwritten.
17339 * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
17340 * will be copied as symlinks, otherwise the target of the
17341 * @source symlink will be copied.
17343 * If @cancellable is not %NULL, then the operation can be cancelled by
17344 * triggering the cancellable object from another thread. If the operation
17345 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17347 * If @progress_callback is not %NULL, then the operation can be monitored
17348 * by setting this to a #GFileProgressCallback function.
17349 * @progress_callback_data will be passed to this function. It is guaranteed
17350 * that this callback will be called after all data has been transferred with
17351 * the total number of bytes copied during the operation.
17353 * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND error
17354 * is returned, independent on the status of the @destination.
17356 * If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then
17357 * the error %G_IO_ERROR_EXISTS is returned.
17359 * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
17360 * error is returned. If trying to overwrite a directory with a directory the
17361 * %G_IO_ERROR_WOULD_MERGE error is returned.
17363 * If the source is a directory and the target does not exist, or
17364 * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then the
17365 * %G_IO_ERROR_WOULD_RECURSE error is returned.
17367 * If you are interested in copying the #GFile object itself (not the on-disk
17368 * file), see g_file_dup().
17370 * Returns: %TRUE on success, %FALSE otherwise.
17375 * g_file_copy_async: (skip)
17376 * @source: input #GFile
17377 * @destination: destination #GFile
17378 * @flags: set of #GFileCopyFlags
17379 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17380 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17381 * @progress_callback: (allow-none): function to callback with progress information, or %NULL if progress information is not needed
17382 * @progress_callback_data: (closure): user data to pass to @progress_callback
17383 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17384 * @user_data: the data to pass to callback function
17386 * Copies the file @source to the location specified by @destination
17387 * asynchronously. For details of the behaviour, see g_file_copy().
17389 * If @progress_callback is not %NULL, then that function that will be called
17390 * just like in g_file_copy(), however the callback will run in the main loop,
17391 * not in the thread that is doing the I/O operation.
17393 * When the operation is finished, @callback will be called. You can then call
17394 * g_file_copy_finish() to get the result of the operation.
17399 * g_file_copy_attributes:
17400 * @source: a #GFile with attributes
17401 * @destination: a #GFile to copy attributes to
17402 * @flags: a set of #GFileCopyFlags
17403 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17404 * @error: a #GError, %NULL to ignore
17406 * Copies the file attributes from @source to @destination.
17408 * Normally only a subset of the file attributes are copied,
17409 * those that are copies in a normal file copy operation
17410 * (which for instance does not include e.g. owner). However
17411 * if #G_FILE_COPY_ALL_METADATA is specified in @flags, then
17412 * all the metadata that is possible to copy is copied. This
17413 * is useful when implementing move by copy + delete source.
17415 * Returns: %TRUE if the attributes were copied successfully, %FALSE otherwise.
17420 * g_file_copy_finish:
17421 * @file: input #GFile
17422 * @res: a #GAsyncResult
17423 * @error: a #GError, or %NULL
17425 * Finishes copying the file started with g_file_copy_async().
17427 * Returns: a %TRUE on success, %FALSE on error.
17433 * @file: input #GFile
17434 * @flags: a set of #GFileCreateFlags
17435 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17436 * @error: a #GError, or %NULL
17438 * Creates a new file and returns an output stream for writing to it.
17439 * The file must not already exist.
17441 * By default files created are generally readable by everyone,
17442 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17443 * will be made readable only to the current user, to the level
17444 * that is supported on the target filesystem.
17446 * If @cancellable is not %NULL, then the operation can be cancelled
17447 * by triggering the cancellable object from another thread. If the
17448 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17451 * If a file or directory with this name already exists the
17452 * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
17453 * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
17454 * error, and if the name is to long %G_IO_ERROR_FILENAME_TOO_LONG will
17455 * be returned. Other errors are possible too, and depend on what kind
17456 * of filesystem the file is on.
17458 * Returns: (transfer full): a #GFileOutputStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
17463 * g_file_create_async:
17464 * @file: input #GFile
17465 * @flags: a set of #GFileCreateFlags
17466 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17467 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17468 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17469 * @user_data: (closure): the data to pass to callback function
17471 * Asynchronously creates a new file and returns an output stream
17472 * for writing to it. The file must not already exist.
17474 * For more details, see g_file_create() which is
17475 * the synchronous version of this call.
17477 * When the operation is finished, @callback will be called.
17478 * You can then call g_file_create_finish() to get the result
17479 * of the operation.
17484 * g_file_create_finish:
17485 * @file: input #GFile
17486 * @res: a #GAsyncResult
17487 * @error: a #GError, or %NULL
17489 * Finishes an asynchronous file create operation started with
17490 * g_file_create_async().
17492 * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
17497 * g_file_create_readwrite:
17499 * @flags: a set of #GFileCreateFlags
17500 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17501 * @error: return location for a #GError, or %NULL
17503 * Creates a new file and returns a stream for reading and
17504 * writing to it. The file must not already exist.
17506 * By default files created are generally readable by everyone,
17507 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17508 * will be made readable only to the current user, to the level
17509 * that is supported on the target filesystem.
17511 * If @cancellable is not %NULL, then the operation can be cancelled
17512 * by triggering the cancellable object from another thread. If the
17513 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17516 * If a file or directory with this name already exists, the
17517 * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
17518 * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
17519 * error, and if the name is too long, %G_IO_ERROR_FILENAME_TOO_LONG
17520 * will be returned. Other errors are possible too, and depend on what
17521 * kind of filesystem the file is on.
17523 * Note that in many non-local file cases read and write streams are
17524 * not supported, so make sure you really need to do read and write
17525 * streaming, rather than just opening for reading or writing.
17527 * Returns: (transfer full): a #GFileIOStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
17533 * g_file_create_readwrite_async:
17534 * @file: input #GFile
17535 * @flags: a set of #GFileCreateFlags
17536 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17537 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17538 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17539 * @user_data: (closure): the data to pass to callback function
17541 * Asynchronously creates a new file and returns a stream
17542 * for reading and writing to it. The file must not already exist.
17544 * For more details, see g_file_create_readwrite() which is
17545 * the synchronous version of this call.
17547 * When the operation is finished, @callback will be called.
17548 * You can then call g_file_create_readwrite_finish() to get
17549 * the result of the operation.
17556 * g_file_create_readwrite_finish:
17557 * @file: input #GFile
17558 * @res: a #GAsyncResult
17559 * @error: a #GError, or %NULL
17561 * Finishes an asynchronous file create operation started with
17562 * g_file_create_readwrite_async().
17564 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
17571 * @file: input #GFile
17572 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17573 * @error: a #GError, or %NULL
17575 * Deletes a file. If the @file is a directory, it will only be
17576 * deleted if it is empty. This has the same semantics as g_unlink().
17578 * If @cancellable is not %NULL, then the operation can be cancelled by
17579 * triggering the cancellable object from another thread. If the operation
17580 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17582 * Virtual: delete_file
17583 * Returns: %TRUE if the file was deleted. %FALSE otherwise.
17588 * g_file_delete_async:
17589 * @file: input #GFile
17590 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17591 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17592 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17593 * @user_data: the data to pass to callback function
17595 * Asynchronously delete a file. If the @file is a directory, it will
17596 * only be deleted if it is empty. This has the same semantics as
17599 * Virtual: delete_file_async
17605 * g_file_delete_finish:
17606 * @file: input #GFile
17607 * @res: a #GAsyncResult
17608 * @error: a #GError, or %NULL
17610 * Finishes deleting a file started with g_file_delete_async().
17612 * Virtual: delete_file_finish
17618 * g_file_descriptor_based_get_fd:
17619 * @fd_based: a #GFileDescriptorBased.
17621 * Gets the underlying file descriptor.
17623 * Returns: The file descriptor
17630 * @file: input #GFile
17632 * Duplicates a #GFile handle. This operation does not duplicate
17633 * the actual file or directory represented by the #GFile; see
17634 * g_file_copy() if attempting to copy a file.
17636 * This call does no blocking I/O.
17638 * Returns: (transfer full): a new #GFile that is a duplicate of the given #GFile.
17643 * g_file_eject_mountable:
17644 * @file: input #GFile
17645 * @flags: flags affecting the operation
17646 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17647 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
17648 * @user_data: (closure): the data to pass to callback function
17650 * Starts an asynchronous eject on a mountable.
17651 * When this operation has completed, @callback will be called with
17652 * @user_user data, and the operation can be finalized with
17653 * g_file_eject_mountable_finish().
17655 * If @cancellable is not %NULL, then the operation can be cancelled by
17656 * triggering the cancellable object from another thread. If the operation
17657 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17659 * Deprecated: 2.22: Use g_file_eject_mountable_with_operation() instead.
17664 * g_file_eject_mountable_finish:
17665 * @file: input #GFile
17666 * @result: a #GAsyncResult
17667 * @error: a #GError, or %NULL
17669 * Finishes an asynchronous eject operation started by
17670 * g_file_eject_mountable().
17672 * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
17673 * Deprecated: 2.22: Use g_file_eject_mountable_with_operation_finish() instead.
17678 * g_file_eject_mountable_with_operation:
17679 * @file: input #GFile
17680 * @flags: flags affecting the operation
17681 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
17682 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17683 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
17684 * @user_data: (closure): the data to pass to callback function
17686 * Starts an asynchronous eject on a mountable.
17687 * When this operation has completed, @callback will be called with
17688 * @user_user data, and the operation can be finalized with
17689 * g_file_eject_mountable_with_operation_finish().
17691 * If @cancellable is not %NULL, then the operation can be cancelled by
17692 * triggering the cancellable object from another thread. If the operation
17693 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17700 * g_file_eject_mountable_with_operation_finish:
17701 * @file: input #GFile
17702 * @result: a #GAsyncResult
17703 * @error: a #GError, or %NULL
17705 * Finishes an asynchronous eject operation started by
17706 * g_file_eject_mountable_with_operation().
17708 * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
17714 * g_file_enumerate_children:
17715 * @file: input #GFile
17716 * @attributes: an attribute query string
17717 * @flags: a set of #GFileQueryInfoFlags
17718 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17719 * @error: #GError for error reporting
17721 * Gets the requested information about the files in a directory.
17722 * The result is a #GFileEnumerator object that will give out
17723 * #GFileInfo objects for all the files in the directory.
17725 * The @attributes value is a string that specifies the file
17726 * attributes that should be gathered. It is not an error if
17727 * it's not possible to read a particular requested attribute
17728 * from a file - it just won't be set. @attributes should
17729 * be a comma-separated list of attributes or attribute wildcards.
17730 * The wildcard "*" means all attributes, and a wildcard like
17731 * "standard::*" means all attributes in the standard namespace.
17732 * An example attribute query be "standard::*,owner::user".
17733 * The standard attributes are available as defines, like
17734 * #G_FILE_ATTRIBUTE_STANDARD_NAME.
17736 * If @cancellable is not %NULL, then the operation can be cancelled
17737 * by triggering the cancellable object from another thread. If the
17738 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17741 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
17742 * be returned. If the file is not a directory, the %G_FILE_ERROR_NOTDIR
17743 * error will be returned. Other errors are possible too.
17745 * Returns: (transfer full): A #GFileEnumerator if successful, %NULL on error. Free the returned object with g_object_unref().
17750 * g_file_enumerate_children_async:
17751 * @file: input #GFile
17752 * @attributes: an attribute query string
17753 * @flags: a set of #GFileQueryInfoFlags
17754 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17755 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17756 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17757 * @user_data: (closure): the data to pass to callback function
17759 * Asynchronously gets the requested information about the files
17760 * in a directory. The result is a #GFileEnumerator object that will
17761 * give out #GFileInfo objects for all the files in the directory.
17763 * For more details, see g_file_enumerate_children() which is
17764 * the synchronous version of this call.
17766 * When the operation is finished, @callback will be called. You can
17767 * then call g_file_enumerate_children_finish() to get the result of
17773 * g_file_enumerate_children_finish:
17774 * @file: input #GFile
17775 * @res: a #GAsyncResult
17776 * @error: a #GError
17778 * Finishes an async enumerate children operation.
17779 * See g_file_enumerate_children_async().
17781 * Returns: (transfer full): a #GFileEnumerator or %NULL if an error occurred. Free the returned object with g_object_unref().
17786 * g_file_enumerator_close:
17787 * @enumerator: a #GFileEnumerator.
17788 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17789 * @error: location to store the error occurring, or %NULL to ignore
17791 * Releases all resources used by this enumerator, making the
17792 * enumerator return %G_IO_ERROR_CLOSED on all calls.
17794 * This will be automatically called when the last reference
17795 * is dropped, but you might want to call this function to make
17796 * sure resources are released as early as possible.
17798 * Returns: #TRUE on success or #FALSE on error.
17803 * g_file_enumerator_close_async:
17804 * @enumerator: a #GFileEnumerator.
17805 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
17806 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17807 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17808 * @user_data: (closure): the data to pass to callback function
17810 * Asynchronously closes the file enumerator.
17812 * If @cancellable is not %NULL, then the operation can be cancelled by
17813 * triggering the cancellable object from another thread. If the operation
17814 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned in
17815 * g_file_enumerator_close_finish().
17820 * g_file_enumerator_close_finish:
17821 * @enumerator: a #GFileEnumerator.
17822 * @result: a #GAsyncResult.
17823 * @error: a #GError location to store the error occurring, or %NULL to ignore.
17825 * Finishes closing a file enumerator, started from g_file_enumerator_close_async().
17827 * If the file enumerator was already closed when g_file_enumerator_close_async()
17828 * was called, then this function will report %G_IO_ERROR_CLOSED in @error, and
17829 * return %FALSE. If the file enumerator had pending operation when the close
17830 * operation was started, then this function will report %G_IO_ERROR_PENDING, and
17831 * return %FALSE. If @cancellable was not %NULL, then the operation may have been
17832 * cancelled by triggering the cancellable object from another thread. If the operation
17833 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %FALSE will be
17836 * Returns: %TRUE if the close operation has finished successfully.
17841 * g_file_enumerator_get_container:
17842 * @enumerator: a #GFileEnumerator
17844 * Get the #GFile container which is being enumerated.
17846 * Returns: (transfer none): the #GFile which is being enumerated.
17852 * g_file_enumerator_has_pending:
17853 * @enumerator: a #GFileEnumerator.
17855 * Checks if the file enumerator has pending operations.
17857 * Returns: %TRUE if the @enumerator has pending operations.
17862 * g_file_enumerator_is_closed:
17863 * @enumerator: a #GFileEnumerator.
17865 * Checks if the file enumerator has been closed.
17867 * Returns: %TRUE if the @enumerator is closed.
17872 * g_file_enumerator_next_file:
17873 * @enumerator: a #GFileEnumerator.
17874 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17875 * @error: location to store the error occurring, or %NULL to ignore
17877 * Returns information for the next file in the enumerated object.
17878 * Will block until the information is available. The #GFileInfo
17879 * returned from this function will contain attributes that match the
17880 * attribute string that was passed when the #GFileEnumerator was created.
17882 * On error, returns %NULL and sets @error to the error. If the
17883 * enumerator is at the end, %NULL will be returned and @error will
17886 * 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.
17891 * g_file_enumerator_next_files_async:
17892 * @enumerator: a #GFileEnumerator.
17893 * @num_files: the number of file info objects to request
17894 * @io_priority: the <link linkend="gioscheduler">io priority</link> of the request.
17895 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17896 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17897 * @user_data: (closure): the data to pass to callback function
17899 * Request information for a number of files from the enumerator asynchronously.
17900 * When all i/o for the operation is finished the @callback will be called with
17901 * the requested information.
17903 * The callback can be called with less than @num_files files in case of error
17904 * or at the end of the enumerator. In case of a partial error the callback will
17905 * be called with any succeeding items and no error, and on the next request the
17906 * error will be reported. If a request is cancelled the callback will be called
17907 * with %G_IO_ERROR_CANCELLED.
17909 * During an async request no other sync and async calls are allowed, and will
17910 * result in %G_IO_ERROR_PENDING errors.
17912 * Any outstanding i/o request with higher priority (lower numerical value) will
17913 * be executed before an outstanding request with lower priority. Default
17914 * priority is %G_PRIORITY_DEFAULT.
17919 * g_file_enumerator_next_files_finish:
17920 * @enumerator: a #GFileEnumerator.
17921 * @result: a #GAsyncResult.
17922 * @error: a #GError location to store the error occurring, or %NULL to ignore.
17924 * Finishes the asynchronous operation started with g_file_enumerator_next_files_async().
17926 * 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.
17931 * g_file_enumerator_set_pending:
17932 * @enumerator: a #GFileEnumerator.
17933 * @pending: a boolean value.
17935 * Sets the file enumerator as having pending operations.
17941 * @file1: the first #GFile
17942 * @file2: the second #GFile
17944 * Checks equality of two given #GFiles.
17946 * Note that two #GFiles that differ can still refer to the same
17947 * file on the filesystem due to various forms of filename
17950 * This call does no blocking I/O.
17952 * Returns: %TRUE if @file1 and @file2 are equal. %FALSE if either is not a #GFile.
17957 * g_file_find_enclosing_mount:
17958 * @file: input #GFile
17959 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17960 * @error: a #GError
17962 * Gets a #GMount for the #GFile.
17964 * If the #GFileIface for @file does not have a mount (e.g.
17965 * possibly a remote share), @error will be set to %G_IO_ERROR_NOT_FOUND
17966 * and %NULL will be returned.
17968 * If @cancellable is not %NULL, then the operation can be cancelled by
17969 * triggering the cancellable object from another thread. If the operation
17970 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17972 * Returns: (transfer full): a #GMount where the @file is located or %NULL on error. Free the returned object with g_object_unref().
17977 * g_file_find_enclosing_mount_async:
17979 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17980 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17981 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17982 * @user_data: (closure): the data to pass to callback function
17984 * Asynchronously gets the mount for the file.
17986 * For more details, see g_file_find_enclosing_mount() which is
17987 * the synchronous version of this call.
17989 * When the operation is finished, @callback will be called.
17990 * You can then call g_file_find_enclosing_mount_finish() to
17991 * get the result of the operation.
17996 * g_file_find_enclosing_mount_finish:
17998 * @res: a #GAsyncResult
17999 * @error: a #GError
18001 * Finishes an asynchronous find mount request.
18002 * See g_file_find_enclosing_mount_async().
18004 * Returns: (transfer full): #GMount for given @file or %NULL on error. Free the returned object with g_object_unref().
18009 * g_file_get_basename:
18010 * @file: input #GFile
18012 * Gets the base name (the last component of the path) for a given #GFile.
18014 * If called for the top level of a system (such as the filesystem root
18015 * or a uri like sftp://host/) it will return a single directory separator
18016 * (and on Windows, possibly a drive letter).
18018 * The base name is a byte string (not UTF-8). It has no defined encoding
18019 * or rules other than it may not contain zero bytes. If you want to use
18020 * filenames in a user interface you should use the display name that you
18021 * can get by requesting the %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
18022 * attribute with g_file_query_info().
18024 * This call does no blocking I/O.
18026 * 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.
18031 * g_file_get_child:
18032 * @file: input #GFile
18033 * @name: string containing the child's basename
18035 * Gets a child of @file with basename equal to @name.
18037 * Note that the file with that specific name might not exist, but
18038 * you can still have a #GFile that points to it. You can use this
18039 * for instance to create that file.
18041 * This call does no blocking I/O.
18043 * Returns: (transfer full): a #GFile to a child specified by @name. Free the returned object with g_object_unref().
18048 * g_file_get_child_for_display_name:
18049 * @file: input #GFile
18050 * @display_name: string to a possible child
18051 * @error: return location for an error
18053 * Gets the child of @file for a given @display_name (i.e. a UTF-8
18054 * version of the name). If this function fails, it returns %NULL
18055 * and @error will be set. This is very useful when constructing a
18056 * #GFile for a new file and the user entered the filename in the
18057 * user interface, for instance when you select a directory and
18058 * type a filename in the file selector.
18060 * This call does no blocking I/O.
18062 * 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().
18067 * g_file_get_parent:
18068 * @file: input #GFile
18070 * Gets the parent directory for the @file.
18071 * If the @file represents the root directory of the
18072 * file system, then %NULL will be returned.
18074 * This call does no blocking I/O.
18076 * 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().
18081 * g_file_get_parse_name:
18082 * @file: input #GFile
18084 * Gets the parse name of the @file.
18085 * A parse name is a UTF-8 string that describes the
18086 * file such that one can get the #GFile back using
18087 * g_file_parse_name().
18089 * This is generally used to show the #GFile as a nice
18090 * full-pathname kind of string in a user interface,
18091 * like in a location entry.
18093 * For local files with names that can safely be converted
18094 * to UTF-8 the pathname is used, otherwise the IRI is used
18095 * (a form of URI that allows UTF-8 characters unescaped).
18097 * This call does no blocking I/O.
18099 * Returns: a string containing the #GFile's parse name. The returned string should be freed with g_free() when no longer needed.
18105 * @file: input #GFile
18107 * Gets the local pathname for #GFile, if one exists.
18109 * This call does no blocking I/O.
18111 * 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.
18116 * g_file_get_relative_path:
18117 * @parent: input #GFile
18118 * @descendant: input #GFile
18120 * Gets the path for @descendant relative to @parent.
18122 * This call does no blocking I/O.
18124 * 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.
18130 * @file: input #GFile
18132 * Gets the URI for the @file.
18134 * This call does no blocking I/O.
18136 * Returns: a string containing the #GFile's URI. The returned string should be freed with g_free() when no longer needed.
18141 * g_file_get_uri_scheme:
18142 * @file: input #GFile
18144 * Gets the URI scheme for a #GFile.
18145 * RFC 3986 decodes the scheme as:
18147 * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
18148 * </programlisting>
18149 * Common schemes include "file", "http", "ftp", etc.
18151 * This call does no blocking I/O.
18153 * Returns: a string containing the URI scheme for the given #GFile. The returned string should be freed with g_free() when no longer needed.
18158 * g_file_has_parent:
18159 * @file: input #GFile
18160 * @parent: (allow-none): the parent to check for, or %NULL
18162 * Checks if @file has a parent, and optionally, if it is @parent.
18164 * If @parent is %NULL then this function returns %TRUE if @file has any
18165 * parent at all. If @parent is non-%NULL then %TRUE is only returned
18166 * if @file is a child of @parent.
18168 * Returns: %TRUE if @file is a child of @parent (or any parent in the case that @parent is %NULL).
18174 * g_file_has_prefix:
18175 * @file: input #GFile
18176 * @prefix: input #GFile
18178 * Checks whether @file has the prefix specified by @prefix.
18180 * In other words, if the names of initial elements of @file's
18181 * pathname match @prefix. Only full pathname elements are matched,
18182 * so a path like /foo is not considered a prefix of /foobar, only
18185 * This call does no I/O, as it works purely on names. As such it can
18186 * sometimes return %FALSE even if @file is inside a @prefix (from a
18187 * filesystem point of view), because the prefix of @file is an alias
18190 * Virtual: prefix_matches
18191 * Returns: %TRUE if the @files's parent, grandparent, etc is @prefix, %FALSE otherwise.
18196 * g_file_has_uri_scheme:
18197 * @file: input #GFile
18198 * @uri_scheme: a string containing a URI scheme
18200 * Checks to see if a #GFile has a given URI scheme.
18202 * This call does no blocking I/O.
18204 * Returns: %TRUE if #GFile's backend supports the given URI scheme, %FALSE if URI scheme is %NULL, not supported, or #GFile is invalid.
18210 * @file: (type GFile): #gconstpointer to a #GFile
18212 * Creates a hash value for a #GFile.
18214 * This call does no blocking I/O.
18217 * 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.
18222 * g_file_icon_get_file:
18225 * Gets the #GFile associated with the given @icon.
18227 * Returns: (transfer none): a #GFile, or %NULL.
18235 * Creates a new icon for a file.
18237 * Returns: (transfer full) (type GFileIcon): a #GIcon for the given @file, or %NULL on error.
18242 * g_file_info_clear_status:
18243 * @info: a #GFileInfo.
18245 * Clears the status information from @info.
18250 * g_file_info_copy_into:
18251 * @src_info: source to copy attributes from.
18252 * @dest_info: destination to copy attributes to.
18254 * Copies all of the <link linkend="gio-GFileAttribute">GFileAttribute</link>s
18255 * from @src_info to @dest_info.
18261 * @other: a #GFileInfo.
18263 * Duplicates a file info structure.
18265 * Returns: (transfer full): a duplicate #GFileInfo of @other.
18270 * g_file_info_get_attribute_as_string:
18271 * @info: a #GFileInfo.
18272 * @attribute: a file attribute key.
18274 * Gets the value of a attribute, formated as a string.
18275 * This escapes things as needed to make the string valid
18278 * Returns: a UTF-8 string associated with the given @attribute. When you're done with the string it must be freed with g_free().
18283 * g_file_info_get_attribute_boolean:
18284 * @info: a #GFileInfo.
18285 * @attribute: a file attribute key.
18287 * Gets the value of a boolean attribute. If the attribute does not
18288 * contain a boolean value, %FALSE will be returned.
18290 * Returns: the boolean value contained within the attribute.
18295 * g_file_info_get_attribute_byte_string:
18296 * @info: a #GFileInfo.
18297 * @attribute: a file attribute key.
18299 * Gets the value of a byte string attribute. If the attribute does
18300 * not contain a byte string, %NULL will be returned.
18302 * Returns: the contents of the @attribute value as a byte string, or %NULL otherwise.
18307 * g_file_info_get_attribute_data:
18308 * @info: a #GFileInfo
18309 * @attribute: a file attribute key
18310 * @type: (out) (allow-none): return location for the attribute type, or %NULL
18311 * @value_pp: (out) (allow-none): return location for the attribute value, or %NULL
18312 * @status: (out) (allow-none): return location for the attribute status, or %NULL
18314 * Gets the attribute type, value and status for an attribute key.
18316 * Returns: (transfer none): %TRUE if @info has an attribute named @attribute, %FALSE otherwise.
18321 * g_file_info_get_attribute_int32:
18322 * @info: a #GFileInfo.
18323 * @attribute: a file attribute key.
18325 * Gets a signed 32-bit integer contained within the attribute. If the
18326 * attribute does not contain a signed 32-bit integer, or is invalid,
18327 * 0 will be returned.
18329 * Returns: a signed 32-bit integer from the attribute.
18334 * g_file_info_get_attribute_int64:
18335 * @info: a #GFileInfo.
18336 * @attribute: a file attribute key.
18338 * Gets a signed 64-bit integer contained within the attribute. If the
18339 * attribute does not contain an signed 64-bit integer, or is invalid,
18340 * 0 will be returned.
18342 * Returns: a signed 64-bit integer from the attribute.
18347 * g_file_info_get_attribute_object:
18348 * @info: a #GFileInfo.
18349 * @attribute: a file attribute key.
18351 * Gets the value of a #GObject attribute. If the attribute does
18352 * not contain a #GObject, %NULL will be returned.
18354 * Returns: (transfer none): a #GObject associated with the given @attribute, or %NULL otherwise.
18359 * g_file_info_get_attribute_status:
18360 * @info: a #GFileInfo
18361 * @attribute: a file attribute key
18363 * Gets the attribute status for an attribute key.
18365 * Returns: a #GFileAttributeStatus for the given @attribute, or %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
18370 * g_file_info_get_attribute_string:
18371 * @info: a #GFileInfo.
18372 * @attribute: a file attribute key.
18374 * Gets the value of a string attribute. If the attribute does
18375 * not contain a string, %NULL will be returned.
18377 * Returns: the contents of the @attribute value as a UTF-8 string, or %NULL otherwise.
18382 * g_file_info_get_attribute_stringv:
18383 * @info: a #GFileInfo.
18384 * @attribute: a file attribute key.
18386 * Gets the value of a stringv attribute. If the attribute does
18387 * not contain a stringv, %NULL will be returned.
18389 * Returns: (transfer none): the contents of the @attribute value as a stringv, or %NULL otherwise. Do not free. These returned strings are UTF-8.
18395 * g_file_info_get_attribute_type:
18396 * @info: a #GFileInfo.
18397 * @attribute: a file attribute key.
18399 * Gets the attribute type for an attribute key.
18401 * Returns: a #GFileAttributeType for the given @attribute, or %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
18406 * g_file_info_get_attribute_uint32:
18407 * @info: a #GFileInfo.
18408 * @attribute: a file attribute key.
18410 * Gets an unsigned 32-bit integer contained within the attribute. If the
18411 * attribute does not contain an unsigned 32-bit integer, or is invalid,
18412 * 0 will be returned.
18414 * Returns: an unsigned 32-bit integer from the attribute.
18419 * g_file_info_get_attribute_uint64:
18420 * @info: a #GFileInfo.
18421 * @attribute: a file attribute key.
18423 * Gets a unsigned 64-bit integer contained within the attribute. If the
18424 * attribute does not contain an unsigned 64-bit integer, or is invalid,
18425 * 0 will be returned.
18427 * Returns: a unsigned 64-bit integer from the attribute.
18432 * g_file_info_get_content_type:
18433 * @info: a #GFileInfo.
18435 * Gets the file's content type.
18437 * Returns: a string containing the file's content type.
18442 * g_file_info_get_display_name:
18443 * @info: a #GFileInfo.
18445 * Gets a display name for a file.
18447 * Returns: a string containing the display name.
18452 * g_file_info_get_edit_name:
18453 * @info: a #GFileInfo.
18455 * Gets the edit name for a file.
18457 * Returns: a string containing the edit name.
18462 * g_file_info_get_etag:
18463 * @info: a #GFileInfo.
18465 * Gets the <link linkend="gfile-etag">entity tag</link> for a given
18466 * #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
18468 * Returns: a string containing the value of the "etag:value" attribute.
18473 * g_file_info_get_file_type:
18474 * @info: a #GFileInfo.
18476 * Gets a file's type (whether it is a regular file, symlink, etc).
18477 * This is different from the file's content type, see g_file_info_get_content_type().
18479 * Returns: a #GFileType for the given file.
18484 * g_file_info_get_icon:
18485 * @info: a #GFileInfo.
18487 * Gets the icon for a file.
18489 * Returns: (transfer none): #GIcon for the given @info.
18494 * g_file_info_get_is_backup:
18495 * @info: a #GFileInfo.
18497 * Checks if a file is a backup file.
18499 * Returns: %TRUE if file is a backup file, %FALSE otherwise.
18504 * g_file_info_get_is_hidden:
18505 * @info: a #GFileInfo.
18507 * Checks if a file is hidden.
18509 * Returns: %TRUE if the file is a hidden file, %FALSE otherwise.
18514 * g_file_info_get_is_symlink:
18515 * @info: a #GFileInfo.
18517 * Checks if a file is a symlink.
18519 * Returns: %TRUE if the given @info is a symlink.
18524 * g_file_info_get_modification_time:
18525 * @info: a #GFileInfo.
18526 * @result: (out caller-allocates): a #GTimeVal.
18528 * Gets the modification time of the current @info and sets it
18534 * g_file_info_get_name:
18535 * @info: a #GFileInfo.
18537 * Gets the name for a file.
18539 * Returns: a string containing the file name.
18544 * g_file_info_get_size:
18545 * @info: a #GFileInfo.
18547 * Gets the file's size.
18549 * Returns: a #goffset containing the file's size.
18554 * g_file_info_get_sort_order:
18555 * @info: a #GFileInfo.
18557 * Gets the value of the sort_order attribute from the #GFileInfo.
18558 * See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
18560 * Returns: a #gint32 containing the value of the "standard::sort_order" attribute.
18565 * g_file_info_get_symbolic_icon:
18566 * @info: a #GFileInfo.
18568 * Gets the symbolic icon for a file.
18570 * Returns: (transfer none): #GIcon for the given @info.
18576 * g_file_info_get_symlink_target:
18577 * @info: a #GFileInfo.
18579 * Gets the symlink target for a given #GFileInfo.
18581 * Returns: a string containing the symlink target.
18586 * g_file_info_has_attribute:
18587 * @info: a #GFileInfo.
18588 * @attribute: a file attribute key.
18590 * Checks if a file info structure has an attribute named @attribute.
18592 * Returns: %TRUE if @Ginfo has an attribute named @attribute, %FALSE otherwise.
18597 * g_file_info_has_namespace:
18598 * @info: a #GFileInfo.
18599 * @name_space: a file attribute namespace.
18601 * Checks if a file info structure has an attribute in the
18602 * specified @name_space.
18604 * Returns: %TRUE if @Ginfo has an attribute in @name_space, %FALSE otherwise.
18610 * g_file_info_list_attributes:
18611 * @info: a #GFileInfo.
18612 * @name_space: a file attribute key's namespace.
18614 * Lists the file info structure's attributes.
18616 * 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.
18623 * Creates a new file info structure.
18625 * Returns: a #GFileInfo.
18630 * g_file_info_remove_attribute:
18631 * @info: a #GFileInfo.
18632 * @attribute: a file attribute key.
18634 * Removes all cases of @attribute from @info if it exists.
18639 * g_file_info_set_attribute:
18640 * @info: a #GFileInfo.
18641 * @attribute: a file attribute key.
18642 * @type: a #GFileAttributeType
18643 * @value_p: pointer to the value
18645 * Sets the @attribute to contain the given value, if possible. To unset the
18646 * attribute, use %G_ATTRIBUTE_TYPE_INVALID for @type.
18651 * g_file_info_set_attribute_boolean:
18652 * @info: a #GFileInfo.
18653 * @attribute: a file attribute key.
18654 * @attr_value: a boolean value.
18656 * Sets the @attribute to contain the given @attr_value,
18662 * g_file_info_set_attribute_byte_string:
18663 * @info: a #GFileInfo.
18664 * @attribute: a file attribute key.
18665 * @attr_value: a byte string.
18667 * Sets the @attribute to contain the given @attr_value,
18673 * g_file_info_set_attribute_int32:
18674 * @info: a #GFileInfo.
18675 * @attribute: a file attribute key.
18676 * @attr_value: a signed 32-bit integer
18678 * Sets the @attribute to contain the given @attr_value,
18684 * g_file_info_set_attribute_int64:
18685 * @info: a #GFileInfo.
18686 * @attribute: attribute name to set.
18687 * @attr_value: int64 value to set attribute to.
18689 * Sets the @attribute to contain the given @attr_value,
18695 * g_file_info_set_attribute_mask:
18696 * @info: a #GFileInfo.
18697 * @mask: a #GFileAttributeMatcher.
18699 * Sets @mask on @info to match specific attribute types.
18704 * g_file_info_set_attribute_object:
18705 * @info: a #GFileInfo.
18706 * @attribute: a file attribute key.
18707 * @attr_value: a #GObject.
18709 * Sets the @attribute to contain the given @attr_value,
18715 * g_file_info_set_attribute_status:
18716 * @info: a #GFileInfo
18717 * @attribute: a file attribute key
18718 * @status: a #GFileAttributeStatus
18720 * Sets the attribute status for an attribute key. This is only
18721 * needed by external code that implement g_file_set_attributes_from_info()
18722 * or similar functions.
18724 * The attribute must exist in @info for this to work. Otherwise %FALSE
18725 * is returned and @info is unchanged.
18727 * Returns: %TRUE if the status was changed, %FALSE if the key was not set.
18733 * g_file_info_set_attribute_string:
18734 * @info: a #GFileInfo.
18735 * @attribute: a file attribute key.
18736 * @attr_value: a UTF-8 string.
18738 * Sets the @attribute to contain the given @attr_value,
18744 * g_file_info_set_attribute_stringv:
18745 * @info: a #GFileInfo.
18746 * @attribute: a file attribute key
18747 * @attr_value: (array) (element-type utf8): a %NULL terminated array of UTF-8 strings.
18749 * Sets the @attribute to contain the given @attr_value,
18757 * g_file_info_set_attribute_uint32:
18758 * @info: a #GFileInfo.
18759 * @attribute: a file attribute key.
18760 * @attr_value: an unsigned 32-bit integer.
18762 * Sets the @attribute to contain the given @attr_value,
18768 * g_file_info_set_attribute_uint64:
18769 * @info: a #GFileInfo.
18770 * @attribute: a file attribute key.
18771 * @attr_value: an unsigned 64-bit integer.
18773 * Sets the @attribute to contain the given @attr_value,
18779 * g_file_info_set_content_type:
18780 * @info: a #GFileInfo.
18781 * @content_type: a content type. See <link linkend="gio-GContentType">GContentType</link>.
18783 * Sets the content type attribute for a given #GFileInfo.
18784 * See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
18789 * g_file_info_set_display_name:
18790 * @info: a #GFileInfo.
18791 * @display_name: a string containing a display name.
18793 * Sets the display name for the current #GFileInfo.
18794 * See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
18799 * g_file_info_set_edit_name:
18800 * @info: a #GFileInfo.
18801 * @edit_name: a string containing an edit name.
18803 * Sets the edit name for the current file.
18804 * See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
18809 * g_file_info_set_file_type:
18810 * @info: a #GFileInfo.
18811 * @type: a #GFileType.
18813 * Sets the file type in a #GFileInfo to @type.
18814 * See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
18819 * g_file_info_set_icon:
18820 * @info: a #GFileInfo.
18823 * Sets the icon for a given #GFileInfo.
18824 * See %G_FILE_ATTRIBUTE_STANDARD_ICON.
18829 * g_file_info_set_is_hidden:
18830 * @info: a #GFileInfo.
18831 * @is_hidden: a #gboolean.
18833 * Sets the "is_hidden" attribute in a #GFileInfo according to @is_symlink.
18834 * See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
18839 * g_file_info_set_is_symlink:
18840 * @info: a #GFileInfo.
18841 * @is_symlink: a #gboolean.
18843 * Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
18844 * See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
18849 * g_file_info_set_modification_time:
18850 * @info: a #GFileInfo.
18851 * @mtime: a #GTimeVal.
18853 * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
18854 * info to the given time value.
18859 * g_file_info_set_name:
18860 * @info: a #GFileInfo.
18861 * @name: a string containing a name.
18863 * Sets the name attribute for the current #GFileInfo.
18864 * See %G_FILE_ATTRIBUTE_STANDARD_NAME.
18869 * g_file_info_set_size:
18870 * @info: a #GFileInfo.
18871 * @size: a #goffset containing the file's size.
18873 * Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info
18874 * to the given size.
18879 * g_file_info_set_sort_order:
18880 * @info: a #GFileInfo.
18881 * @sort_order: a sort order integer.
18883 * Sets the sort order attribute in the file info structure. See
18884 * %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
18889 * g_file_info_set_symbolic_icon:
18890 * @info: a #GFileInfo.
18893 * Sets the symbolic icon for a given #GFileInfo.
18894 * See %G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON.
18901 * g_file_info_set_symlink_target:
18902 * @info: a #GFileInfo.
18903 * @symlink_target: a static string containing a path to a symlink target.
18905 * Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
18906 * to the given symlink target.
18911 * g_file_info_unset_attribute_mask:
18912 * @info: #GFileInfo.
18914 * Unsets a mask set by g_file_info_set_attribute_mask(), if one
18920 * g_file_input_stream_query_info:
18921 * @stream: a #GFileInputStream.
18922 * @attributes: a file attribute query string.
18923 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18924 * @error: a #GError location to store the error occurring, or %NULL to ignore.
18926 * Queries a file input stream the given @attributes. This function blocks
18927 * while querying the stream. For the asynchronous (non-blocking) version
18928 * of this function, see g_file_input_stream_query_info_async(). While the
18929 * stream is blocked, the stream will set the pending flag internally, and
18930 * any other operations on the stream will fail with %G_IO_ERROR_PENDING.
18932 * Returns: (transfer full): a #GFileInfo, or %NULL on error.
18937 * g_file_input_stream_query_info_async:
18938 * @stream: a #GFileInputStream.
18939 * @attributes: a file attribute query string.
18940 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
18941 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18942 * @callback: (scope async): callback to call when the request is satisfied
18943 * @user_data: (closure): the data to pass to callback function
18945 * Queries the stream information asynchronously.
18946 * When the operation is finished @callback will be called.
18947 * You can then call g_file_input_stream_query_info_finish()
18948 * to get the result of the operation.
18950 * For the synchronous version of this function,
18951 * see g_file_input_stream_query_info().
18953 * If @cancellable is not %NULL, then the operation can be cancelled by
18954 * triggering the cancellable object from another thread. If the operation
18955 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set
18960 * g_file_input_stream_query_info_finish:
18961 * @stream: a #GFileInputStream.
18962 * @result: a #GAsyncResult.
18963 * @error: a #GError location to store the error occurring, or %NULL to ignore.
18965 * Finishes an asynchronous info query operation.
18967 * Returns: (transfer full): #GFileInfo.
18972 * g_file_io_stream_get_etag:
18973 * @stream: a #GFileIOStream.
18975 * Gets the entity tag for the file when it has been written.
18976 * This must be called after the stream has been written
18977 * and closed, as the etag can change while writing.
18979 * Returns: the entity tag for the stream.
18985 * g_file_io_stream_query_info:
18986 * @stream: a #GFileIOStream.
18987 * @attributes: a file attribute query string.
18988 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18989 * @error: a #GError, %NULL to ignore.
18991 * Queries a file io stream for the given @attributes.
18992 * This function blocks while querying the stream. For the asynchronous
18993 * version of this function, see g_file_io_stream_query_info_async().
18994 * While the stream is blocked, the stream will set the pending flag
18995 * internally, and any other operations on the stream will fail with
18996 * %G_IO_ERROR_PENDING.
18998 * Can fail if the stream was already closed (with @error being set to
18999 * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
19000 * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
19001 * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). I
19002 * all cases of failure, %NULL will be returned.
19004 * If @cancellable is not %NULL, then the operation can be cancelled by
19005 * triggering the cancellable object from another thread. If the operation
19006 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
19009 * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
19015 * g_file_io_stream_query_info_async:
19016 * @stream: a #GFileIOStream.
19017 * @attributes: a file attribute query string.
19018 * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
19019 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19020 * @callback: (scope async): callback to call when the request is satisfied
19021 * @user_data: (closure): the data to pass to callback function
19023 * Asynchronously queries the @stream for a #GFileInfo. When completed,
19024 * @callback will be called with a #GAsyncResult which can be used to
19025 * finish the operation with g_file_io_stream_query_info_finish().
19027 * For the synchronous version of this function, see
19028 * g_file_io_stream_query_info().
19035 * g_file_io_stream_query_info_finish:
19036 * @stream: a #GFileIOStream.
19037 * @result: a #GAsyncResult.
19038 * @error: a #GError, %NULL to ignore.
19040 * Finalizes the asynchronous query started
19041 * by g_file_io_stream_query_info_async().
19043 * Returns: (transfer full): A #GFileInfo for the finished query.
19049 * g_file_is_native:
19050 * @file: input #GFile
19052 * Checks to see if a file is native to the platform.
19054 * A native file s one expressed in the platform-native filename format,
19055 * e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
19056 * as it might be on a locally mounted remote filesystem.
19058 * On some systems non-native files may be available using the native
19059 * filesystem via a userspace filesystem (FUSE), in these cases this call
19060 * will return %FALSE, but g_file_get_path() will still return a native path.
19062 * This call does no blocking I/O.
19064 * Returns: %TRUE if @file is native
19069 * g_file_load_contents:
19070 * @file: input #GFile
19071 * @cancellable: optional #GCancellable object, %NULL to ignore
19072 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19073 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19074 * @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
19075 * @error: a #GError, or %NULL
19077 * Loads the content of the file into memory. The data is always
19078 * zero-terminated, but this is not included in the resultant @length.
19079 * The returned @content should be freed with g_free() when no longer
19082 * If @cancellable is not %NULL, then the operation can be cancelled by
19083 * triggering the cancellable object from another thread. If the operation
19084 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19086 * Returns: %TRUE if the @file's contents were successfully loaded. %FALSE if there were errors.
19091 * g_file_load_contents_async:
19092 * @file: input #GFile
19093 * @cancellable: optional #GCancellable object, %NULL to ignore
19094 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19095 * @user_data: the data to pass to callback function
19097 * Starts an asynchronous load of the @file's contents.
19099 * For more details, see g_file_load_contents() which is
19100 * the synchronous version of this call.
19102 * When the load operation has completed, @callback will be called
19103 * with @user data. To finish the operation, call
19104 * g_file_load_contents_finish() with the #GAsyncResult returned by
19107 * If @cancellable is not %NULL, then the operation can be cancelled by
19108 * triggering the cancellable object from another thread. If the operation
19109 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19114 * g_file_load_contents_finish:
19115 * @file: input #GFile
19116 * @res: a #GAsyncResult
19117 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19118 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19119 * @etag_out: (out) (allow-none): a location to place the current entity tag for the file, or %NULL if the entity tag is not needed
19120 * @error: a #GError, or %NULL
19122 * Finishes an asynchronous load of the @file's contents.
19123 * The contents are placed in @contents, and @length is set to the
19124 * size of the @contents string. The @content should be freed with
19125 * g_free() when no longer needed. If @etag_out is present, it will be
19126 * set to the new entity tag for the @file.
19128 * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
19133 * g_file_load_partial_contents_async: (skip)
19134 * @file: input #GFile
19135 * @cancellable: optional #GCancellable object, %NULL to ignore
19136 * @read_more_callback: a #GFileReadMoreCallback to receive partial data and to specify whether further data should be read
19137 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19138 * @user_data: the data to pass to the callback functions
19140 * Reads the partial contents of a file. A #GFileReadMoreCallback should
19141 * be used to stop reading from the file when appropriate, else this
19142 * function will behave exactly as g_file_load_contents_async(). This
19143 * operation can be finished by g_file_load_partial_contents_finish().
19145 * Users of this function should be aware that @user_data is passed to
19146 * both the @read_more_callback and the @callback.
19148 * If @cancellable is not %NULL, then the operation can be cancelled by
19149 * triggering the cancellable object from another thread. If the operation
19150 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19155 * g_file_load_partial_contents_finish:
19156 * @file: input #GFile
19157 * @res: a #GAsyncResult
19158 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19159 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19160 * @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
19161 * @error: a #GError, or %NULL
19163 * Finishes an asynchronous partial load operation that was started
19164 * with g_file_load_partial_contents_async(). The data is always
19165 * zero-terminated, but this is not included in the resultant @length.
19166 * The returned @content should be freed with g_free() when no longer
19169 * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
19174 * g_file_make_directory:
19175 * @file: input #GFile
19176 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19177 * @error: a #GError, or %NULL
19179 * Creates a directory. Note that this will only create a child directory
19180 * of the immediate parent directory of the path or URI given by the #GFile.
19181 * To recursively create directories, see g_file_make_directory_with_parents().
19182 * This function will fail if the parent directory does not exist, setting
19183 * @error to %G_IO_ERROR_NOT_FOUND. If the file system doesn't support
19184 * creating directories, this function will fail, setting @error to
19185 * %G_IO_ERROR_NOT_SUPPORTED.
19187 * For a local #GFile the newly created directory will have the default
19188 * (current) ownership and permissions of the current process.
19190 * If @cancellable is not %NULL, then the operation can be cancelled by
19191 * triggering the cancellable object from another thread. If the operation
19192 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19194 * Returns: %TRUE on successful creation, %FALSE otherwise.
19199 * g_file_make_directory_with_parents:
19200 * @file: input #GFile
19201 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19202 * @error: a #GError, or %NULL
19204 * Creates a directory and any parent directories that may not
19205 * exist similar to 'mkdir -p'. If the file system does not support
19206 * creating directories, this function will fail, setting @error to
19207 * %G_IO_ERROR_NOT_SUPPORTED. If the directory itself already exists,
19208 * this function will fail setting @error to %G_IO_ERROR_EXISTS, unlike
19209 * the similar g_mkdir_with_parents().
19211 * For a local #GFile the newly created directories will have the default
19212 * (current) ownership and permissions of the current process.
19214 * If @cancellable is not %NULL, then the operation can be cancelled by
19215 * triggering the cancellable object from another thread. If the operation
19216 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19218 * Returns: %TRUE if all directories have been successfully created, %FALSE otherwise.
19224 * g_file_make_symbolic_link:
19225 * @file: a #GFile with the name of the symlink to create
19226 * @symlink_value: a string with the path for the target of the new symlink
19227 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19228 * @error: a #GError
19230 * Creates a symbolic link named @file which contains the string
19233 * If @cancellable is not %NULL, then the operation can be cancelled by
19234 * triggering the cancellable object from another thread. If the operation
19235 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19237 * Returns: %TRUE on the creation of a new symlink, %FALSE otherwise.
19243 * @file: input #GFile
19244 * @flags: a set of #GFileMonitorFlags
19245 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19246 * @error: a #GError, or %NULL
19248 * Obtains a file or directory monitor for the given file,
19249 * depending on the type of the file.
19251 * If @cancellable is not %NULL, then the operation can be cancelled by
19252 * triggering the cancellable object from another thread. If the operation
19253 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19255 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19261 * g_file_monitor_cancel:
19262 * @monitor: a #GFileMonitor.
19264 * Cancels a file monitor.
19266 * Returns: %TRUE if monitor was cancelled.
19271 * g_file_monitor_directory:
19272 * @file: input #GFile
19273 * @flags: a set of #GFileMonitorFlags
19274 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19275 * @error: a #GError, or %NULL
19277 * Obtains a directory monitor for the given file.
19278 * This may fail if directory monitoring is not supported.
19280 * If @cancellable is not %NULL, then the operation can be cancelled by
19281 * triggering the cancellable object from another thread. If the operation
19282 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19284 * Virtual: monitor_dir
19285 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19290 * g_file_monitor_emit_event:
19291 * @monitor: a #GFileMonitor.
19292 * @child: a #GFile.
19293 * @other_file: a #GFile.
19294 * @event_type: a set of #GFileMonitorEvent flags.
19296 * Emits the #GFileMonitor::changed signal if a change
19297 * has taken place. Should be called from file monitor
19298 * implementations only.
19300 * The signal will be emitted from an idle handler (in the <link
19301 * linkend="g-main-context-push-thread-default">thread-default main
19307 * g_file_monitor_file:
19308 * @file: input #GFile
19309 * @flags: a set of #GFileMonitorFlags
19310 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19311 * @error: a #GError, or %NULL
19313 * Obtains a file monitor for the given file. If no file notification
19314 * mechanism exists, then regular polling of the file is used.
19316 * If @cancellable is not %NULL, then the operation can be cancelled by
19317 * triggering the cancellable object from another thread. If the operation
19318 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19320 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19325 * g_file_monitor_is_cancelled:
19326 * @monitor: a #GFileMonitor
19328 * Returns whether the monitor is canceled.
19330 * Returns: %TRUE if monitor is canceled. %FALSE otherwise.
19335 * g_file_monitor_set_rate_limit:
19336 * @monitor: a #GFileMonitor.
19337 * @limit_msecs: a non-negative integer with the limit in milliseconds to poll for changes
19339 * Sets the rate limit to which the @monitor will report
19340 * consecutive change events to the same file.
19345 * g_file_mount_enclosing_volume:
19346 * @location: input #GFile
19347 * @flags: flags affecting the operation
19348 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction
19349 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19350 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19351 * @user_data: the data to pass to callback function
19353 * Starts a @mount_operation, mounting the volume that contains
19354 * the file @location.
19356 * When this operation has completed, @callback will be called with
19357 * @user_user data, and the operation can be finalized with
19358 * g_file_mount_enclosing_volume_finish().
19360 * If @cancellable is not %NULL, then the operation can be cancelled by
19361 * triggering the cancellable object from another thread. If the operation
19362 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19367 * g_file_mount_enclosing_volume_finish:
19368 * @location: input #GFile
19369 * @result: a #GAsyncResult
19370 * @error: a #GError, or %NULL
19372 * Finishes a mount operation started by g_file_mount_enclosing_volume().
19374 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
19379 * g_file_mount_mountable:
19380 * @file: input #GFile
19381 * @flags: flags affecting the operation
19382 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
19383 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19384 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19385 * @user_data: (closure): the data to pass to callback function
19387 * Mounts a file of type G_FILE_TYPE_MOUNTABLE.
19388 * Using @mount_operation, you can request callbacks when, for instance,
19389 * passwords are needed during authentication.
19391 * If @cancellable is not %NULL, then the operation can be cancelled by
19392 * triggering the cancellable object from another thread. If the operation
19393 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19395 * When the operation is finished, @callback will be called.
19396 * You can then call g_file_mount_mountable_finish() to get
19397 * the result of the operation.
19402 * g_file_mount_mountable_finish:
19403 * @file: input #GFile
19404 * @result: a #GAsyncResult
19405 * @error: a #GError, or %NULL
19407 * Finishes a mount operation. See g_file_mount_mountable() for details.
19409 * Finish an asynchronous mount operation that was started
19410 * with g_file_mount_mountable().
19412 * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
19418 * @source: #GFile pointing to the source location
19419 * @destination: #GFile pointing to the destination location
19420 * @flags: set of #GFileCopyFlags
19421 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19422 * @progress_callback: (allow-none) (scope call): #GFileProgressCallback function for updates
19423 * @progress_callback_data: (closure): gpointer to user data for the callback function
19424 * @error: #GError for returning error conditions, or %NULL
19426 * Tries to move the file or directory @source to the location specified
19427 * by @destination. If native move operations are supported then this is
19428 * used, otherwise a copy + delete fallback is used. The native
19429 * implementation may support moving directories (for instance on moves
19430 * inside the same filesystem), but the fallback code does not.
19432 * If the flag #G_FILE_COPY_OVERWRITE is specified an already
19433 * existing @destination file is overwritten.
19435 * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
19436 * will be copied as symlinks, otherwise the target of the
19437 * @source symlink will be copied.
19439 * If @cancellable is not %NULL, then the operation can be cancelled by
19440 * triggering the cancellable object from another thread. If the operation
19441 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19443 * If @progress_callback is not %NULL, then the operation can be monitored
19444 * by setting this to a #GFileProgressCallback function.
19445 * @progress_callback_data will be passed to this function. It is
19446 * guaranteed that this callback will be called after all data has been
19447 * transferred with the total number of bytes copied during the operation.
19449 * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND
19450 * error is returned, independent on the status of the @destination.
19452 * If #G_FILE_COPY_OVERWRITE is not specified and the target exists,
19453 * then the error %G_IO_ERROR_EXISTS is returned.
19455 * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
19456 * error is returned. If trying to overwrite a directory with a directory the
19457 * %G_IO_ERROR_WOULD_MERGE error is returned.
19459 * If the source is a directory and the target does not exist, or
19460 * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then
19461 * the %G_IO_ERROR_WOULD_RECURSE error may be returned (if the native
19462 * move operation isn't available).
19464 * Returns: %TRUE on successful move, %FALSE otherwise.
19469 * g_file_new_for_commandline_arg:
19470 * @arg: a command line string
19472 * Creates a #GFile with the given argument from the command line.
19473 * The value of @arg can be either a URI, an absolute path or a
19474 * relative path resolved relative to the current working directory.
19475 * This operation never fails, but the returned object might not
19476 * support any I/O operation if @arg points to a malformed path.
19478 * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
19483 * g_file_new_for_path:
19484 * @path: a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
19486 * Constructs a #GFile for a given path. This operation never
19487 * fails, but the returned object might not support any I/O
19488 * operation if @path is malformed.
19490 * Returns: (transfer full): a new #GFile for the given @path. Free the returned object with g_object_unref().
19495 * g_file_new_for_uri:
19496 * @uri: a UTF-8 string containing a URI
19498 * Constructs a #GFile for a given URI. This operation never
19499 * fails, but the returned object might not support any I/O
19500 * operation if @uri is malformed or if the uri type is
19503 * Returns: (transfer full): a new #GFile for the given @uri. Free the returned object with g_object_unref().
19509 * @tmpl: (type filename) (allow-none): Template for the file name, as in g_file_open_tmp(), or %NULL for a default template
19510 * @iostream: (out): on return, a #GFileIOStream for the created file
19511 * @error: a #GError, or %NULL
19513 * Opens a file in the preferred directory for temporary files (as
19514 * returned by g_get_tmp_dir()) and returns a #GFile and
19515 * #GFileIOStream pointing to it.
19517 * @tmpl should be a string in the GLib file name encoding
19518 * containing a sequence of six 'X' characters, and containing no
19519 * directory components. If it is %NULL, a default template is used.
19521 * Unlike the other #GFile constructors, this will return %NULL if
19522 * a temporary file could not be created.
19524 * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
19530 * g_file_open_readwrite:
19531 * @file: #GFile to open
19532 * @cancellable: (allow-none): a #GCancellable
19533 * @error: a #GError, or %NULL
19535 * Opens an existing file for reading and writing. The result is
19536 * a #GFileIOStream that can be used to read and write the contents
19539 * If @cancellable is not %NULL, then the operation can be cancelled
19540 * by triggering the cancellable object from another thread. If the
19541 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19544 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
19545 * be returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
19546 * error will be returned. Other errors are possible too, and depend on
19547 * what kind of filesystem the file is on. Note that in many non-local
19548 * file cases read and write streams are not supported, so make sure you
19549 * really need to do read and write streaming, rather than just opening
19550 * for reading or writing.
19552 * Returns: (transfer full): #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19558 * g_file_open_readwrite_async:
19559 * @file: input #GFile
19560 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19561 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19562 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19563 * @user_data: (closure): the data to pass to callback function
19565 * Asynchronously opens @file for reading and writing.
19567 * For more details, see g_file_open_readwrite() which is
19568 * the synchronous version of this call.
19570 * When the operation is finished, @callback will be called.
19571 * You can then call g_file_open_readwrite_finish() to get
19572 * the result of the operation.
19579 * g_file_open_readwrite_finish:
19580 * @file: input #GFile
19581 * @res: a #GAsyncResult
19582 * @error: a #GError, or %NULL
19584 * Finishes an asynchronous file read operation started with
19585 * g_file_open_readwrite_async().
19587 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19593 * g_file_output_stream_get_etag:
19594 * @stream: a #GFileOutputStream.
19596 * Gets the entity tag for the file when it has been written.
19597 * This must be called after the stream has been written
19598 * and closed, as the etag can change while writing.
19600 * Returns: the entity tag for the stream.
19605 * g_file_output_stream_query_info:
19606 * @stream: a #GFileOutputStream.
19607 * @attributes: a file attribute query string.
19608 * @cancellable: optional #GCancellable object, %NULL to ignore.
19609 * @error: a #GError, %NULL to ignore.
19611 * Queries a file output stream for the given @attributes.
19612 * This function blocks while querying the stream. For the asynchronous
19613 * version of this function, see g_file_output_stream_query_info_async().
19614 * While the stream is blocked, the stream will set the pending flag
19615 * internally, and any other operations on the stream will fail with
19616 * %G_IO_ERROR_PENDING.
19618 * Can fail if the stream was already closed (with @error being set to
19619 * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
19620 * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
19621 * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). In
19622 * all cases of failure, %NULL will be returned.
19624 * If @cancellable is not %NULL, then the operation can be cancelled by
19625 * triggering the cancellable object from another thread. If the operation
19626 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
19629 * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
19634 * g_file_output_stream_query_info_async:
19635 * @stream: a #GFileOutputStream.
19636 * @attributes: a file attribute query string.
19637 * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
19638 * @cancellable: optional #GCancellable object, %NULL to ignore.
19639 * @callback: callback to call when the request is satisfied
19640 * @user_data: the data to pass to callback function
19642 * Asynchronously queries the @stream for a #GFileInfo. When completed,
19643 * @callback will be called with a #GAsyncResult which can be used to
19644 * finish the operation with g_file_output_stream_query_info_finish().
19646 * For the synchronous version of this function, see
19647 * g_file_output_stream_query_info().
19652 * g_file_output_stream_query_info_finish:
19653 * @stream: a #GFileOutputStream.
19654 * @result: a #GAsyncResult.
19655 * @error: a #GError, %NULL to ignore.
19657 * Finalizes the asynchronous query started
19658 * by g_file_output_stream_query_info_async().
19660 * Returns: (transfer full): A #GFileInfo for the finished query.
19665 * g_file_parse_name:
19666 * @parse_name: a file name or path to be parsed
19668 * Constructs a #GFile with the given @parse_name (i.e. something
19669 * given by g_file_get_parse_name()). This operation never fails,
19670 * but the returned object might not support any I/O operation if
19671 * the @parse_name cannot be parsed.
19673 * Returns: (transfer full): a new #GFile.
19678 * g_file_poll_mountable:
19679 * @file: input #GFile
19680 * @cancellable: optional #GCancellable object, %NULL to ignore
19681 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19682 * @user_data: the data to pass to callback function
19684 * Polls a file of type #G_FILE_TYPE_MOUNTABLE.
19686 * If @cancellable is not %NULL, then the operation can be cancelled by
19687 * triggering the cancellable object from another thread. If the operation
19688 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19690 * When the operation is finished, @callback will be called.
19691 * You can then call g_file_mount_mountable_finish() to get
19692 * the result of the operation.
19699 * g_file_poll_mountable_finish:
19700 * @file: input #GFile
19701 * @result: a #GAsyncResult
19702 * @error: a #GError, or %NULL
19704 * Finishes a poll operation. See g_file_poll_mountable() for details.
19706 * Finish an asynchronous poll operation that was polled
19707 * with g_file_poll_mountable().
19709 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
19715 * g_file_query_default_handler:
19716 * @file: a #GFile to open
19717 * @cancellable: optional #GCancellable object, %NULL to ignore
19718 * @error: a #GError, or %NULL
19720 * Returns the #GAppInfo that is registered as the default
19721 * application to handle the file specified by @file.
19723 * If @cancellable is not %NULL, then the operation can be cancelled by
19724 * triggering the cancellable object from another thread. If the operation
19725 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19727 * 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()
19732 * g_file_query_exists:
19733 * @file: input #GFile
19734 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19736 * Utility function to check if a particular file exists. This is
19737 * implemented using g_file_query_info() and as such does blocking I/O.
19739 * Note that in many cases it is racy to first check for file existence
19740 * and then execute something based on the outcome of that, because the
19741 * file might have been created or removed in between the operations. The
19742 * general approach to handling that is to not check, but just do the
19743 * operation and handle the errors as they come.
19745 * As an example of race-free checking, take the case of reading a file,
19746 * and if it doesn't exist, creating it. There are two racy versions: read
19747 * it, and on error create it; and: check if it exists, if not create it.
19748 * These can both result in two processes creating the file (with perhaps
19749 * a partially written file as the result). The correct approach is to
19750 * always try to create the file with g_file_create() which will either
19751 * atomically create the file or fail with a %G_IO_ERROR_EXISTS error.
19753 * However, in many cases an existence check is useful in a user interface,
19754 * for instance to make a menu item sensitive/insensitive, so that you don't
19755 * have to fool users that something is possible and then just show an error
19756 * dialog. If you do this, you should make sure to also handle the errors
19757 * that can happen due to races when you execute the operation.
19759 * Returns: %TRUE if the file exists (and can be detected without error), %FALSE otherwise (or if cancelled).
19764 * g_file_query_file_type:
19765 * @file: input #GFile
19766 * @flags: a set of #GFileQueryInfoFlags passed to g_file_query_info()
19767 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19769 * Utility function to inspect the #GFileType of a file. This is
19770 * implemented using g_file_query_info() and as such does blocking I/O.
19772 * The primary use case of this method is to check if a file is
19773 * a regular file, directory, or symlink.
19775 * Returns: The #GFileType of the file and #G_FILE_TYPE_UNKNOWN if the file does not exist
19781 * g_file_query_filesystem_info:
19782 * @file: input #GFile
19783 * @attributes: an attribute query string
19784 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19785 * @error: a #GError
19787 * Similar to g_file_query_info(), but obtains information
19788 * about the filesystem the @file is on, rather than the file itself.
19789 * For instance the amount of space available and the type of
19792 * The @attributes value is a string that specifies the attributes
19793 * that should be gathered. It is not an error if it's not possible
19794 * to read a particular requested attribute from a file - it just
19795 * won't be set. @attributes should be a comma-separated list of
19796 * attributes or attribute wildcards. The wildcard "*" means all
19797 * attributes, and a wildcard like "filesystem::*" means all attributes
19798 * in the filesystem namespace. The standard namespace for filesystem
19799 * attributes is "filesystem". Common attributes of interest are
19800 * #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE (the total size of the filesystem
19801 * in bytes), #G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of bytes available),
19802 * and #G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
19804 * If @cancellable is not %NULL, then the operation can be cancelled
19805 * by triggering the cancellable object from another thread. If the
19806 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19809 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
19810 * be returned. Other errors are possible too, and depend on what
19811 * kind of filesystem the file is on.
19813 * Returns: (transfer full): a #GFileInfo or %NULL if there was an error. Free the returned object with g_object_unref().
19818 * g_file_query_filesystem_info_async:
19819 * @file: input #GFile
19820 * @attributes: an attribute query string
19821 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19822 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19823 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19824 * @user_data: (closure): the data to pass to callback function
19826 * Asynchronously gets the requested information about the filesystem
19827 * that the specified @file is on. The result is a #GFileInfo object
19828 * that contains key-value attributes (such as type or size for the
19831 * For more details, see g_file_query_filesystem_info() which is the
19832 * synchronous version of this call.
19834 * When the operation is finished, @callback will be called. You can
19835 * then call g_file_query_info_finish() to get the result of the
19841 * g_file_query_filesystem_info_finish:
19842 * @file: input #GFile
19843 * @res: a #GAsyncResult
19844 * @error: a #GError
19846 * Finishes an asynchronous filesystem info query.
19847 * See g_file_query_filesystem_info_async().
19849 * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
19854 * g_file_query_info:
19855 * @file: input #GFile
19856 * @attributes: an attribute query string
19857 * @flags: a set of #GFileQueryInfoFlags
19858 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19859 * @error: a #GError
19861 * Gets the requested information about specified @file.
19862 * The result is a #GFileInfo object that contains key-value
19863 * attributes (such as the type or size of the file).
19865 * The @attributes value is a string that specifies the file
19866 * attributes that should be gathered. It is not an error if
19867 * it's not possible to read a particular requested attribute
19868 * from a file - it just won't be set. @attributes should be a
19869 * comma-separated list of attributes or attribute wildcards.
19870 * The wildcard "*" means all attributes, and a wildcard like
19871 * "standard::*" means all attributes in the standard namespace.
19872 * An example attribute query be "standard::*,owner::user".
19873 * The standard attributes are available as defines, like
19874 * #G_FILE_ATTRIBUTE_STANDARD_NAME.
19876 * If @cancellable is not %NULL, then the operation can be cancelled
19877 * by triggering the cancellable object from another thread. If the
19878 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19881 * For symlinks, normally the information about the target of the
19882 * symlink is returned, rather than information about the symlink
19883 * itself. However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS
19884 * in @flags the information about the symlink itself will be returned.
19885 * Also, for symlinks that point to non-existing files the information
19886 * about the symlink itself will be returned.
19888 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
19889 * returned. Other errors are possible too, and depend on what kind of
19890 * filesystem the file is on.
19892 * Returns: (transfer full): a #GFileInfo for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19897 * g_file_query_info_async:
19898 * @file: input #GFile
19899 * @attributes: an attribute query string
19900 * @flags: a set of #GFileQueryInfoFlags
19901 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19902 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19903 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19904 * @user_data: (closure): the data to pass to callback function
19906 * Asynchronously gets the requested information about specified @file.
19907 * The result is a #GFileInfo object that contains key-value attributes
19908 * (such as type or size for the file).
19910 * For more details, see g_file_query_info() which is the synchronous
19911 * version of this call.
19913 * When the operation is finished, @callback will be called. You can
19914 * then call g_file_query_info_finish() to get the result of the operation.
19919 * g_file_query_info_finish:
19920 * @file: input #GFile
19921 * @res: a #GAsyncResult
19922 * @error: a #GError
19924 * Finishes an asynchronous file info query.
19925 * See g_file_query_info_async().
19927 * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
19932 * g_file_query_settable_attributes:
19933 * @file: input #GFile
19934 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19935 * @error: a #GError, or %NULL
19937 * Obtain the list of settable attributes for the file.
19939 * Returns the type and full attribute name of all the attributes
19940 * that can be set on this file. This doesn't mean setting it will
19941 * always succeed though, you might get an access failure, or some
19942 * specific file may not support a specific attribute.
19944 * If @cancellable is not %NULL, then the operation can be cancelled by
19945 * triggering the cancellable object from another thread. If the operation
19946 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19948 * Returns: a #GFileAttributeInfoList describing the settable attributes. When you are done with it, release it with g_file_attribute_info_list_unref()
19953 * g_file_query_writable_namespaces:
19954 * @file: input #GFile
19955 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19956 * @error: a #GError, or %NULL
19958 * Obtain the list of attribute namespaces where new attributes
19959 * can be created by a user. An example of this is extended
19960 * attributes (in the "xattr" namespace).
19962 * If @cancellable is not %NULL, then the operation can be cancelled by
19963 * triggering the cancellable object from another thread. If the operation
19964 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19966 * Returns: a #GFileAttributeInfoList describing the writable namespaces. When you are done with it, release it with g_file_attribute_info_list_unref()
19972 * @file: #GFile to read
19973 * @cancellable: (allow-none): a #GCancellable
19974 * @error: a #GError, or %NULL
19976 * Opens a file for reading. The result is a #GFileInputStream that
19977 * can be used to read the contents of the file.
19979 * If @cancellable is not %NULL, then the operation can be cancelled by
19980 * triggering the cancellable object from another thread. If the operation
19981 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19983 * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
19984 * returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
19985 * error will be returned. Other errors are possible too, and depend
19986 * on what kind of filesystem the file is on.
19989 * Returns: (transfer full): #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
19994 * g_file_read_async:
19995 * @file: input #GFile
19996 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19997 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19998 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19999 * @user_data: (closure): the data to pass to callback function
20001 * Asynchronously opens @file for reading.
20003 * For more details, see g_file_read() which is
20004 * the synchronous version of this call.
20006 * When the operation is finished, @callback will be called.
20007 * You can then call g_file_read_finish() to get the result
20008 * of the operation.
20013 * g_file_read_finish:
20014 * @file: input #GFile
20015 * @res: a #GAsyncResult
20016 * @error: a #GError, or %NULL
20018 * Finishes an asynchronous file read operation started with
20019 * g_file_read_async().
20021 * Returns: (transfer full): a #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
20027 * @file: input #GFile
20028 * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
20029 * @make_backup: %TRUE if a backup should be created
20030 * @flags: a set of #GFileCreateFlags
20031 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20032 * @error: a #GError, or %NULL
20034 * Returns an output stream for overwriting the file, possibly
20035 * creating a backup copy of the file first. If the file doesn't exist,
20036 * it will be created.
20038 * This will try to replace the file in the safest way possible so
20039 * that any errors during the writing will not affect an already
20040 * existing copy of the file. For instance, for local files it
20041 * may write to a temporary file and then atomically rename over
20042 * the destination when the stream is closed.
20044 * By default files created are generally readable by everyone,
20045 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
20046 * will be made readable only to the current user, to the level that
20047 * is supported on the target filesystem.
20049 * If @cancellable is not %NULL, then the operation can be cancelled
20050 * by triggering the cancellable object from another thread. If the
20051 * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
20054 * If you pass in a non-%NULL @etag value, then this value is
20055 * compared to the current entity tag of the file, and if they differ
20056 * an %G_IO_ERROR_WRONG_ETAG error is returned. This generally means
20057 * that the file has been changed since you last read it. You can get
20058 * the new etag from g_file_output_stream_get_etag() after you've
20059 * finished writing and closed the #GFileOutputStream. When you load
20060 * a new file you can use g_file_input_stream_query_info() to get
20061 * the etag of the file.
20063 * If @make_backup is %TRUE, this function will attempt to make a
20064 * backup of the current file before overwriting it. If this fails
20065 * a %G_IO_ERROR_CANT_CREATE_BACKUP error will be returned. If you
20066 * want to replace anyway, try again with @make_backup set to %FALSE.
20068 * If the file is a directory the %G_IO_ERROR_IS_DIRECTORY error will
20069 * be returned, and if the file is some other form of non-regular file
20070 * then a %G_IO_ERROR_NOT_REGULAR_FILE error will be returned. Some
20071 * file systems don't allow all file names, and may return an
20072 * %G_IO_ERROR_INVALID_FILENAME error, and if the name is to long
20073 * %G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors are
20074 * possible too, and depend on what kind of filesystem the file is on.
20076 * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
20081 * g_file_replace_async:
20082 * @file: input #GFile
20083 * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
20084 * @make_backup: %TRUE if a backup should be created
20085 * @flags: a set of #GFileCreateFlags
20086 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20087 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20088 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20089 * @user_data: (closure): the data to pass to callback function
20091 * Asynchronously overwrites the file, replacing the contents,
20092 * possibly creating a backup copy of the file first.
20094 * For more details, see g_file_replace() which is
20095 * the synchronous version of this call.
20097 * When the operation is finished, @callback will be called.
20098 * You can then call g_file_replace_finish() to get the result
20099 * of the operation.
20104 * g_file_replace_contents:
20105 * @file: input #GFile
20106 * @contents: (element-type guint8) (array length=length): a string containing the new contents for @file
20107 * @length: the length of @contents in bytes
20108 * @etag: (allow-none): the old <link linkend="gfile-etag">entity tag</link> for the document, or %NULL
20109 * @make_backup: %TRUE if a backup should be created
20110 * @flags: a set of #GFileCreateFlags
20111 * @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
20112 * @cancellable: optional #GCancellable object, %NULL to ignore
20113 * @error: a #GError, or %NULL
20115 * Replaces the contents of @file with @contents of @length bytes.
20117 * If @etag is specified (not %NULL), any existing file must have that etag,
20118 * or the error %G_IO_ERROR_WRONG_ETAG will be returned.
20120 * If @make_backup is %TRUE, this function will attempt to make a backup
20123 * If @cancellable is not %NULL, then the operation can be cancelled by
20124 * triggering the cancellable object from another thread. If the operation
20125 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20127 * The returned @new_etag can be used to verify that the file hasn't
20128 * changed the next time it is saved over.
20130 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
20135 * g_file_replace_contents_async:
20136 * @file: input #GFile
20137 * @contents: (element-type guint8) (array length=length): string of contents to replace the file with
20138 * @length: the length of @contents in bytes
20139 * @etag: (allow-none): a new <link linkend="gfile-etag">entity tag</link> for the @file, or %NULL
20140 * @make_backup: %TRUE if a backup should be created
20141 * @flags: a set of #GFileCreateFlags
20142 * @cancellable: optional #GCancellable object, %NULL to ignore
20143 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
20144 * @user_data: the data to pass to callback function
20146 * Starts an asynchronous replacement of @file with the given
20147 * @contents of @length bytes. @etag will replace the document's
20148 * current entity tag.
20150 * When this operation has completed, @callback will be called with
20151 * @user_user data, and the operation can be finalized with
20152 * g_file_replace_contents_finish().
20154 * If @cancellable is not %NULL, then the operation can be cancelled by
20155 * triggering the cancellable object from another thread. If the operation
20156 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20158 * If @make_backup is %TRUE, this function will attempt to
20159 * make a backup of @file.
20164 * g_file_replace_contents_finish:
20165 * @file: input #GFile
20166 * @res: a #GAsyncResult
20167 * @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
20168 * @error: a #GError, or %NULL
20170 * Finishes an asynchronous replace of the given @file. See
20171 * g_file_replace_contents_async(). Sets @new_etag to the new entity
20172 * tag for the document, if present.
20174 * Returns: %TRUE on success, %FALSE on failure.
20179 * g_file_replace_finish:
20180 * @file: input #GFile
20181 * @res: a #GAsyncResult
20182 * @error: a #GError, or %NULL
20184 * Finishes an asynchronous file replace operation started with
20185 * g_file_replace_async().
20187 * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
20192 * g_file_replace_readwrite:
20194 * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
20195 * @make_backup: %TRUE if a backup should be created
20196 * @flags: a set of #GFileCreateFlags
20197 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20198 * @error: return location for a #GError, or %NULL
20200 * Returns an output stream for overwriting the file in readwrite mode,
20201 * possibly creating a backup copy of the file first. If the file doesn't
20202 * exist, it will be created.
20204 * For details about the behaviour, see g_file_replace() which does the
20205 * same thing but returns an output stream only.
20207 * Note that in many non-local file cases read and write streams are not
20208 * supported, so make sure you really need to do read and write streaming,
20209 * rather than just opening for reading or writing.
20211 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
20217 * g_file_replace_readwrite_async:
20218 * @file: input #GFile
20219 * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
20220 * @make_backup: %TRUE if a backup should be created
20221 * @flags: a set of #GFileCreateFlags
20222 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20223 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20224 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20225 * @user_data: (closure): the data to pass to callback function
20227 * Asynchronously overwrites the file in read-write mode,
20228 * replacing the contents, possibly creating a backup copy
20229 * of the file first.
20231 * For more details, see g_file_replace_readwrite() which is
20232 * the synchronous version of this call.
20234 * When the operation is finished, @callback will be called.
20235 * You can then call g_file_replace_readwrite_finish() to get
20236 * the result of the operation.
20243 * g_file_replace_readwrite_finish:
20244 * @file: input #GFile
20245 * @res: a #GAsyncResult
20246 * @error: a #GError, or %NULL
20248 * Finishes an asynchronous file replace operation started with
20249 * g_file_replace_readwrite_async().
20251 * Returns: (transfer full): a #GFileIOStream, or %NULL on error. Free the returned object with g_object_unref().
20257 * g_file_resolve_relative_path:
20258 * @file: input #GFile
20259 * @relative_path: a given relative path string
20261 * Resolves a relative path for @file to an absolute path.
20263 * This call does no blocking I/O.
20265 * 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().
20270 * g_file_set_attribute:
20271 * @file: input #GFile
20272 * @attribute: a string containing the attribute's name
20273 * @type: The type of the attribute
20274 * @value_p: (allow-none): a pointer to the value (or the pointer itself if the type is a pointer type)
20275 * @flags: a set of #GFileQueryInfoFlags
20276 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20277 * @error: a #GError, or %NULL
20279 * Sets an attribute in the file with attribute name @attribute to @value.
20281 * Some attributes can be unset by setting @attribute to
20282 * %G_FILE_ATTRIBUTE_TYPE_INVALID and @value_p to %NULL.
20284 * If @cancellable is not %NULL, then the operation can be cancelled by
20285 * triggering the cancellable object from another thread. If the operation
20286 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20288 * Returns: %TRUE if the attribute was set, %FALSE otherwise.
20293 * g_file_set_attribute_byte_string:
20294 * @file: input #GFile
20295 * @attribute: a string containing the attribute's name
20296 * @value: a string containing the attribute's new value
20297 * @flags: a #GFileQueryInfoFlags
20298 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20299 * @error: a #GError, or %NULL
20301 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value.
20302 * If @attribute is of a different type, this operation will fail,
20303 * returning %FALSE.
20305 * If @cancellable is not %NULL, then the operation can be cancelled by
20306 * triggering the cancellable object from another thread. If the operation
20307 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20309 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20314 * g_file_set_attribute_int32:
20315 * @file: input #GFile
20316 * @attribute: a string containing the attribute's name
20317 * @value: a #gint32 containing the attribute's new value
20318 * @flags: a #GFileQueryInfoFlags
20319 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20320 * @error: a #GError, or %NULL
20322 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value.
20323 * If @attribute is of a different type, this operation will fail.
20325 * If @cancellable is not %NULL, then the operation can be cancelled by
20326 * triggering the cancellable object from another thread. If the operation
20327 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20329 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20334 * g_file_set_attribute_int64:
20335 * @file: input #GFile
20336 * @attribute: a string containing the attribute's name
20337 * @value: a #guint64 containing the attribute's new value
20338 * @flags: a #GFileQueryInfoFlags
20339 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20340 * @error: a #GError, or %NULL
20342 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value.
20343 * If @attribute is of a different type, this operation will fail.
20345 * If @cancellable is not %NULL, then the operation can be cancelled by
20346 * triggering the cancellable object from another thread. If the operation
20347 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20349 * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20354 * g_file_set_attribute_string:
20355 * @file: input #GFile
20356 * @attribute: a string containing the attribute's name
20357 * @value: a string containing the attribute's value
20358 * @flags: #GFileQueryInfoFlags
20359 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20360 * @error: a #GError, or %NULL
20362 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value.
20363 * If @attribute is of a different type, this operation will fail.
20365 * If @cancellable is not %NULL, then the operation can be cancelled by
20366 * triggering the cancellable object from another thread. If the operation
20367 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20369 * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20374 * g_file_set_attribute_uint32:
20375 * @file: input #GFile
20376 * @attribute: a string containing the attribute's name
20377 * @value: a #guint32 containing the attribute's new value
20378 * @flags: a #GFileQueryInfoFlags
20379 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20380 * @error: a #GError, or %NULL
20382 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value.
20383 * If @attribute is of a different type, this operation will fail.
20385 * If @cancellable is not %NULL, then the operation can be cancelled by
20386 * triggering the cancellable object from another thread. If the operation
20387 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20389 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20394 * g_file_set_attribute_uint64:
20395 * @file: input #GFile
20396 * @attribute: a string containing the attribute's name
20397 * @value: a #guint64 containing the attribute's new value
20398 * @flags: a #GFileQueryInfoFlags
20399 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20400 * @error: a #GError, or %NULL
20402 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value.
20403 * If @attribute is of a different type, this operation will fail.
20405 * If @cancellable is not %NULL, then the operation can be cancelled by
20406 * triggering the cancellable object from another thread. If the operation
20407 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20409 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20414 * g_file_set_attributes_async:
20415 * @file: input #GFile
20416 * @info: a #GFileInfo
20417 * @flags: a #GFileQueryInfoFlags
20418 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20419 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20420 * @callback: (scope async): a #GAsyncReadyCallback
20421 * @user_data: (closure): a #gpointer
20423 * Asynchronously sets the attributes of @file with @info.
20425 * For more details, see g_file_set_attributes_from_info(),
20426 * which is the synchronous version of this call.
20428 * When the operation is finished, @callback will be called.
20429 * You can then call g_file_set_attributes_finish() to get
20430 * the result of the operation.
20435 * g_file_set_attributes_finish:
20436 * @file: input #GFile
20437 * @result: a #GAsyncResult
20438 * @info: (out) (transfer full): a #GFileInfo
20439 * @error: a #GError, or %NULL
20441 * Finishes setting an attribute started in g_file_set_attributes_async().
20443 * Returns: %TRUE if the attributes were set correctly, %FALSE otherwise.
20448 * g_file_set_attributes_from_info:
20449 * @file: input #GFile
20450 * @info: a #GFileInfo
20451 * @flags: #GFileQueryInfoFlags
20452 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20453 * @error: a #GError, or %NULL
20455 * Tries to set all attributes in the #GFileInfo on the target
20456 * values, not stopping on the first error.
20458 * If there is any error during this operation then @error will
20459 * be set to the first error. Error on particular fields are flagged
20460 * by setting the "status" field in the attribute value to
20461 * %G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING, which means you can
20462 * also detect further errors.
20464 * If @cancellable is not %NULL, then the operation can be cancelled by
20465 * triggering the cancellable object from another thread. If the operation
20466 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20468 * Returns: %TRUE if there was any error, %FALSE otherwise.
20473 * g_file_set_display_name:
20474 * @file: input #GFile
20475 * @display_name: a string
20476 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20477 * @error: a #GError, or %NULL
20479 * Renames @file to the specified display name.
20481 * The display name is converted from UTF-8 to the correct encoding
20482 * for the target filesystem if possible and the @file is renamed to this.
20484 * If you want to implement a rename operation in the user interface the
20485 * edit name (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the
20486 * initial value in the rename widget, and then the result after editing
20487 * should be passed to g_file_set_display_name().
20489 * On success the resulting converted filename is returned.
20491 * If @cancellable is not %NULL, then the operation can be cancelled by
20492 * triggering the cancellable object from another thread. If the operation
20493 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20495 * 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().
20500 * g_file_set_display_name_async:
20501 * @file: input #GFile
20502 * @display_name: a string
20503 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20504 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20505 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20506 * @user_data: (closure): the data to pass to callback function
20508 * Asynchronously sets the display name for a given #GFile.
20510 * For more details, see g_file_set_display_name() which is
20511 * the synchronous version of this call.
20513 * When the operation is finished, @callback will be called.
20514 * You can then call g_file_set_display_name_finish() to get
20515 * the result of the operation.
20520 * g_file_set_display_name_finish:
20521 * @file: input #GFile
20522 * @res: a #GAsyncResult
20523 * @error: a #GError, or %NULL
20525 * Finishes setting a display name started with
20526 * g_file_set_display_name_async().
20528 * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
20533 * g_file_start_mountable:
20534 * @file: input #GFile
20535 * @flags: flags affecting the operation
20536 * @start_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
20537 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20538 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20539 * @user_data: the data to pass to callback function
20541 * Starts a file of type #G_FILE_TYPE_MOUNTABLE.
20542 * Using @start_operation, you can request callbacks when, for instance,
20543 * passwords are needed during authentication.
20545 * If @cancellable is not %NULL, then the operation can be cancelled by
20546 * triggering the cancellable object from another thread. If the operation
20547 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20549 * When the operation is finished, @callback will be called.
20550 * You can then call g_file_mount_mountable_finish() to get
20551 * the result of the operation.
20558 * g_file_start_mountable_finish:
20559 * @file: input #GFile
20560 * @result: a #GAsyncResult
20561 * @error: a #GError, or %NULL
20563 * Finishes a start operation. See g_file_start_mountable() for details.
20565 * Finish an asynchronous start operation that was started
20566 * with g_file_start_mountable().
20568 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20574 * g_file_stop_mountable:
20575 * @file: input #GFile
20576 * @flags: flags affecting the operation
20577 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
20578 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20579 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20580 * @user_data: the data to pass to callback function
20582 * Stops a file of type #G_FILE_TYPE_MOUNTABLE.
20584 * If @cancellable is not %NULL, then the operation can be cancelled by
20585 * triggering the cancellable object from another thread. If the operation
20586 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20588 * When the operation is finished, @callback will be called.
20589 * You can then call g_file_stop_mountable_finish() to get
20590 * the result of the operation.
20597 * g_file_stop_mountable_finish:
20598 * @file: input #GFile
20599 * @result: a #GAsyncResult
20600 * @error: a #GError, or %NULL
20602 * Finishes an stop operation, see g_file_stop_mountable() for details.
20604 * Finish an asynchronous stop operation that was started
20605 * with g_file_stop_mountable().
20607 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20613 * g_file_supports_thread_contexts:
20616 * Checks if @file supports <link
20617 * linkend="g-main-context-push-thread-default-context">thread-default
20618 * contexts</link>. If this returns %FALSE, you cannot perform
20619 * asynchronous operations on @file in a thread that has a
20620 * thread-default context.
20622 * Returns: Whether or not @file supports thread-default contexts.
20629 * @file: #GFile to send to trash
20630 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20631 * @error: a #GError, or %NULL
20633 * Sends @file to the "Trashcan", if possible. This is similar to
20634 * deleting it, but the user can recover it before emptying the trashcan.
20635 * Not all file systems support trashing, so this call can return the
20636 * %G_IO_ERROR_NOT_SUPPORTED error.
20638 * If @cancellable is not %NULL, then the operation can be cancelled by
20639 * triggering the cancellable object from another thread. If the operation
20640 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20642 * Returns: %TRUE on successful trash, %FALSE otherwise.
20647 * g_file_unmount_mountable:
20648 * @file: input #GFile
20649 * @flags: flags affecting the operation
20650 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20651 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20652 * @user_data: (closure): the data to pass to callback function
20654 * Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
20656 * If @cancellable is not %NULL, then the operation can be cancelled by
20657 * triggering the cancellable object from another thread. If the operation
20658 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20660 * When the operation is finished, @callback will be called.
20661 * You can then call g_file_unmount_mountable_finish() to get
20662 * the result of the operation.
20664 * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation() instead.
20669 * g_file_unmount_mountable_finish:
20670 * @file: input #GFile
20671 * @result: a #GAsyncResult
20672 * @error: a #GError, or %NULL
20674 * Finishes an unmount operation, see g_file_unmount_mountable() for details.
20676 * Finish an asynchronous unmount operation that was started
20677 * with g_file_unmount_mountable().
20679 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20680 * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation_finish() instead.
20685 * g_file_unmount_mountable_with_operation:
20686 * @file: input #GFile
20687 * @flags: flags affecting the operation
20688 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
20689 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20690 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20691 * @user_data: (closure): the data to pass to callback function
20693 * Unmounts a file of type #G_FILE_TYPE_MOUNTABLE.
20695 * If @cancellable is not %NULL, then the operation can be cancelled by
20696 * triggering the cancellable object from another thread. If the operation
20697 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20699 * When the operation is finished, @callback will be called.
20700 * You can then call g_file_unmount_mountable_finish() to get
20701 * the result of the operation.
20708 * g_file_unmount_mountable_with_operation_finish:
20709 * @file: input #GFile
20710 * @result: a #GAsyncResult
20711 * @error: a #GError, or %NULL
20713 * Finishes an unmount operation,
20714 * see g_file_unmount_mountable_with_operation() for details.
20716 * Finish an asynchronous unmount operation that was started
20717 * with g_file_unmount_mountable_with_operation().
20719 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20725 * g_filename_completer_get_completion_suffix:
20726 * @completer: the filename completer.
20727 * @initial_text: text to be completed.
20729 * Obtains a completion for @initial_text from @completer.
20731 * 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.
20736 * g_filename_completer_get_completions:
20737 * @completer: the filename completer.
20738 * @initial_text: text to be completed.
20740 * Gets an array of completion strings for a given initial text.
20742 * 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.
20747 * g_filename_completer_new:
20749 * Creates a new filename completer.
20751 * Returns: a #GFilenameCompleter.
20756 * g_filename_completer_set_dirs_only:
20757 * @completer: the filename completer.
20758 * @dirs_only: a #gboolean.
20760 * If @dirs_only is %TRUE, @completer will only
20761 * complete directory names, and not file names.
20766 * g_filter_input_stream_get_base_stream:
20767 * @stream: a #GFilterInputStream.
20769 * Gets the base stream for the filter stream.
20771 * Returns: (transfer none): a #GInputStream.
20776 * g_filter_input_stream_get_close_base_stream:
20777 * @stream: a #GFilterInputStream.
20779 * Returns whether the base stream will be closed when @stream is
20782 * Returns: %TRUE if the base stream will be closed.
20787 * g_filter_input_stream_set_close_base_stream:
20788 * @stream: a #GFilterInputStream.
20789 * @close_base: %TRUE to close the base stream.
20791 * Sets whether the base stream will be closed when @stream is closed.
20796 * g_filter_output_stream_get_base_stream:
20797 * @stream: a #GFilterOutputStream.
20799 * Gets the base stream for the filter stream.
20801 * Returns: (transfer none): a #GOutputStream.
20806 * g_filter_output_stream_get_close_base_stream:
20807 * @stream: a #GFilterOutputStream.
20809 * Returns whether the base stream will be closed when @stream is
20812 * Returns: %TRUE if the base stream will be closed.
20817 * g_filter_output_stream_set_close_base_stream:
20818 * @stream: a #GFilterOutputStream.
20819 * @close_base: %TRUE to close the base stream.
20821 * Sets whether the base stream will be closed when @stream is closed.
20827 * @icon1: (allow-none): pointer to the first #GIcon.
20828 * @icon2: (allow-none): pointer to the second #GIcon.
20830 * Checks if two icons are equal.
20832 * Returns: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
20838 * @icon: #gconstpointer to an icon object.
20840 * Gets a hash for an icon.
20843 * Returns: a #guint containing a hash for the @icon, suitable for use in a #GHashTable or similar data structure.
20848 * g_icon_new_for_string:
20849 * @str: A string obtained via g_icon_to_string().
20850 * @error: Return location for error.
20852 * Generate a #GIcon instance from @str. This function can fail if
20853 * @str is not valid - see g_icon_to_string() for discussion.
20855 * If your application or library provides one or more #GIcon
20856 * implementations you need to ensure that each #GType is registered
20857 * with the type system prior to calling g_icon_new_for_string().
20859 * Returns: (transfer full): An object implementing the #GIcon interface or %NULL if @error is set.
20865 * g_icon_to_string:
20868 * Generates a textual representation of @icon that can be used for
20869 * serialization such as when passing @icon to a different process or
20870 * saving it to persistent storage. Use g_icon_new_for_string() to
20871 * get @icon back from the returned string.
20873 * The encoding of the returned string is proprietary to #GIcon except
20874 * in the following two cases
20878 * If @icon is a #GFileIcon, the returned string is a native path
20879 * (such as <literal>/path/to/my icon.png</literal>) without escaping
20880 * if the #GFile for @icon is a native file. If the file is not
20881 * native, the returned string is the result of g_file_get_uri()
20882 * (such as <literal>sftp://path/to/my%20icon.png</literal>).
20883 * </para></listitem>
20885 * If @icon is a #GThemedIcon with exactly one name, the encoding is
20886 * simply the name (such as <literal>network-server</literal>).
20887 * </para></listitem>
20890 * Virtual: to_tokens
20891 * Returns: An allocated NUL-terminated UTF8 string or %NULL if @icon can't be serialized. Use g_free() to free.
20897 * g_inet_address_equal:
20898 * @address: A #GInetAddress.
20899 * @other_address: Another #GInetAddress.
20901 * Checks if two #GInetAddress instances are equal, e.g. the same address.
20903 * Returns: %TRUE if @address and @other_address are equal, %FALSE otherwise.
20909 * g_inet_address_get_family:
20910 * @address: a #GInetAddress
20912 * Gets @address's family
20914 * Returns: @address's family
20920 * g_inet_address_get_is_any:
20921 * @address: a #GInetAddress
20923 * Tests whether @address is the "any" address for its family.
20925 * Returns: %TRUE if @address is the "any" address for its family.
20931 * g_inet_address_get_is_link_local:
20932 * @address: a #GInetAddress
20934 * Tests whether @address is a link-local address (that is, if it
20935 * identifies a host on a local network that is not connected to the
20938 * Returns: %TRUE if @address is a link-local address.
20944 * g_inet_address_get_is_loopback:
20945 * @address: a #GInetAddress
20947 * Tests whether @address is the loopback address for its family.
20949 * Returns: %TRUE if @address is the loopback address for its family.
20955 * g_inet_address_get_is_mc_global:
20956 * @address: a #GInetAddress
20958 * Tests whether @address is a global multicast address.
20960 * Returns: %TRUE if @address is a global multicast address.
20966 * g_inet_address_get_is_mc_link_local:
20967 * @address: a #GInetAddress
20969 * Tests whether @address is a link-local multicast address.
20971 * Returns: %TRUE if @address is a link-local multicast address.
20977 * g_inet_address_get_is_mc_node_local:
20978 * @address: a #GInetAddress
20980 * Tests whether @address is a node-local multicast address.
20982 * Returns: %TRUE if @address is a node-local multicast address.
20988 * g_inet_address_get_is_mc_org_local:
20989 * @address: a #GInetAddress
20991 * Tests whether @address is an organization-local multicast address.
20993 * Returns: %TRUE if @address is an organization-local multicast address.
20999 * g_inet_address_get_is_mc_site_local:
21000 * @address: a #GInetAddress
21002 * Tests whether @address is a site-local multicast address.
21004 * Returns: %TRUE if @address is a site-local multicast address.
21010 * g_inet_address_get_is_multicast:
21011 * @address: a #GInetAddress
21013 * Tests whether @address is a multicast address.
21015 * Returns: %TRUE if @address is a multicast address.
21021 * g_inet_address_get_is_site_local:
21022 * @address: a #GInetAddress
21024 * Tests whether @address is a site-local address such as 10.0.0.1
21025 * (that is, the address identifies a host on a local network that can
21026 * not be reached directly from the Internet, but which may have
21027 * outgoing Internet connectivity via a NAT or firewall).
21029 * Returns: %TRUE if @address is a site-local address.
21035 * g_inet_address_get_native_size:
21036 * @address: a #GInetAddress
21038 * Gets the size of the native raw binary address for @address. This
21039 * is the size of the data that you get from g_inet_address_to_bytes().
21041 * Returns: the number of bytes used for the native version of @address.
21047 * g_inet_address_mask_equal:
21048 * @mask: a #GInetAddressMask
21049 * @mask2: another #GInetAddressMask
21051 * Tests if @mask and @mask2 are the same mask.
21053 * Returns: whether @mask and @mask2 are the same mask
21059 * g_inet_address_mask_get_address:
21060 * @mask: a #GInetAddressMask
21062 * Gets @mask's base address
21064 * Returns: (transfer none): @mask's base address
21070 * g_inet_address_mask_get_family:
21071 * @mask: a #GInetAddressMask
21073 * Gets the #GSocketFamily of @mask's address
21075 * Returns: the #GSocketFamily of @mask's address
21081 * g_inet_address_mask_get_length:
21082 * @mask: a #GInetAddressMask
21084 * Gets @mask's length
21086 * Returns: @mask's length
21092 * g_inet_address_mask_matches:
21093 * @mask: a #GInetAddressMask
21094 * @address: a #GInetAddress
21096 * Tests if @address falls within the range described by @mask.
21098 * Returns: whether @address falls within the range described by @mask.
21104 * g_inet_address_mask_new:
21105 * @addr: a #GInetAddress
21106 * @length: number of bits of @addr to use
21107 * @error: return location for #GError, or %NULL
21109 * Creates a new #GInetAddressMask representing all addresses whose
21110 * first @length bits match @addr.
21112 * Returns: a new #GInetAddressMask, or %NULL on error
21118 * g_inet_address_mask_new_from_string:
21119 * @mask_string: an IP address or address/length string
21120 * @error: return location for #GError, or %NULL
21122 * Parses @mask_string as an IP address and (optional) length, and
21123 * creates a new #GInetAddressMask. The length, if present, is
21124 * delimited by a "/". If it is not present, then the length is
21125 * assumed to be the full length of the address.
21127 * Returns: a new #GInetAddressMask corresponding to @string, or %NULL on error.
21133 * g_inet_address_mask_to_string:
21134 * @mask: a #GInetAddressMask
21136 * Converts @mask back to its corresponding string form.
21138 * Returns: a string corresponding to @mask.
21144 * g_inet_address_new_any:
21145 * @family: the address family
21147 * Creates a #GInetAddress for the "any" address (unassigned/"don't
21148 * care") for @family.
21150 * Returns: a new #GInetAddress corresponding to the "any" address for @family.
21156 * g_inet_address_new_from_bytes:
21157 * @bytes: (array) (element-type guint8): raw address data
21158 * @family: the address family of @bytes
21160 * Creates a new #GInetAddress from the given @family and @bytes.
21161 * @bytes should be 4 bytes for %G_SOCKET_FAMILY_IPV4 and 16 bytes for
21162 * %G_SOCKET_FAMILY_IPV6.
21164 * Returns: a new #GInetAddress corresponding to @family and @bytes.
21170 * g_inet_address_new_from_string:
21171 * @string: a string representation of an IP address
21173 * Parses @string as an IP address and creates a new #GInetAddress.
21175 * Returns: a new #GInetAddress corresponding to @string, or %NULL if @string could not be parsed.
21181 * g_inet_address_new_loopback:
21182 * @family: the address family
21184 * Creates a #GInetAddress for the loopback address for @family.
21186 * Returns: a new #GInetAddress corresponding to the loopback address for @family.
21192 * g_inet_address_to_bytes: (skip)
21193 * @address: a #GInetAddress
21195 * Gets the raw binary address data from @address.
21197 * 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().
21203 * g_inet_address_to_string:
21204 * @address: a #GInetAddress
21206 * Converts @address to string form.
21208 * Returns: a representation of @address as a string, which should be freed after use.
21214 * g_inet_socket_address_get_address:
21215 * @address: a #GInetSocketAddress
21217 * Gets @address's #GInetAddress.
21219 * Returns: (transfer none): the #GInetAddress for @address, which must be g_object_ref()'d if it will be stored
21225 * g_inet_socket_address_get_flowinfo:
21226 * @address: a %G_SOCKET_FAMILY_IPV6 #GInetSocketAddress
21228 * Gets the <literal>sin6_flowinfo</literal> field from @address,
21229 * which must be an IPv6 address.
21231 * Returns: the flowinfo field
21237 * g_inet_socket_address_get_port:
21238 * @address: a #GInetSocketAddress
21240 * Gets @address's port.
21242 * Returns: the port for @address
21248 * g_inet_socket_address_get_scope_id:
21249 * @address: a %G_SOCKET_FAMILY_IPV6 #GInetAddress
21251 * Gets the <literal>sin6_scope_id</literal> field from @address,
21252 * which must be an IPv6 address.
21254 * Returns: the scope id field
21260 * g_inet_socket_address_new:
21261 * @address: a #GInetAddress
21262 * @port: a port number
21264 * Creates a new #GInetSocketAddress for @address and @port.
21266 * Returns: a new #GInetSocketAddress
21273 * @initable: a #GInitable.
21274 * @cancellable: optional #GCancellable object, %NULL to ignore.
21275 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21277 * Initializes the object implementing the interface.
21279 * The object must be initialized before any real use after initial
21280 * construction, either with this function or g_async_initable_init_async().
21282 * Implementations may also support cancellation. If @cancellable is not %NULL,
21283 * then initialization can be cancelled by triggering the cancellable object
21284 * from another thread. If the operation was cancelled, the error
21285 * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL and
21286 * the object doesn't support cancellable initialization the error
21287 * %G_IO_ERROR_NOT_SUPPORTED will be returned.
21289 * If the object is not initialized, or initialization returns with an
21290 * error, then all operations on the object except g_object_ref() and
21291 * g_object_unref() are considered to be invalid, and have undefined
21292 * behaviour. See the <xref linkend="ginitable"/> section introduction
21293 * for more details.
21295 * Implementations of this method must be idempotent, i.e. multiple calls
21296 * to this function with the same argument should return the same results.
21297 * Only the first call initializes the object, further calls return the result
21298 * of the first call. This is so that it's safe to implement the singleton
21299 * pattern in the GObject constructor function.
21301 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
21308 * @object_type: a #GType supporting #GInitable.
21309 * @cancellable: optional #GCancellable object, %NULL to ignore.
21310 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21311 * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
21312 * @...: the value if the first property, followed by and other property value pairs, and ended by %NULL.
21314 * Helper function for constructing #GInitable object. This is
21315 * similar to g_object_new() but also initializes the object
21316 * and returns %NULL, setting an error on failure.
21318 * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21324 * g_initable_new_valist:
21325 * @object_type: a #GType supporting #GInitable.
21326 * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
21327 * @var_args: The var args list generated from @first_property_name.
21328 * @cancellable: optional #GCancellable object, %NULL to ignore.
21329 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21331 * Helper function for constructing #GInitable object. This is
21332 * similar to g_object_new_valist() but also initializes the object
21333 * and returns %NULL, setting an error on failure.
21335 * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21342 * @object_type: a #GType supporting #GInitable.
21343 * @n_parameters: the number of parameters in @parameters
21344 * @parameters: (array length=n_parameters): the parameters to use to construct the object
21345 * @cancellable: optional #GCancellable object, %NULL to ignore.
21346 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21348 * Helper function for constructing #GInitable object. This is
21349 * similar to g_object_newv() but also initializes the object
21350 * and returns %NULL, setting an error on failure.
21352 * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21358 * g_input_stream_clear_pending:
21359 * @stream: input stream
21361 * Clears the pending flag on @stream.
21366 * g_input_stream_close:
21367 * @stream: A #GInputStream.
21368 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21369 * @error: location to store the error occurring, or %NULL to ignore
21371 * Closes the stream, releasing resources related to it.
21373 * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
21374 * Closing a stream multiple times will not return an error.
21376 * Streams will be automatically closed when the last reference
21377 * is dropped, but you might want to call this function to make sure
21378 * resources are released as early as possible.
21380 * Some streams might keep the backing store of the stream (e.g. a file descriptor)
21381 * open after the stream is closed. See the documentation for the individual
21382 * stream for details.
21384 * On failure the first error that happened will be reported, but the close
21385 * operation will finish as much as possible. A stream that failed to
21386 * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
21387 * is important to check and report the error to the user.
21389 * If @cancellable is not %NULL, then the operation can be cancelled by
21390 * triggering the cancellable object from another thread. If the operation
21391 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21392 * Cancelling a close will still leave the stream closed, but some streams
21393 * can use a faster close that doesn't block to e.g. check errors.
21395 * Returns: %TRUE on success, %FALSE on failure
21400 * g_input_stream_close_async:
21401 * @stream: A #GInputStream.
21402 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21403 * @cancellable: (allow-none): optional cancellable object
21404 * @callback: (scope async): callback to call when the request is satisfied
21405 * @user_data: (closure): the data to pass to callback function
21407 * Requests an asynchronous closes of the stream, releasing resources related to it.
21408 * When the operation is finished @callback will be called.
21409 * You can then call g_input_stream_close_finish() to get the result of the
21412 * For behaviour details see g_input_stream_close().
21414 * The asyncronous methods have a default fallback that uses threads to implement
21415 * asynchronicity, so they are optional for inheriting classes. However, if you
21416 * override one you must override all.
21421 * g_input_stream_close_finish:
21422 * @stream: a #GInputStream.
21423 * @result: a #GAsyncResult.
21424 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21426 * Finishes closing a stream asynchronously, started from g_input_stream_close_async().
21428 * Returns: %TRUE if the stream was closed successfully.
21433 * g_input_stream_has_pending:
21434 * @stream: input stream.
21436 * Checks if an input stream has pending actions.
21438 * Returns: %TRUE if @stream has pending actions.
21443 * g_input_stream_is_closed:
21444 * @stream: input stream.
21446 * Checks if an input stream is closed.
21448 * Returns: %TRUE if the stream is closed.
21453 * g_input_stream_read:
21454 * @stream: a #GInputStream.
21455 * @buffer: a buffer to read data into (which should be at least count bytes long).
21456 * @count: the number of bytes that will be read from the stream
21457 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21458 * @error: location to store the error occurring, or %NULL to ignore
21460 * Tries to read @count bytes from the stream into the buffer starting at
21461 * @buffer. Will block during this read.
21463 * If count is zero returns zero and does nothing. A value of @count
21464 * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21466 * On success, the number of bytes read into the buffer is returned.
21467 * It is not an error if this is not the same as the requested size, as it
21468 * can happen e.g. near the end of a file. Zero is returned on end of file
21469 * (or if @count is zero), but never otherwise.
21471 * If @cancellable is not %NULL, then the operation can be cancelled by
21472 * triggering the cancellable object from another thread. If the operation
21473 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21474 * operation was partially finished when the operation was cancelled the
21475 * partial result will be returned, without an error.
21477 * On error -1 is returned and @error is set accordingly.
21479 * Returns: Number of bytes read, or -1 on error, or 0 on end of file.
21484 * g_input_stream_read_all:
21485 * @stream: a #GInputStream.
21486 * @buffer: a buffer to read data into (which should be at least count bytes long).
21487 * @count: the number of bytes that will be read from the stream
21488 * @bytes_read: (out): location to store the number of bytes that was read from the stream
21489 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21490 * @error: location to store the error occurring, or %NULL to ignore
21492 * Tries to read @count bytes from the stream into the buffer starting at
21493 * @buffer. Will block during this read.
21495 * This function is similar to g_input_stream_read(), except it tries to
21496 * read as many bytes as requested, only stopping on an error or end of stream.
21498 * On a successful read of @count bytes, or if we reached the end of the
21499 * stream, %TRUE is returned, and @bytes_read is set to the number of bytes
21500 * read into @buffer.
21502 * If there is an error during the operation %FALSE is returned and @error
21503 * is set to indicate the error status, @bytes_read is updated to contain
21504 * the number of bytes read into @buffer before the error occurred.
21506 * Returns: %TRUE on success, %FALSE if there was an error
21511 * g_input_stream_read_async:
21512 * @stream: A #GInputStream.
21513 * @buffer: a buffer to read data into (which should be at least count bytes long).
21514 * @count: the number of bytes that will be read from the stream
21515 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21516 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21517 * @callback: (scope async): callback to call when the request is satisfied
21518 * @user_data: (closure): the data to pass to callback function
21520 * Request an asynchronous read of @count bytes from the stream into the buffer
21521 * starting at @buffer. When the operation is finished @callback will be called.
21522 * You can then call g_input_stream_read_finish() to get the result of the
21525 * During an async request no other sync and async calls are allowed on @stream, and will
21526 * result in %G_IO_ERROR_PENDING errors.
21528 * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21530 * On success, the number of bytes read into the buffer will be passed to the
21531 * callback. It is not an error if this is not the same as the requested size, as it
21532 * can happen e.g. near the end of a file, but generally we try to read
21533 * as many bytes as requested. Zero is returned on end of file
21534 * (or if @count is zero), but never otherwise.
21536 * Any outstanding i/o request with higher priority (lower numerical value) will
21537 * be executed before an outstanding request with lower priority. Default
21538 * priority is %G_PRIORITY_DEFAULT.
21540 * The asyncronous methods have a default fallback that uses threads to implement
21541 * asynchronicity, so they are optional for inheriting classes. However, if you
21542 * override one you must override all.
21547 * g_input_stream_read_bytes:
21548 * @stream: a #GInputStream.
21549 * @count: maximum number of bytes that will be read from the stream. Common values include 4096 and 8192.
21550 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21551 * @error: location to store the error occurring, or %NULL to ignore
21553 * Like g_input_stream_read(), this tries to read @count bytes from
21554 * the stream in a blocking fashion. However, rather than reading into
21555 * a user-supplied buffer, this will create a new #GBytes containing
21556 * the data that was read. This may be easier to use from language
21559 * If count is zero, returns a zero-length #GBytes and does nothing. A
21560 * value of @count larger than %G_MAXSSIZE will cause a
21561 * %G_IO_ERROR_INVALID_ARGUMENT error.
21563 * On success, a new #GBytes is returned. It is not an error if the
21564 * size of this object is not the same as the requested size, as it
21565 * can happen e.g. near the end of a file. A zero-length #GBytes is
21566 * returned on end of file (or if @count is zero), but never
21569 * If @cancellable is not %NULL, then the operation can be cancelled by
21570 * triggering the cancellable object from another thread. If the operation
21571 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21572 * operation was partially finished when the operation was cancelled the
21573 * partial result will be returned, without an error.
21575 * On error %NULL is returned and @error is set accordingly.
21577 * Returns: a new #GBytes, or %NULL on error
21582 * g_input_stream_read_bytes_async:
21583 * @stream: A #GInputStream.
21584 * @count: the number of bytes that will be read from the stream
21585 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21586 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21587 * @callback: (scope async): callback to call when the request is satisfied
21588 * @user_data: (closure): the data to pass to callback function
21590 * Request an asynchronous read of @count bytes from the stream into a
21591 * new #GBytes. When the operation is finished @callback will be
21592 * called. You can then call g_input_stream_read_bytes_finish() to get the
21593 * result of the operation.
21595 * During an async request no other sync and async calls are allowed
21596 * on @stream, and will result in %G_IO_ERROR_PENDING errors.
21598 * A value of @count larger than %G_MAXSSIZE will cause a
21599 * %G_IO_ERROR_INVALID_ARGUMENT error.
21601 * On success, the new #GBytes will be passed to the callback. It is
21602 * not an error if this is smaller than the requested size, as it can
21603 * happen e.g. near the end of a file, but generally we try to read as
21604 * many bytes as requested. Zero is returned on end of file (or if
21605 * @count is zero), but never otherwise.
21607 * Any outstanding I/O request with higher priority (lower numerical
21608 * value) will be executed before an outstanding request with lower
21609 * priority. Default priority is %G_PRIORITY_DEFAULT.
21614 * g_input_stream_read_bytes_finish:
21615 * @stream: a #GInputStream.
21616 * @result: a #GAsyncResult.
21617 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21619 * Finishes an asynchronous stream read-into-#GBytes operation.
21621 * Returns: the newly-allocated #GBytes, or %NULL on error
21626 * g_input_stream_read_finish:
21627 * @stream: a #GInputStream.
21628 * @result: a #GAsyncResult.
21629 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21631 * Finishes an asynchronous stream read operation.
21633 * Returns: number of bytes read in, or -1 on error, or 0 on end of file.
21638 * g_input_stream_set_pending:
21639 * @stream: input stream
21640 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21642 * Sets @stream to have actions pending. If the pending flag is
21643 * already set or @stream is closed, it will return %FALSE and set
21646 * Returns: %TRUE if pending was previously unset and is now set.
21651 * g_input_stream_skip:
21652 * @stream: a #GInputStream.
21653 * @count: the number of bytes that will be skipped from the stream
21654 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21655 * @error: location to store the error occurring, or %NULL to ignore
21657 * Tries to skip @count bytes from the stream. Will block during the operation.
21659 * This is identical to g_input_stream_read(), from a behaviour standpoint,
21660 * but the bytes that are skipped are not returned to the user. Some
21661 * streams have an implementation that is more efficient than reading the data.
21663 * This function is optional for inherited classes, as the default implementation
21664 * emulates it using read.
21666 * If @cancellable is not %NULL, then the operation can be cancelled by
21667 * triggering the cancellable object from another thread. If the operation
21668 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21669 * operation was partially finished when the operation was cancelled the
21670 * partial result will be returned, without an error.
21672 * Returns: Number of bytes skipped, or -1 on error
21677 * g_input_stream_skip_async:
21678 * @stream: A #GInputStream.
21679 * @count: the number of bytes that will be skipped from the stream
21680 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21681 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21682 * @callback: (scope async): callback to call when the request is satisfied
21683 * @user_data: (closure): the data to pass to callback function
21685 * Request an asynchronous skip of @count bytes from the stream.
21686 * When the operation is finished @callback will be called.
21687 * You can then call g_input_stream_skip_finish() to get the result
21688 * of the operation.
21690 * During an async request no other sync and async calls are allowed,
21691 * and will result in %G_IO_ERROR_PENDING errors.
21693 * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21695 * On success, the number of bytes skipped will be passed to the callback.
21696 * It is not an error if this is not the same as the requested size, as it
21697 * can happen e.g. near the end of a file, but generally we try to skip
21698 * as many bytes as requested. Zero is returned on end of file
21699 * (or if @count is zero), but never otherwise.
21701 * Any outstanding i/o request with higher priority (lower numerical value)
21702 * will be executed before an outstanding request with lower priority.
21703 * Default priority is %G_PRIORITY_DEFAULT.
21705 * The asynchronous methods have a default fallback that uses threads to
21706 * implement asynchronicity, so they are optional for inheriting classes.
21707 * However, if you override one, you must override all.
21712 * g_input_stream_skip_finish:
21713 * @stream: a #GInputStream.
21714 * @result: a #GAsyncResult.
21715 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21717 * Finishes a stream skip operation.
21719 * Returns: the size of the bytes skipped, or %-1 on error.
21724 * g_io_error_from_errno:
21725 * @err_no: Error number as defined in errno.h.
21727 * Converts errno.h error codes into GIO error codes.
21729 * Returns: #GIOErrorEnum value for the given errno.h error number.
21734 * g_io_error_from_win32_error:
21735 * @error_code: Windows error number.
21737 * Converts some common error codes into GIO error codes. The
21738 * fallback value G_IO_ERROR_FAILED is returned for error codes not
21741 * Returns: #GIOErrorEnum value for the given error number.
21747 * g_io_error_quark:
21749 * Gets the GIO Error Quark.
21751 * Returns: a #GQuark.
21756 * g_io_extension_get_name:
21757 * @extension: a #GIOExtension
21759 * Gets the name under which @extension was registered.
21761 * Note that the same type may be registered as extension
21762 * for multiple extension points, under different names.
21764 * Returns: the name of @extension.
21769 * g_io_extension_get_priority:
21770 * @extension: a #GIOExtension
21772 * Gets the priority with which @extension was registered.
21774 * Returns: the priority of @extension
21779 * g_io_extension_get_type:
21780 * @extension: a #GIOExtension
21782 * Gets the type associated with @extension.
21784 * Returns: the type of @extension
21789 * g_io_extension_point_get_extension_by_name:
21790 * @extension_point: a #GIOExtensionPoint
21791 * @name: the name of the extension to get
21793 * Finds a #GIOExtension for an extension point by name.
21795 * Returns: (transfer none): the #GIOExtension for @extension_point that has the given name, or %NULL if there is no extension with that name
21800 * g_io_extension_point_get_extensions:
21801 * @extension_point: a #GIOExtensionPoint
21803 * Gets a list of all extensions that implement this extension point.
21804 * The list is sorted by priority, beginning with the highest priority.
21806 * Returns: (element-type GIOExtension) (transfer none): a #GList of #GIOExtension<!-- -->s. The list is owned by GIO and should not be modified.
21811 * g_io_extension_point_get_required_type:
21812 * @extension_point: a #GIOExtensionPoint
21814 * Gets the required type for @extension_point.
21816 * Returns: the #GType that all implementations must have, or #G_TYPE_INVALID if the extension point has no required type
21821 * g_io_extension_point_implement:
21822 * @extension_point_name: the name of the extension point
21823 * @type: the #GType to register as extension
21824 * @extension_name: the name for the extension
21825 * @priority: the priority for the extension
21827 * Registers @type as extension for the extension point with name
21828 * @extension_point_name.
21830 * If @type has already been registered as an extension for this
21831 * extension point, the existing #GIOExtension object is returned.
21833 * Returns: (transfer none): a #GIOExtension object for #GType
21838 * g_io_extension_point_lookup:
21839 * @name: the name of the extension point
21841 * Looks up an existing extension point.
21843 * Returns: (transfer none): the #GIOExtensionPoint, or %NULL if there is no registered extension point with the given name.
21848 * g_io_extension_point_register:
21849 * @name: The name of the extension point
21851 * Registers an extension point.
21853 * Returns: (transfer none): the new #GIOExtensionPoint. This object is owned by GIO and should not be freed.
21858 * g_io_extension_point_set_required_type:
21859 * @extension_point: a #GIOExtensionPoint
21860 * @type: the #GType to require
21862 * Sets the required type for @extension_point to @type.
21863 * All implementations must henceforth have this type.
21868 * g_io_extension_ref_class:
21869 * @extension: a #GIOExtension
21871 * Gets a reference to the class for the type that is
21872 * associated with @extension.
21874 * Returns: (transfer full): the #GTypeClass for the type of @extension
21880 * @filename: filename of the shared library module.
21882 * Creates a new GIOModule that will load the specific
21883 * shared library when in use.
21885 * Returns: a #GIOModule from given @filename, or %NULL on error.
21890 * g_io_module_scope_block:
21891 * @scope: a module loading scope
21892 * @basename: the basename to block
21894 * Block modules with the given @basename from being loaded when
21895 * this scope is used with g_io_modules_scan_all_in_directory_with_scope()
21896 * or g_io_modules_load_all_in_directory_with_scope().
21903 * g_io_module_scope_free:
21904 * @scope: a module loading scope
21906 * Free a module scope.
21913 * g_io_module_scope_new:
21914 * @flags: flags for the new scope
21916 * Create a new scope for loading of IO modules. A scope can be used for
21917 * blocking duplicate modules, or blocking a module you don't want to load.
21919 * Specify the %G_IO_MODULE_SCOPE_BLOCK_DUPLICATES flag to block modules
21920 * which have the same base name as a module that has already been seen
21923 * Returns: (transfer full): the new module scope
21929 * g_io_modules_load_all_in_directory:
21930 * @dirname: pathname for a directory containing modules to load.
21932 * Loads all the modules in the specified directory.
21934 * If don't require all modules to be initialized (and thus registering
21935 * all gtypes) then you can use g_io_modules_scan_all_in_directory()
21936 * which allows delayed/lazy loading of modules.
21938 * 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().
21943 * g_io_modules_load_all_in_directory_with_scope:
21944 * @dirname: pathname for a directory containing modules to load.
21945 * @scope: a scope to use when scanning the modules.
21947 * Loads all the modules in the specified directory.
21949 * If don't require all modules to be initialized (and thus registering
21950 * all gtypes) then you can use g_io_modules_scan_all_in_directory()
21951 * which allows delayed/lazy loading of modules.
21953 * 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().
21959 * g_io_modules_scan_all_in_directory:
21960 * @dirname: pathname for a directory containing modules to scan.
21962 * Scans all the modules in the specified directory, ensuring that
21963 * any extension point implemented by a module is registered.
21965 * This may not actually load and initialize all the types in each
21966 * module, some modules may be lazily loaded and initialized when
21967 * an extension point it implementes is used with e.g.
21968 * g_io_extension_point_get_extensions() or
21969 * g_io_extension_point_get_extension_by_name().
21971 * If you need to guarantee that all types are loaded in all the modules,
21972 * use g_io_modules_load_all_in_directory().
21979 * g_io_modules_scan_all_in_directory_with_scope:
21980 * @dirname: pathname for a directory containing modules to scan.
21981 * @scope: a scope to use when scanning the modules
21983 * Scans all the modules in the specified directory, ensuring that
21984 * any extension point implemented by a module is registered.
21986 * This may not actually load and initialize all the types in each
21987 * module, some modules may be lazily loaded and initialized when
21988 * an extension point it implementes is used with e.g.
21989 * g_io_extension_point_get_extensions() or
21990 * g_io_extension_point_get_extension_by_name().
21992 * If you need to guarantee that all types are loaded in all the modules,
21993 * use g_io_modules_load_all_in_directory().
22000 * g_io_scheduler_cancel_all_jobs:
22002 * Cancels all cancellable I/O jobs.
22004 * A job is cancellable if a #GCancellable was passed into
22005 * g_io_scheduler_push_job().
22010 * g_io_scheduler_job_send_to_mainloop:
22011 * @job: a #GIOSchedulerJob
22012 * @func: a #GSourceFunc callback that will be called in the original thread
22013 * @user_data: data to pass to @func
22014 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22016 * Used from an I/O job to send a callback to be run in the thread
22017 * that the job was started from, waiting for the result (and thus
22018 * blocking the I/O job).
22020 * Returns: The return value of @func
22025 * g_io_scheduler_job_send_to_mainloop_async:
22026 * @job: a #GIOSchedulerJob
22027 * @func: a #GSourceFunc callback that will be called in the original thread
22028 * @user_data: data to pass to @func
22029 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22031 * Used from an I/O job to send a callback to be run asynchronously in
22032 * the thread that the job was started from. The callback will be run
22033 * when the main loop is available, but at that time the I/O job might
22034 * have finished. The return value from the callback is ignored.
22036 * Note that if you are passing the @user_data from g_io_scheduler_push_job()
22037 * on to this function you have to ensure that it is not freed before
22038 * @func is called, either by passing %NULL as @notify to
22039 * g_io_scheduler_push_job() or by using refcounting for @user_data.
22044 * g_io_scheduler_push_job:
22045 * @job_func: a #GIOSchedulerJobFunc.
22046 * @user_data: data to pass to @job_func
22047 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22048 * @io_priority: the <link linkend="gioscheduler">I/O priority</link> of the request.
22049 * @cancellable: optional #GCancellable object, %NULL to ignore.
22051 * Schedules the I/O job to run in another thread.
22053 * @notify will be called on @user_data after @job_func has returned,
22054 * regardless whether the job was cancelled or has run to completion.
22056 * If @cancellable is not %NULL, it can be used to cancel the I/O job
22057 * by calling g_cancellable_cancel() or by calling
22058 * g_io_scheduler_cancel_all_jobs().
22063 * g_io_stream_clear_pending:
22064 * @stream: a #GIOStream
22066 * Clears the pending flag on @stream.
22073 * g_io_stream_close:
22074 * @stream: a #GIOStream
22075 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
22076 * @error: location to store the error occurring, or %NULL to ignore
22078 * Closes the stream, releasing resources related to it. This will also
22079 * closes the individual input and output streams, if they are not already
22082 * Once the stream is closed, all other operations will return
22083 * %G_IO_ERROR_CLOSED. Closing a stream multiple times will not
22086 * Closing a stream will automatically flush any outstanding buffers
22089 * Streams will be automatically closed when the last reference
22090 * is dropped, but you might want to call this function to make sure
22091 * resources are released as early as possible.
22093 * Some streams might keep the backing store of the stream (e.g. a file
22094 * descriptor) open after the stream is closed. See the documentation for
22095 * the individual stream for details.
22097 * On failure the first error that happened will be reported, but the
22098 * close operation will finish as much as possible. A stream that failed
22099 * to close will still return %G_IO_ERROR_CLOSED for all operations.
22100 * Still, it is important to check and report the error to the user,
22101 * otherwise there might be a loss of data as all data might not be written.
22103 * If @cancellable is not NULL, then the operation can be cancelled by
22104 * triggering the cancellable object from another thread. If the operation
22105 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
22106 * Cancelling a close will still leave the stream closed, but some streams
22107 * can use a faster close that doesn't block to e.g. check errors.
22109 * The default implementation of this method just calls close on the
22110 * individual input/output streams.
22112 * Returns: %TRUE on success, %FALSE on failure
22118 * g_io_stream_close_async:
22119 * @stream: a #GIOStream
22120 * @io_priority: the io priority of the request
22121 * @cancellable: (allow-none): optional cancellable object
22122 * @callback: (scope async): callback to call when the request is satisfied
22123 * @user_data: (closure): the data to pass to callback function
22125 * Requests an asynchronous close of the stream, releasing resources
22126 * related to it. When the operation is finished @callback will be
22127 * called. You can then call g_io_stream_close_finish() to get
22128 * the result of the operation.
22130 * For behaviour details see g_io_stream_close().
22132 * The asynchronous methods have a default fallback that uses threads
22133 * to implement asynchronicity, so they are optional for inheriting
22134 * classes. However, if you override one you must override all.
22141 * g_io_stream_close_finish:
22142 * @stream: a #GIOStream
22143 * @result: a #GAsyncResult
22144 * @error: a #GError location to store the error occurring, or %NULL to ignore
22148 * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
22154 * g_io_stream_get_input_stream:
22155 * @stream: a #GIOStream
22157 * Gets the input stream for this object. This is used
22160 * Returns: (transfer none): a #GInputStream, owned by the #GIOStream. Do not free.
22166 * g_io_stream_get_output_stream:
22167 * @stream: a #GIOStream
22169 * Gets the output stream for this object. This is used for
22172 * Returns: (transfer none): a #GOutputStream, owned by the #GIOStream. Do not free.
22178 * g_io_stream_has_pending:
22179 * @stream: a #GIOStream
22181 * Checks if a stream has pending actions.
22183 * Returns: %TRUE if @stream has pending actions.
22189 * g_io_stream_is_closed:
22190 * @stream: a #GIOStream
22192 * Checks if a stream is closed.
22194 * Returns: %TRUE if the stream is closed.
22200 * g_io_stream_set_pending:
22201 * @stream: a #GIOStream
22202 * @error: a #GError location to store the error occurring, or %NULL to ignore
22204 * Sets @stream to have actions pending. If the pending flag is
22205 * already set or @stream is closed, it will return %FALSE and set
22208 * Returns: %TRUE if pending was previously unset and is now set.
22214 * g_io_stream_splice_async:
22215 * @stream1: a #GIOStream.
22216 * @stream2: a #GIOStream.
22217 * @flags: a set of #GIOStreamSpliceFlags.
22218 * @io_priority: the io priority of the request.
22219 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22220 * @callback: (scope async): a #GAsyncReadyCallback.
22221 * @user_data: (closure): user data passed to @callback.
22223 * Asyncronously splice the output stream of @stream1 to the input stream of
22224 * @stream2, and splice the output stream of @stream2 to the input stream of
22227 * When the operation is finished @callback will be called.
22228 * You can then call g_io_stream_splice_finish() to get the
22229 * result of the operation.
22236 * g_io_stream_splice_finish:
22237 * @result: a #GAsyncResult.
22238 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22240 * Finishes an asynchronous io stream splice operation.
22242 * Returns: %TRUE on success, %FALSE otherwise.
22248 * g_keyfile_settings_backend_new:
22249 * @filename: the filename of the keyfile
22250 * @root_path: the path under which all settings keys appear
22251 * @root_group: (allow-none): the group name corresponding to @root_path, or %NULL
22253 * Creates a keyfile-backed #GSettingsBackend.
22255 * The filename of the keyfile to use is given by @filename.
22257 * All settings read to or written from the backend must fall under the
22258 * path given in @root_path (which must start and end with a slash and
22259 * not contain two consecutive slashes). @root_path may be "/".
22261 * If @root_group is non-%NULL then it specifies the name of the keyfile
22262 * group used for keys that are written directly below @root_path. For
22263 * example, if @root_path is "/apps/example/" and @root_group is
22264 * "toplevel", then settings the key "/apps/example/enabled" to a value
22265 * of %TRUE will cause the following to appear in the keyfile:
22272 * If @root_group is %NULL then it is not permitted to store keys
22273 * directly below the @root_path.
22275 * For keys not stored directly below @root_path (ie: in a sub-path),
22276 * the name of the subpath (with the final slash stripped) is used as
22277 * the name of the keyfile group. To continue the example, if
22278 * "/apps/example/profiles/default/font-size" were set to
22279 * 12 then the following would appear in the keyfile:
22282 * [profiles/default]
22286 * The backend will refuse writes (and return writability as being
22287 * %FALSE) for keys outside of @root_path and, in the event that
22288 * @root_group is %NULL, also for keys directly under @root_path.
22289 * Writes will also be refused if the backend detects that it has the
22290 * inability to rewrite the keyfile (ie: the containing directory is not
22293 * There is no checking done for your key namespace clashing with the
22294 * syntax of the key file format. For example, if you have '[' or ']'
22295 * characters in your path names or '=' in your key names you may be in
22298 * Returns: (transfer full): a keyfile-backed #GSettingsBackend
22303 * g_loadable_icon_load:
22304 * @icon: a #GLoadableIcon.
22305 * @size: an integer.
22306 * @type: (out) (allow-none): a location to store the type of the loaded icon, %NULL to ignore.
22307 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22308 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22310 * Loads a loadable icon. For the asynchronous version of this function,
22311 * see g_loadable_icon_load_async().
22313 * Returns: (transfer full): a #GInputStream to read the icon from.
22318 * g_loadable_icon_load_async:
22319 * @icon: a #GLoadableIcon.
22320 * @size: an integer.
22321 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22322 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
22323 * @user_data: (closure): the data to pass to callback function
22325 * Loads an icon asynchronously. To finish this function, see
22326 * g_loadable_icon_load_finish(). For the synchronous, blocking
22327 * version of this function, see g_loadable_icon_load().
22332 * g_loadable_icon_load_finish:
22333 * @icon: a #GLoadableIcon.
22334 * @res: a #GAsyncResult.
22335 * @type: a location to store the type of the loaded icon, %NULL to ignore.
22336 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22338 * Finishes an asynchronous icon load started in g_loadable_icon_load_async().
22340 * Returns: (transfer full): a #GInputStream to read the icon from.
22347 * Returns a new #GVfs handle for a local vfs.
22349 * Returns: a new #GVfs handle.
22354 * g_memory_input_stream_add_bytes:
22355 * @stream: a #GMemoryInputStream
22356 * @bytes: input data
22358 * Appends @bytes to data that can be read from the input stream.
22365 * g_memory_input_stream_add_data:
22366 * @stream: a #GMemoryInputStream
22367 * @data: (array length=len) (element-type guint8) (transfer full): input data
22368 * @len: length of the data, may be -1 if @data is a nul-terminated string
22369 * @destroy: (allow-none): function that is called to free @data, or %NULL
22371 * Appends @data to data that can be read from the input stream
22376 * g_memory_input_stream_new:
22378 * Creates a new empty #GMemoryInputStream.
22380 * Returns: a new #GInputStream
22385 * g_memory_input_stream_new_from_bytes:
22386 * @bytes: a #GBytes
22388 * Creates a new #GMemoryInputStream with data from the given @bytes.
22390 * Returns: new #GInputStream read from @bytes
22396 * g_memory_input_stream_new_from_data:
22397 * @data: (array length=len) (element-type guint8) (transfer full): input data
22398 * @len: length of the data, may be -1 if @data is a nul-terminated string
22399 * @destroy: (allow-none): function that is called to free @data, or %NULL
22401 * Creates a new #GMemoryInputStream with data in memory of a given size.
22403 * Returns: new #GInputStream read from @data of @len bytes.
22408 * g_memory_output_stream_get_data:
22409 * @ostream: a #GMemoryOutputStream
22411 * Gets any loaded data from the @ostream.
22413 * Note that the returned pointer may become invalid on the next
22414 * write or truncate operation on the stream.
22416 * Returns: (transfer none): pointer to the stream's data
22421 * g_memory_output_stream_get_data_size:
22422 * @ostream: a #GMemoryOutputStream
22424 * Returns the number of bytes from the start up
22425 * to including the last byte written in the stream
22426 * that has not been truncated away.
22428 * Returns: the number of bytes written to the stream
22434 * g_memory_output_stream_get_size:
22435 * @ostream: a #GMemoryOutputStream
22437 * Gets the size of the currently allocated data area (available from
22438 * g_memory_output_stream_get_data()). If the stream isn't
22439 * growable (no realloc was passed to g_memory_output_stream_new()) then
22440 * this is the maximum size of the stream and further writes
22441 * will return %G_IO_ERROR_NO_SPACE.
22443 * Note that for growable streams the returned size may become invalid on
22444 * the next write or truncate operation on the stream.
22446 * If you want the number of bytes currently written to the stream, use
22447 * g_memory_output_stream_get_data_size().
22449 * Returns: the number of bytes allocated for the data buffer
22454 * g_memory_output_stream_new: (skip)
22455 * @data: (allow-none): pointer to a chunk of memory to use, or %NULL
22456 * @size: the size of @data
22457 * @realloc_function: (allow-none): a function with realloc() semantics (like g_realloc()) to be called when @data needs to be grown, or %NULL
22458 * @destroy_function: (allow-none): a function to be called on @data when the stream is finalized, or %NULL
22460 * Creates a new #GMemoryOutputStream.
22462 * If @data is non-%NULL, the stream will use that for its internal storage.
22463 * If @realloc_fn is non-%NULL, it will be used for resizing the internal
22464 * storage when necessary. To construct a fixed-size output stream,
22465 * pass %NULL as @realloc_fn.
22468 * /* a stream that can grow */
22469 * stream = g_memory_output_stream_new (NULL, 0, realloc, free);
22471 * /* another stream that can grow */
22472 * stream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
22474 * /* a fixed-size stream */
22475 * data = malloc (200);
22476 * stream3 = g_memory_output_stream_new (data, 200, NULL, free);
22479 * Returns: A newly created #GMemoryOutputStream object.
22484 * g_memory_output_stream_steal_as_bytes:
22485 * @ostream: a #GMemoryOutputStream
22487 * Returns data from the @ostream as a #GBytes. @ostream must be
22488 * closed before calling this function.
22490 * Returns: (transfer full): the stream's data
22496 * g_memory_output_stream_steal_data:
22497 * @ostream: a #GMemoryOutputStream
22499 * Gets any loaded data from the @ostream. Ownership of the data
22500 * is transferred to the caller; when no longer needed it must be
22501 * freed using the free function set in @ostream's
22502 * #GMemoryOutputStream:destroy-function property.
22504 * @ostream must be closed before calling this function.
22506 * Returns: (transfer full): the stream's data
22512 * g_memory_settings_backend_new:
22514 * Creates a memory-backed #GSettingsBackend.
22516 * This backend allows changes to settings, but does not write them
22517 * to any backing storage, so the next time you run your application,
22518 * the memory backend will start out with the default values again.
22520 * Returns: (transfer full): a newly created #GSettingsBackend
22528 * @label: (allow-none): the section label, or %NULL
22529 * @detailed_action: (allow-none): the detailed action string, or %NULL
22531 * Convenience function for appending a normal menu item to the end of
22532 * @menu. Combine g_menu_item_new() and g_menu_insert_item() for a more
22533 * flexible alternative.
22540 * g_menu_append_item:
22542 * @item: a #GMenuItem to append
22544 * Appends @item to the end of @menu.
22546 * See g_menu_insert_item() for more information.
22553 * g_menu_append_section:
22555 * @label: (allow-none): the section label, or %NULL
22556 * @section: a #GMenuModel with the items of the section
22558 * Convenience function for appending a section menu item to the end of
22559 * @menu. Combine g_menu_item_new_section() and g_menu_insert_item() for a
22560 * more flexible alternative.
22567 * g_menu_append_submenu:
22569 * @label: (allow-none): the section label, or %NULL
22570 * @submenu: a #GMenuModel with the items of the submenu
22572 * Convenience function for appending a submenu menu item to the end of
22573 * @menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for a
22574 * more flexible alternative.
22581 * g_menu_attribute_iter_get_name:
22582 * @iter: a #GMenuAttributeIter
22584 * Gets the name of the attribute at the current iterator position, as
22587 * The iterator is not advanced.
22589 * Returns: the name of the attribute
22595 * g_menu_attribute_iter_get_next:
22596 * @iter: a #GMenuAttributeIter
22597 * @out_name: (out) (allow-none) (transfer none): the type of the attribute
22598 * @value: (out) (allow-none) (transfer full): the attribute value
22600 * This function combines g_menu_attribute_iter_next() with
22601 * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value().
22603 * First the iterator is advanced to the next (possibly first) attribute.
22604 * If that fails, then %FALSE is returned and there are no other
22607 * If successful, @name and @value are set to the name and value of the
22608 * attribute that has just been advanced to. At this point,
22609 * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value() will
22610 * return the same values again.
22612 * The value returned in @name remains valid for as long as the iterator
22613 * remains at the current position. The value returned in @value must
22614 * be unreffed using g_variant_unref() when it is no longer in use.
22616 * Returns: %TRUE on success, or %FALSE if there is no additional attribute
22622 * g_menu_attribute_iter_get_value:
22623 * @iter: a #GMenuAttributeIter
22625 * Gets the value of the attribute at the current iterator position.
22627 * The iterator is not advanced.
22629 * Returns: (transfer full): the value of the current attribute
22635 * g_menu_attribute_iter_next:
22636 * @iter: a #GMenuAttributeIter
22638 * Attempts to advance the iterator to the next (possibly first)
22641 * %TRUE is returned on success, or %FALSE if there are no more
22644 * You must call this function when you first acquire the iterator
22645 * to advance it to the first attribute (and determine if the first
22646 * attribute exists at all).
22648 * Returns: %TRUE on success, or %FALSE when there are no more attributes
22657 * Marks @menu as frozen.
22659 * After the menu is frozen, it is an error to attempt to make any
22660 * changes to it. In effect this means that the #GMenu API must no
22663 * This function causes g_menu_model_is_mutable() to begin returning
22664 * %FALSE, which has some positive performance implications.
22673 * @position: the position at which to insert the item
22674 * @label: (allow-none): the section label, or %NULL
22675 * @detailed_action: (allow-none): the detailed action string, or %NULL
22677 * Convenience function for inserting a normal menu item into @menu.
22678 * Combine g_menu_item_new() and g_menu_insert_item() for a more flexible
22686 * g_menu_insert_item:
22688 * @position: the position at which to insert the item
22689 * @item: the #GMenuItem to insert
22691 * Inserts @item into @menu.
22693 * The "insertion" is actually done by copying all of the attribute and
22694 * link values of @item and using them to form a new item within @menu.
22695 * As such, @item itself is not really inserted, but rather, a menu item
22696 * that is exactly the same as the one presently described by @item.
22698 * This means that @item is essentially useless after the insertion
22699 * occurs. Any changes you make to it are ignored unless it is inserted
22700 * again (at which point its updated values will be copied).
22702 * You should probably just free @item once you're done.
22704 * There are many convenience functions to take care of common cases.
22705 * See g_menu_insert(), g_menu_insert_section() and
22706 * g_menu_insert_submenu() as well as "prepend" and "append" variants of
22707 * each of these functions.
22714 * g_menu_insert_section:
22716 * @position: the position at which to insert the item
22717 * @label: (allow-none): the section label, or %NULL
22718 * @section: a #GMenuModel with the items of the section
22720 * Convenience function for inserting a section menu item into @menu.
22721 * Combine g_menu_item_new_section() and g_menu_insert_item() for a more
22722 * flexible alternative.
22729 * g_menu_insert_submenu:
22731 * @position: the position at which to insert the item
22732 * @label: (allow-none): the section label, or %NULL
22733 * @submenu: a #GMenuModel with the items of the submenu
22735 * Convenience function for inserting a submenu menu item into @menu.
22736 * Combine g_menu_item_new_submenu() and g_menu_insert_item() for a more
22737 * flexible alternative.
22744 * g_menu_item_get_attribute:
22745 * @menu_item: a #GMenuItem
22746 * @attribute: the attribute name to query
22747 * @format_string: a #GVariant format string
22748 * @...: positional parameters, as per @format_string
22750 * Queries the named @attribute on @menu_item.
22752 * If the attribute exists and matches the #GVariantType corresponding
22753 * to @format_string then @format_string is used to deconstruct the
22754 * value into the positional parameters and %TRUE is returned.
22756 * If the attribute does not exist, or it does exist but has the wrong
22757 * type, then the positional parameters are ignored and %FALSE is
22760 * Returns: %TRUE if the named attribute was found with the expected type
22766 * g_menu_item_get_attribute_value:
22767 * @menu_item: a #GMenuItem
22768 * @attribute: the attribute name to query
22769 * @expected_type: (allow-none): the expected type of the attribute
22771 * Queries the named @attribute on @menu_item.
22773 * If @expected_type is specified and the attribute does not have this
22774 * type, %NULL is returned. %NULL is also returned if the attribute
22775 * simply does not exist.
22777 * Returns: (transfer full): the attribute value, or %NULL
22783 * g_menu_item_get_link:
22784 * @menu_item: a #GMenuItem
22785 * @link: the link name to query
22787 * Queries the named @link on @menu_item.
22789 * Returns: (transfer full): the link, or %NULL
22796 * @label: (allow-none): the section label, or %NULL
22797 * @detailed_action: (allow-none): the detailed action string, or %NULL
22799 * Creates a new #GMenuItem.
22801 * If @label is non-%NULL it is used to set the "label" attribute of the
22804 * If @detailed_action is non-%NULL it is used to set the "action" and
22805 * possibly the "target" attribute of the new item. See
22806 * g_menu_item_set_detailed_action() for more information.
22808 * Returns: a new #GMenuItem
22814 * g_menu_item_new_from_model:
22815 * @model: a #GMenuModel
22816 * @item_index: the index of an item in @model
22818 * Creates a #GMenuItem as an exact copy of an existing menu item in a
22821 * @item_index must be valid (ie: be sure to call
22822 * g_menu_model_get_n_items() first).
22824 * Returns: a new #GMenuItem.
22830 * g_menu_item_new_section:
22831 * @label: (allow-none): the section label, or %NULL
22832 * @section: a #GMenuModel with the items of the section
22834 * Creates a new #GMenuItem representing a section.
22836 * This is a convenience API around g_menu_item_new() and
22837 * g_menu_item_set_section().
22839 * The effect of having one menu appear as a section of another is
22840 * exactly as it sounds: the items from @section become a direct part of
22841 * the menu that @menu_item is added to.
22843 * Visual separation is typically displayed between two non-empty
22844 * sections. If @label is non-%NULL then it will be encorporated into
22845 * this visual indication. This allows for labeled subsections of a
22848 * As a simple example, consider a typical "Edit" menu from a simple
22849 * program. It probably contains an "Undo" and "Redo" item, followed by
22850 * a separator, followed by "Cut", "Copy" and "Paste".
22852 * This would be accomplished by creating three #GMenu instances. The
22853 * first would be populated with the "Undo" and "Redo" items, and the
22854 * second with the "Cut", "Copy" and "Paste" items. The first and
22855 * second menus would then be added as submenus of the third. In XML
22856 * format, this would look something like the following:
22858 * <informalexample><programlisting><![CDATA[
22859 * <menu id='edit-menu'>
22861 * <item label='Undo'/>
22862 * <item label='Redo'/>
22865 * <item label='Cut'/>
22866 * <item label='Copy'/>
22867 * <item label='Paste'/>
22870 * ]]></programlisting></informalexample>
22872 * The following example is exactly equivalent. It is more illustrative
22873 * of the exact relationship between the menus and items (keeping in
22874 * mind that the 'link' element defines a new menu that is linked to the
22875 * containing one). The style of the second example is more verbose and
22876 * difficult to read (and therefore not recommended except for the
22877 * purpose of understanding what is really going on).
22879 * <informalexample><programlisting><![CDATA[
22880 * <menu id='edit-menu'>
22882 * <link name='section'>
22883 * <item label='Undo'/>
22884 * <item label='Redo'/>
22888 * <link name='section'>
22889 * <item label='Cut'/>
22890 * <item label='Copy'/>
22891 * <item label='Paste'/>
22895 * ]]></programlisting></informalexample>
22897 * Returns: a new #GMenuItem
22903 * g_menu_item_new_submenu:
22904 * @label: (allow-none): the section label, or %NULL
22905 * @submenu: a #GMenuModel with the items of the submenu
22907 * Creates a new #GMenuItem representing a submenu.
22909 * This is a convenience API around g_menu_item_new() and
22910 * g_menu_item_set_submenu().
22912 * Returns: a new #GMenuItem
22918 * g_menu_item_set_action_and_target:
22919 * @menu_item: a #GMenuItem
22920 * @action: (allow-none): the name of the action for this item
22921 * @format_string: (allow-none): a GVariant format string
22922 * @...: positional parameters, as per @format_string
22924 * Sets or unsets the "action" and "target" attributes of @menu_item.
22926 * If @action is %NULL then both the "action" and "target" attributes
22927 * are unset (and @format_string is ignored along with the positional
22930 * If @action is non-%NULL then the "action" attribute is set.
22931 * @format_string is then inspected. If it is non-%NULL then the proper
22932 * position parameters are collected to create a #GVariant instance to
22933 * use as the target value. If it is %NULL then the positional
22934 * parameters are ignored and the "target" attribute is unset.
22936 * See also g_menu_item_set_action_and_target_value() for an equivalent
22937 * call that directly accepts a #GVariant. See
22938 * g_menu_item_set_detailed_action() for a more convenient version that
22939 * works with string-typed targets.
22941 * See also g_menu_item_set_action_and_target_value() for a
22942 * description of the semantics of the action and target attributes.
22949 * g_menu_item_set_action_and_target_value:
22950 * @menu_item: a #GMenuItem
22951 * @action: (allow-none): the name of the action for this item
22952 * @target_value: (allow-none): a #GVariant to use as the action target
22954 * Sets or unsets the "action" and "target" attributes of @menu_item.
22956 * If @action is %NULL then both the "action" and "target" attributes
22957 * are unset (and @target_value is ignored).
22959 * If @action is non-%NULL then the "action" attribute is set. The
22960 * "target" attribute is then set to the value of @target_value if it is
22961 * non-%NULL or unset otherwise.
22963 * Normal menu items (ie: not submenu, section or other custom item
22964 * types) are expected to have the "action" attribute set to identify
22965 * the action that they are associated with. The state type of the
22966 * action help to determine the disposition of the menu item. See
22967 * #GAction and #GActionGroup for an overview of actions.
22969 * In general, clicking on the menu item will result in activation of
22970 * the named action with the "target" attribute given as the parameter
22971 * to the action invocation. If the "target" attribute is not set then
22972 * the action is invoked with no parameter.
22974 * If the action has no state then the menu item is usually drawn as a
22975 * plain menu item (ie: with no additional decoration).
22977 * If the action has a boolean state then the menu item is usually drawn
22978 * as a toggle menu item (ie: with a checkmark or equivalent
22979 * indication). The item should be marked as 'toggled' or 'checked'
22980 * when the boolean state is %TRUE.
22982 * If the action has a string state then the menu item is usually drawn
22983 * as a radio menu item (ie: with a radio bullet or equivalent
22984 * indication). The item should be marked as 'selected' when the string
22985 * state is equal to the value of the @target property.
22987 * See g_menu_item_set_action_and_target() or
22988 * g_menu_item_set_detailed_action() for two equivalent calls that are
22989 * probably more convenient for most uses.
22996 * g_menu_item_set_attribute:
22997 * @menu_item: a #GMenuItem
22998 * @attribute: the attribute to set
22999 * @format_string: (allow-none): a #GVariant format string, or %NULL
23000 * @...: positional parameters, as per @format_string
23002 * Sets or unsets an attribute on @menu_item.
23004 * The attribute to set or unset is specified by @attribute. This
23005 * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
23006 * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
23008 * Attribute names are restricted to lowercase characters, numbers
23009 * and '-'. Furthermore, the names must begin with a lowercase character,
23010 * must not end with a '-', and must not contain consecutive dashes.
23012 * If @format_string is non-%NULL then the proper position parameters
23013 * are collected to create a #GVariant instance to use as the attribute
23014 * value. If it is %NULL then the positional parameterrs are ignored
23015 * and the named attribute is unset.
23017 * See also g_menu_item_set_attribute_value() for an equivalent call
23018 * that directly accepts a #GVariant.
23025 * g_menu_item_set_attribute_value:
23026 * @menu_item: a #GMenuItem
23027 * @attribute: the attribute to set
23028 * @value: (allow-none): a #GVariant to use as the value, or %NULL
23030 * Sets or unsets an attribute on @menu_item.
23032 * The attribute to set or unset is specified by @attribute. This
23033 * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
23034 * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
23036 * Attribute names are restricted to lowercase characters, numbers
23037 * and '-'. Furthermore, the names must begin with a lowercase character,
23038 * must not end with a '-', and must not contain consecutive dashes.
23040 * must consist only of lowercase
23041 * ASCII characters, digits and '-'.
23043 * If @value is non-%NULL then it is used as the new value for the
23044 * attribute. If @value is %NULL then the attribute is unset. If
23045 * the @value #GVariant is floating, it is consumed.
23047 * See also g_menu_item_set_attribute() for a more convenient way to do
23055 * g_menu_item_set_detailed_action:
23056 * @menu_item: a #GMenuItem
23057 * @detailed_action: the "detailed" action string
23059 * Sets the "action" and possibly the "target" attribute of @menu_item.
23061 * If @detailed_action contains a double colon ("::") then it is used as
23062 * a separator between an action name and a target string. In this
23063 * case, this call is equivalent to calling
23064 * g_menu_item_set_action_and_target() with the part before the "::" and
23065 * with a string-type #GVariant containing the part following the "::".
23067 * If @detailed_action doesn't contain "::" then the action is set to
23068 * the given string (verbatim) and the target value is unset.
23070 * See g_menu_item_set_action_and_target() or
23071 * g_menu_item_set_action_and_target_value() for more flexible (but
23072 * slightly less convenient) alternatives.
23074 * See also g_menu_item_set_action_and_target_value() for a description of
23075 * the semantics of the action and target attributes.
23082 * g_menu_item_set_label:
23083 * @menu_item: a #GMenuItem
23084 * @label: (allow-none): the label to set, or %NULL to unset
23086 * Sets or unsets the "label" attribute of @menu_item.
23088 * If @label is non-%NULL it is used as the label for the menu item. If
23089 * it is %NULL then the label attribute is unset.
23096 * g_menu_item_set_link:
23097 * @menu_item: a #GMenuItem
23098 * @link: type of link to establish or unset
23099 * @model: (allow-none): the #GMenuModel to link to (or %NULL to unset)
23101 * Creates a link from @menu_item to @model if non-%NULL, or unsets it.
23103 * Links are used to establish a relationship between a particular menu
23104 * item and another menu. For example, %G_MENU_LINK_SUBMENU is used to
23105 * associate a submenu with a particular menu item, and %G_MENU_LINK_SECTION
23106 * is used to create a section. Other types of link can be used, but there
23107 * is no guarantee that clients will be able to make sense of them.
23108 * Link types are restricted to lowercase characters, numbers
23109 * and '-'. Furthermore, the names must begin with a lowercase character,
23110 * must not end with a '-', and must not contain consecutive dashes.
23117 * g_menu_item_set_section:
23118 * @menu_item: a #GMenuItem
23119 * @section: (allow-none): a #GMenuModel, or %NULL
23121 * Sets or unsets the "section" link of @menu_item to @section.
23123 * The effect of having one menu appear as a section of another is
23124 * exactly as it sounds: the items from @section become a direct part of
23125 * the menu that @menu_item is added to. See g_menu_item_new_section()
23126 * for more information about what it means for a menu item to be a
23134 * g_menu_item_set_submenu:
23135 * @menu_item: a #GMenuItem
23136 * @submenu: (allow-none): a #GMenuModel, or %NULL
23138 * Sets or unsets the "submenu" link of @menu_item to @submenu.
23140 * If @submenu is non-%NULL, it is linked to. If it is %NULL then the
23143 * The effect of having one menu appear as a submenu of another is
23144 * exactly as it sounds.
23151 * g_menu_link_iter_get_name:
23152 * @iter: a #GMenuLinkIter
23154 * Gets the name of the link at the current iterator position.
23156 * The iterator is not advanced.
23158 * Returns: the type of the link
23164 * g_menu_link_iter_get_next:
23165 * @iter: a #GMenuLinkIter
23166 * @out_link: (out) (allow-none) (transfer none): the name of the link
23167 * @value: (out) (allow-none) (transfer full): the linked #GMenuModel
23169 * This function combines g_menu_link_iter_next() with
23170 * g_menu_link_iter_get_name() and g_menu_link_iter_get_value().
23172 * First the iterator is advanced to the next (possibly first) link.
23173 * If that fails, then %FALSE is returned and there are no other effects.
23175 * If successful, @out_link and @value are set to the name and #GMenuModel
23176 * of the link that has just been advanced to. At this point,
23177 * g_menu_link_iter_get_name() and g_menu_link_iter_get_value() will return the
23178 * same values again.
23180 * The value returned in @out_link remains valid for as long as the iterator
23181 * remains at the current position. The value returned in @value must
23182 * be unreffed using g_object_unref() when it is no longer in use.
23184 * Returns: %TRUE on success, or %FALSE if there is no additional link
23190 * g_menu_link_iter_get_value:
23191 * @iter: a #GMenuLinkIter
23193 * Gets the linked #GMenuModel at the current iterator position.
23195 * The iterator is not advanced.
23197 * Returns: (transfer full): the #GMenuModel that is linked to
23203 * g_menu_link_iter_next:
23204 * @iter: a #GMenuLinkIter
23206 * Attempts to advance the iterator to the next (possibly first)
23209 * %TRUE is returned on success, or %FALSE if there are no more links.
23211 * You must call this function when you first acquire the iterator to
23212 * advance it to the first link (and determine if the first link exists
23215 * Returns: %TRUE on success, or %FALSE when there are no more links
23221 * g_menu_model_get_item_attribute:
23222 * @model: a #GMenuModel
23223 * @item_index: the index of the item
23224 * @attribute: the attribute to query
23225 * @format_string: a #GVariant format string
23226 * @...: positional parameters, as per @format_string
23228 * Queries item at position @item_index in @model for the attribute
23229 * specified by @attribute.
23231 * If the attribute exists and matches the #GVariantType corresponding
23232 * to @format_string then @format_string is used to deconstruct the
23233 * value into the positional parameters and %TRUE is returned.
23235 * If the attribute does not exist, or it does exist but has the wrong
23236 * type, then the positional parameters are ignored and %FALSE is
23239 * This function is a mix of g_menu_model_get_item_attribute_value() and
23240 * g_variant_get(), followed by a g_variant_unref(). As such,
23241 * @format_string must make a complete copy of the data (since the
23242 * #GVariant may go away after the call to g_variant_unref()). In
23243 * particular, no '&' characters are allowed in @format_string.
23245 * Returns: %TRUE if the named attribute was found with the expected type
23251 * g_menu_model_get_item_attribute_value:
23252 * @model: a #GMenuModel
23253 * @item_index: the index of the item
23254 * @attribute: the attribute to query
23255 * @expected_type: (allow-none): the expected type of the attribute, or %NULL
23257 * Queries the item at position @item_index in @model for the attribute
23258 * specified by @attribute.
23260 * If @expected_type is non-%NULL then it specifies the expected type of
23261 * the attribute. If it is %NULL then any type will be accepted.
23263 * If the attribute exists and matches @expected_type (or if the
23264 * expected type is unspecified) then the value is returned.
23266 * If the attribute does not exist, or does not match the expected type
23267 * then %NULL is returned.
23269 * Returns: (transfer full): the value of the attribute
23275 * g_menu_model_get_item_link:
23276 * @model: a #GMenuModel
23277 * @item_index: the index of the item
23278 * @link: the link to query
23280 * Queries the item at position @item_index in @model for the link
23281 * specified by @link.
23283 * If the link exists, the linked #GMenuModel is returned. If the link
23284 * does not exist, %NULL is returned.
23286 * Returns: (transfer full): the linked #GMenuModel, or %NULL
23292 * g_menu_model_get_n_items:
23293 * @model: a #GMenuModel
23295 * Query the number of items in @model.
23297 * Returns: the number of items
23303 * g_menu_model_is_mutable:
23304 * @model: a #GMenuModel
23306 * Queries if @model is mutable.
23308 * An immutable #GMenuModel will never emit the #GMenuModel::items-changed
23309 * signal. Consumers of the model may make optimisations accordingly.
23311 * Returns: %TRUE if the model is mutable (ie: "items-changed" may be emitted).
23317 * g_menu_model_items_changed:
23318 * @model: a #GMenuModel
23319 * @position: the position of the change
23320 * @removed: the number of items removed
23321 * @added: the number of items added
23323 * Requests emission of the #GMenuModel::items-changed signal on @model.
23325 * This function should never be called except by #GMenuModel
23326 * subclasses. Any other calls to this function will very likely lead
23327 * to a violation of the interface of the model.
23329 * The implementation should update its internal representation of the
23330 * menu before emitting the signal. The implementation should further
23331 * expect to receive queries about the new state of the menu (and
23332 * particularly added menu items) while signal handlers are running.
23334 * The implementation must dispatch this call directly from a mainloop
23335 * entry and not in response to calls -- particularly those from the
23336 * #GMenuModel API. Said another way: the menu must not change while
23337 * user code is running without returning to the mainloop.
23344 * g_menu_model_iterate_item_attributes:
23345 * @model: a #GMenuModel
23346 * @item_index: the index of the item
23348 * Creates a #GMenuAttributeIter to iterate over the attributes of
23349 * the item at position @item_index in @model.
23351 * You must free the iterator with g_object_unref() when you are done.
23353 * Returns: (transfer full): a new #GMenuAttributeIter
23359 * g_menu_model_iterate_item_links:
23360 * @model: a #GMenuModel
23361 * @item_index: the index of the item
23363 * Creates a #GMenuLinkIter to iterate over the links of the item at
23364 * position @item_index in @model.
23366 * You must free the iterator with g_object_unref() when you are done.
23368 * Returns: (transfer full): a new #GMenuLinkIter
23376 * Creates a new #GMenu.
23378 * The new menu has no items.
23380 * Returns: a new #GMenu
23388 * @label: (allow-none): the section label, or %NULL
23389 * @detailed_action: (allow-none): the detailed action string, or %NULL
23391 * Convenience function for prepending a normal menu item to the start
23392 * of @menu. Combine g_menu_item_new() and g_menu_insert_item() for a more
23393 * flexible alternative.
23400 * g_menu_prepend_item:
23402 * @item: a #GMenuItem to prepend
23404 * Prepends @item to the start of @menu.
23406 * See g_menu_insert_item() for more information.
23413 * g_menu_prepend_section:
23415 * @label: (allow-none): the section label, or %NULL
23416 * @section: a #GMenuModel with the items of the section
23418 * Convenience function for prepending a section menu item to the start
23419 * of @menu. Combine g_menu_item_new_section() and g_menu_insert_item() for
23420 * a more flexible alternative.
23427 * g_menu_prepend_submenu:
23429 * @label: (allow-none): the section label, or %NULL
23430 * @submenu: a #GMenuModel with the items of the submenu
23432 * Convenience function for prepending a submenu menu item to the start
23433 * of @menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for
23434 * a more flexible alternative.
23443 * @position: the position of the item to remove
23445 * Removes an item from the menu.
23447 * @position gives the index of the item to remove.
23449 * It is an error if position is not in range the range from 0 to one
23450 * less than the number of items in the menu.
23452 * It is not possible to remove items by identity since items are added
23453 * to the menu simply by copying their links and attributes (ie:
23454 * identity of the item itself is not preserved).
23461 * g_mount_can_eject:
23462 * @mount: a #GMount.
23464 * Checks if @mount can be eject.
23466 * Returns: %TRUE if the @mount can be ejected.
23471 * g_mount_can_unmount:
23472 * @mount: a #GMount.
23474 * Checks if @mount can be mounted.
23476 * Returns: %TRUE if the @mount can be unmounted.
23482 * @mount: a #GMount.
23483 * @flags: flags affecting the unmount if required for eject
23484 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23485 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23486 * @user_data: user data passed to @callback.
23488 * Ejects a mount. This is an asynchronous operation, and is
23489 * finished by calling g_mount_eject_finish() with the @mount
23490 * and #GAsyncResult data returned in the @callback.
23492 * Deprecated: 2.22: Use g_mount_eject_with_operation() instead.
23497 * g_mount_eject_finish:
23498 * @mount: a #GMount.
23499 * @result: a #GAsyncResult.
23500 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23502 * Finishes ejecting a mount. If any errors occurred during the operation,
23503 * @error will be set to contain the errors and %FALSE will be returned.
23505 * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
23506 * Deprecated: 2.22: Use g_mount_eject_with_operation_finish() instead.
23511 * g_mount_eject_with_operation:
23512 * @mount: a #GMount.
23513 * @flags: flags affecting the unmount if required for eject
23514 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23515 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23516 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23517 * @user_data: user data passed to @callback.
23519 * Ejects a mount. This is an asynchronous operation, and is
23520 * finished by calling g_mount_eject_with_operation_finish() with the @mount
23521 * and #GAsyncResult data returned in the @callback.
23528 * g_mount_eject_with_operation_finish:
23529 * @mount: a #GMount.
23530 * @result: a #GAsyncResult.
23531 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23533 * Finishes ejecting a mount. If any errors occurred during the operation,
23534 * @error will be set to contain the errors and %FALSE will be returned.
23536 * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
23542 * g_mount_get_default_location:
23543 * @mount: a #GMount.
23545 * Gets the default location of @mount. The default location of the given
23546 * @mount is a path that reflects the main entry point for the user (e.g.
23547 * the home directory, or the root of the volume).
23549 * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
23554 * g_mount_get_drive:
23555 * @mount: a #GMount.
23557 * Gets the drive for the @mount.
23559 * This is a convenience method for getting the #GVolume and then
23560 * using that object to get the #GDrive.
23562 * 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.
23567 * g_mount_get_icon:
23568 * @mount: a #GMount.
23570 * Gets the icon for @mount.
23572 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
23577 * g_mount_get_name:
23578 * @mount: a #GMount.
23580 * Gets the name of @mount.
23582 * Returns: the name for the given @mount. The returned string should be freed with g_free() when no longer needed.
23587 * g_mount_get_root:
23588 * @mount: a #GMount.
23590 * Gets the root directory on @mount.
23592 * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
23597 * g_mount_get_sort_key:
23598 * @mount: A #GMount.
23600 * Gets the sort key for @mount, if any.
23602 * Returns: Sorting key for @mount or %NULL if no such key is available.
23608 * g_mount_get_symbolic_icon:
23609 * @mount: a #GMount.
23611 * Gets the symbolic icon for @mount.
23613 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
23619 * g_mount_get_uuid:
23620 * @mount: a #GMount.
23622 * Gets the UUID for the @mount. The reference is typically based on
23623 * the file system UUID for the mount in question and should be
23624 * considered an opaque string. Returns %NULL if there is no UUID
23627 * 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.
23632 * g_mount_get_volume:
23633 * @mount: a #GMount.
23635 * Gets the volume for the @mount.
23637 * 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.
23642 * g_mount_guess_content_type:
23643 * @mount: a #GMount
23644 * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
23645 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
23646 * @callback: a #GAsyncReadyCallback
23647 * @user_data: user data passed to @callback
23649 * Tries to guess the type of content stored on @mount. Returns one or
23650 * more textual identifiers of well-known content types (typically
23651 * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
23652 * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23653 * specification for more on x-content types.
23655 * This is an asynchronous operation (see
23656 * g_mount_guess_content_type_sync() for the synchronous version), and
23657 * is finished by calling g_mount_guess_content_type_finish() with the
23658 * @mount and #GAsyncResult data returned in the @callback.
23665 * g_mount_guess_content_type_finish:
23666 * @mount: a #GMount
23667 * @result: a #GAsyncResult
23668 * @error: a #GError location to store the error occurring, or %NULL to ignore
23670 * Finishes guessing content types of @mount. If any errors occurred
23671 * during the operation, @error will be set to contain the errors and
23672 * %FALSE will be returned. In particular, you may get an
23673 * %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content
23676 * 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.
23682 * g_mount_guess_content_type_sync:
23683 * @mount: a #GMount
23684 * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
23685 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
23686 * @error: a #GError location to store the error occurring, or %NULL to ignore
23688 * Tries to guess the type of content stored on @mount. Returns one or
23689 * more textual identifiers of well-known content types (typically
23690 * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
23691 * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23692 * specification for more on x-content types.
23694 * This is an synchronous operation and as such may block doing IO;
23695 * see g_mount_guess_content_type() for the asynchronous version.
23697 * 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.
23703 * g_mount_is_shadowed:
23704 * @mount: A #GMount.
23706 * Determines if @mount is shadowed. Applications or libraries should
23707 * avoid displaying @mount in the user interface if it is shadowed.
23709 * A mount is said to be shadowed if there exists one or more user
23710 * visible objects (currently #GMount objects) with a root that is
23711 * inside the root of @mount.
23713 * One application of shadow mounts is when exposing a single file
23714 * system that is used to address several logical volumes. In this
23715 * situation, a #GVolumeMonitor implementation would create two
23716 * #GVolume objects (for example, one for the camera functionality of
23717 * the device and one for a SD card reader on the device) with
23718 * activation URIs <literal>gphoto2://[usb:001,002]/store1/</literal>
23719 * and <literal>gphoto2://[usb:001,002]/store2/</literal>. When the
23720 * underlying mount (with root
23721 * <literal>gphoto2://[usb:001,002]/</literal>) is mounted, said
23722 * #GVolumeMonitor implementation would create two #GMount objects
23723 * (each with their root matching the corresponding volume activation
23724 * root) that would shadow the original mount.
23726 * The proxy monitor in GVfs 2.26 and later, automatically creates and
23727 * manage shadow mounts (and shadows the underlying mount) if the
23728 * activation root on a #GVolume is set.
23730 * Returns: %TRUE if @mount is shadowed.
23736 * g_mount_operation_get_anonymous:
23737 * @op: a #GMountOperation.
23739 * Check to see whether the mount operation is being used
23740 * for an anonymous user.
23742 * Returns: %TRUE if mount operation is anonymous.
23747 * g_mount_operation_get_choice:
23748 * @op: a #GMountOperation.
23750 * Gets a choice from the mount operation.
23752 * Returns: an integer containing an index of the user's choice from the choice's list, or %0.
23757 * g_mount_operation_get_domain:
23758 * @op: a #GMountOperation.
23760 * Gets the domain of the mount operation.
23762 * Returns: a string set to the domain.
23767 * g_mount_operation_get_password:
23768 * @op: a #GMountOperation.
23770 * Gets a password from the mount operation.
23772 * Returns: a string containing the password within @op.
23777 * g_mount_operation_get_password_save:
23778 * @op: a #GMountOperation.
23780 * Gets the state of saving passwords for the mount operation.
23782 * Returns: a #GPasswordSave flag.
23787 * g_mount_operation_get_username:
23788 * @op: a #GMountOperation.
23790 * Get the user name from the mount operation.
23792 * Returns: a string containing the user name.
23797 * g_mount_operation_new:
23799 * Creates a new mount operation.
23801 * Returns: a #GMountOperation.
23806 * g_mount_operation_reply:
23807 * @op: a #GMountOperation
23808 * @result: a #GMountOperationResult
23810 * Emits the #GMountOperation::reply signal.
23815 * g_mount_operation_set_anonymous:
23816 * @op: a #GMountOperation.
23817 * @anonymous: boolean value.
23819 * Sets the mount operation to use an anonymous user if @anonymous is %TRUE.
23824 * g_mount_operation_set_choice:
23825 * @op: a #GMountOperation.
23826 * @choice: an integer.
23828 * Sets a default choice for the mount operation.
23833 * g_mount_operation_set_domain:
23834 * @op: a #GMountOperation.
23835 * @domain: the domain to set.
23837 * Sets the mount operation's domain.
23842 * g_mount_operation_set_password:
23843 * @op: a #GMountOperation.
23844 * @password: password to set.
23846 * Sets the mount operation's password to @password.
23851 * g_mount_operation_set_password_save:
23852 * @op: a #GMountOperation.
23853 * @save: a set of #GPasswordSave flags.
23855 * Sets the state of saving passwords for the mount operation.
23860 * g_mount_operation_set_username:
23861 * @op: a #GMountOperation.
23862 * @username: input username.
23864 * Sets the user name within @op to @username.
23870 * @mount: a #GMount.
23871 * @flags: flags affecting the operation
23872 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23873 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23874 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23875 * @user_data: user data passed to @callback.
23877 * Remounts a mount. This is an asynchronous operation, and is
23878 * finished by calling g_mount_remount_finish() with the @mount
23879 * and #GAsyncResults data returned in the @callback.
23881 * Remounting is useful when some setting affecting the operation
23882 * of the volume has been changed, as these may need a remount to
23883 * take affect. While this is semantically equivalent with unmounting
23884 * and then remounting not all backends might need to actually be
23890 * g_mount_remount_finish:
23891 * @mount: a #GMount.
23892 * @result: a #GAsyncResult.
23893 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23895 * Finishes remounting a mount. If any errors occurred during the operation,
23896 * @error will be set to contain the errors and %FALSE will be returned.
23898 * Returns: %TRUE if the mount was successfully remounted. %FALSE otherwise.
23904 * @mount: A #GMount.
23906 * Increments the shadow count on @mount. Usually used by
23907 * #GVolumeMonitor implementations when creating a shadow mount for
23908 * @mount, see g_mount_is_shadowed() for more information. The caller
23909 * will need to emit the #GMount::changed signal on @mount manually.
23917 * @mount: a #GMount.
23918 * @flags: flags affecting the operation
23919 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23920 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23921 * @user_data: user data passed to @callback.
23923 * Unmounts a mount. This is an asynchronous operation, and is
23924 * finished by calling g_mount_unmount_finish() with the @mount
23925 * and #GAsyncResult data returned in the @callback.
23927 * Deprecated: 2.22: Use g_mount_unmount_with_operation() instead.
23932 * g_mount_unmount_finish:
23933 * @mount: a #GMount.
23934 * @result: a #GAsyncResult.
23935 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23937 * Finishes unmounting a mount. If any errors occurred during the operation,
23938 * @error will be set to contain the errors and %FALSE will be returned.
23940 * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
23941 * Deprecated: 2.22: Use g_mount_unmount_with_operation_finish() instead.
23946 * g_mount_unmount_with_operation:
23947 * @mount: a #GMount.
23948 * @flags: flags affecting the operation
23949 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23950 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23951 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23952 * @user_data: user data passed to @callback.
23954 * Unmounts a mount. This is an asynchronous operation, and is
23955 * finished by calling g_mount_unmount_with_operation_finish() with the @mount
23956 * and #GAsyncResult data returned in the @callback.
23963 * g_mount_unmount_with_operation_finish:
23964 * @mount: a #GMount.
23965 * @result: a #GAsyncResult.
23966 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23968 * Finishes unmounting a mount. If any errors occurred during the operation,
23969 * @error will be set to contain the errors and %FALSE will be returned.
23971 * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
23977 * g_mount_unshadow:
23978 * @mount: A #GMount.
23980 * Decrements the shadow count on @mount. Usually used by
23981 * #GVolumeMonitor implementations when destroying a shadow mount for
23982 * @mount, see g_mount_is_shadowed() for more information. The caller
23983 * will need to emit the #GMount::changed signal on @mount manually.
23990 * g_network_address_get_hostname:
23991 * @addr: a #GNetworkAddress
23993 * Gets @addr's hostname. This might be either UTF-8 or ASCII-encoded,
23994 * depending on what @addr was created with.
23996 * Returns: @addr's hostname
24002 * g_network_address_get_port:
24003 * @addr: a #GNetworkAddress
24005 * Gets @addr's port number
24007 * Returns: @addr's port (which may be 0)
24013 * g_network_address_get_scheme:
24014 * @addr: a #GNetworkAddress
24016 * Gets @addr's scheme
24018 * Returns: @addr's scheme (%NULL if not built from URI)
24024 * g_network_address_new:
24025 * @hostname: the hostname
24028 * Creates a new #GSocketConnectable for connecting to the given
24029 * @hostname and @port.
24031 * Returns: (transfer full) (type GNetworkAddress): the new #GNetworkAddress
24037 * g_network_address_parse:
24038 * @host_and_port: the hostname and optionally a port
24039 * @default_port: the default port if not in @host_and_port
24040 * @error: a pointer to a #GError, or %NULL
24042 * Creates a new #GSocketConnectable for connecting to the given
24043 * @hostname and @port. May fail and return %NULL in case
24044 * parsing @host_and_port fails.
24046 * @host_and_port may be in any of a number of recognised formats; an IPv6
24047 * address, an IPv4 address, or a domain name (in which case a DNS
24048 * lookup is performed). Quoting with [] is supported for all address
24049 * types. A port override may be specified in the usual way with a
24052 * If no port is specified in @host_and_port then @default_port will be
24053 * used as the port number to connect to.
24055 * In general, @host_and_port is expected to be provided by the user
24056 * (allowing them to give the hostname, and a port overide if necessary)
24057 * and @default_port is expected to be provided by the application.
24059 * (The port component of @host_and_port can also be specified as a
24060 * service name rather than as a numeric port, but this functionality
24061 * is deprecated, because it depends on the contents of /etc/services,
24062 * which is generally quite sparse on platforms other than Linux.)
24064 * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
24070 * g_network_address_parse_uri:
24071 * @uri: the hostname and optionally a port
24072 * @default_port: The default port if none is found in the URI
24073 * @error: a pointer to a #GError, or %NULL
24075 * Creates a new #GSocketConnectable for connecting to the given
24076 * @uri. May fail and return %NULL in case parsing @uri fails.
24078 * Using this rather than g_network_address_new() or
24079 * g_network_address_parse() allows #GSocketClient to determine
24080 * when to use application-specific proxy protocols.
24082 * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
24088 * g_network_monitor_base_add_network:
24089 * @monitor: the #GNetworkMonitorBase
24090 * @network: a #GInetAddressMask
24092 * Adds @network to @monitor's list of available networks.
24099 * g_network_monitor_base_remove_network:
24100 * @monitor: the #GNetworkMonitorBase
24101 * @network: a #GInetAddressMask
24103 * Removes @network from @monitor's list of available networks.
24110 * g_network_monitor_base_set_networks:
24111 * @monitor: the #GNetworkMonitorBase
24112 * @networks: (array length=length): an array of #GInetAddressMask
24113 * @length: length of @networks
24115 * Drops @monitor's current list of available networks and replaces
24116 * it with @networks.
24121 * g_network_monitor_can_reach:
24122 * @monitor: a #GNetworkMonitor
24123 * @connectable: a #GSocketConnectable
24124 * @cancellable: (allow-none): a #GCancellable, or %NULL
24125 * @error: return location for a #GError, or %NULL
24127 * Attempts to determine whether or not the host pointed to by
24128 * @connectable can be reached, without actually trying to connect to
24131 * This may return %TRUE even when #GNetworkMonitor:network-available
24132 * is %FALSE, if, for example, @monitor can determine that
24133 * @connectable refers to a host on a local network.
24135 * If @monitor believes that an attempt to connect to @connectable
24136 * will succeed, it will return %TRUE. Otherwise, it will return
24137 * %FALSE and set @error to an appropriate error (such as
24138 * %G_IO_ERROR_HOST_UNREACHABLE).
24140 * Note that although this does not attempt to connect to
24141 * @connectable, it may still block for a brief period of time (eg,
24142 * trying to do multicast DNS on the local network), so if you do not
24143 * want to block, you should use g_network_monitor_can_reach_async().
24145 * Returns: %TRUE if @connectable is reachable, %FALSE if not.
24151 * g_network_monitor_can_reach_async:
24152 * @monitor: a #GNetworkMonitor
24153 * @connectable: a #GSocketConnectable
24154 * @cancellable: (allow-none): a #GCancellable, or %NULL
24155 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
24156 * @user_data: (closure): the data to pass to callback function
24158 * Asynchronously attempts to determine whether or not the host
24159 * pointed to by @connectable can be reached, without actually
24160 * trying to connect to it.
24162 * For more details, see g_network_monitor_can_reach().
24164 * When the operation is finished, @callback will be called.
24165 * You can then call g_network_monitor_can_reach_finish()
24166 * to get the result of the operation.
24171 * g_network_monitor_can_reach_finish:
24172 * @monitor: a #GNetworkMonitor
24173 * @result: a #GAsyncResult
24174 * @error: return location for errors, or %NULL
24176 * Finishes an async network connectivity test.
24177 * See g_network_monitor_can_reach_async().
24179 * Returns: %TRUE if network is reachable, %FALSE if not.
24184 * g_network_monitor_get_default:
24186 * Gets the default #GNetworkMonitor for the system.
24188 * Returns: (transfer none): a #GNetworkMonitor
24194 * g_network_monitor_get_network_available:
24195 * @monitor: the #GNetworkMonitor
24197 * Checks if the network is available. "Available" here means that the
24198 * system has a default route available for at least one of IPv4 or
24199 * IPv6. It does not necessarily imply that the public Internet is
24200 * reachable. See #GNetworkMonitor:network-available for more details.
24202 * Returns: whether the network is available
24208 * g_network_service_get_domain:
24209 * @srv: a #GNetworkService
24211 * Gets the domain that @srv serves. This might be either UTF-8 or
24212 * ASCII-encoded, depending on what @srv was created with.
24214 * Returns: @srv's domain name
24220 * g_network_service_get_protocol:
24221 * @srv: a #GNetworkService
24223 * Gets @srv's protocol name (eg, "tcp").
24225 * Returns: @srv's protocol name
24231 * g_network_service_get_scheme:
24232 * @srv: a #GNetworkService
24234 * Get's the URI scheme used to resolve proxies. By default, the service name
24235 * is used as scheme.
24237 * Returns: @srv's scheme name
24243 * g_network_service_get_service:
24244 * @srv: a #GNetworkService
24246 * Gets @srv's service name (eg, "ldap").
24248 * Returns: @srv's service name
24254 * g_network_service_new:
24255 * @service: the service type to look up (eg, "ldap")
24256 * @protocol: the networking protocol to use for @service (eg, "tcp")
24257 * @domain: the DNS domain to look up the service in
24259 * Creates a new #GNetworkService representing the given @service,
24260 * @protocol, and @domain. This will initially be unresolved; use the
24261 * #GSocketConnectable interface to resolve it.
24263 * Returns: (transfer full) (type GNetworkService): a new #GNetworkService
24269 * g_network_service_set_scheme:
24270 * @srv: a #GNetworkService
24271 * @scheme: a URI scheme
24273 * Set's the URI scheme used to resolve proxies. By default, the service name
24274 * is used as scheme.
24281 * g_null_settings_backend_new:
24283 * Creates a readonly #GSettingsBackend.
24285 * This backend does not allow changes to settings, so all settings
24286 * will always have their default values.
24288 * Returns: (transfer full): a newly created #GSettingsBackend
24294 * g_output_stream_clear_pending:
24295 * @stream: output stream
24297 * Clears the pending flag on @stream.
24302 * g_output_stream_close:
24303 * @stream: A #GOutputStream.
24304 * @cancellable: (allow-none): optional cancellable object
24305 * @error: location to store the error occurring, or %NULL to ignore
24307 * Closes the stream, releasing resources related to it.
24309 * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
24310 * Closing a stream multiple times will not return an error.
24312 * Closing a stream will automatically flush any outstanding buffers in the
24315 * Streams will be automatically closed when the last reference
24316 * is dropped, but you might want to call this function to make sure
24317 * resources are released as early as possible.
24319 * Some streams might keep the backing store of the stream (e.g. a file descriptor)
24320 * open after the stream is closed. See the documentation for the individual
24321 * stream for details.
24323 * On failure the first error that happened will be reported, but the close
24324 * operation will finish as much as possible. A stream that failed to
24325 * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
24326 * is important to check and report the error to the user, otherwise
24327 * there might be a loss of data as all data might not be written.
24329 * If @cancellable is not %NULL, then the operation can be cancelled by
24330 * triggering the cancellable object from another thread. If the operation
24331 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24332 * Cancelling a close will still leave the stream closed, but there some streams
24333 * can use a faster close that doesn't block to e.g. check errors. On
24334 * cancellation (as with any error) there is no guarantee that all written
24335 * data will reach the target.
24337 * Returns: %TRUE on success, %FALSE on failure
24342 * g_output_stream_close_async:
24343 * @stream: A #GOutputStream.
24344 * @io_priority: the io priority of the request.
24345 * @cancellable: (allow-none): optional cancellable object
24346 * @callback: (scope async): callback to call when the request is satisfied
24347 * @user_data: (closure): the data to pass to callback function
24349 * Requests an asynchronous close of the stream, releasing resources
24350 * related to it. When the operation is finished @callback will be
24351 * called. You can then call g_output_stream_close_finish() to get
24352 * the result of the operation.
24354 * For behaviour details see g_output_stream_close().
24356 * The asyncronous methods have a default fallback that uses threads
24357 * to implement asynchronicity, so they are optional for inheriting
24358 * classes. However, if you override one you must override all.
24363 * g_output_stream_close_finish:
24364 * @stream: a #GOutputStream.
24365 * @result: a #GAsyncResult.
24366 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24368 * Closes an output stream.
24370 * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
24375 * g_output_stream_flush:
24376 * @stream: a #GOutputStream.
24377 * @cancellable: (allow-none): optional cancellable object
24378 * @error: location to store the error occurring, or %NULL to ignore
24380 * Forces a write of all user-space buffered data for the given
24381 * @stream. Will block during the operation. Closing the stream will
24382 * implicitly cause a flush.
24384 * This function is optional for inherited classes.
24386 * If @cancellable is not %NULL, then the operation can be cancelled by
24387 * triggering the cancellable object from another thread. If the operation
24388 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24390 * Returns: %TRUE on success, %FALSE on error
24395 * g_output_stream_flush_async:
24396 * @stream: a #GOutputStream.
24397 * @io_priority: the io priority of the request.
24398 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24399 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
24400 * @user_data: (closure): the data to pass to callback function
24402 * Forces an asynchronous write of all user-space buffered data for
24403 * the given @stream.
24404 * For behaviour details see g_output_stream_flush().
24406 * When the operation is finished @callback will be
24407 * called. You can then call g_output_stream_flush_finish() to get the
24408 * result of the operation.
24413 * g_output_stream_flush_finish:
24414 * @stream: a #GOutputStream.
24415 * @result: a GAsyncResult.
24416 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24418 * Finishes flushing an output stream.
24420 * Returns: %TRUE if flush operation succeeded, %FALSE otherwise.
24425 * g_output_stream_has_pending:
24426 * @stream: a #GOutputStream.
24428 * Checks if an ouput stream has pending actions.
24430 * Returns: %TRUE if @stream has pending actions.
24435 * g_output_stream_is_closed:
24436 * @stream: a #GOutputStream.
24438 * Checks if an output stream has already been closed.
24440 * Returns: %TRUE if @stream is closed. %FALSE otherwise.
24445 * g_output_stream_is_closing:
24446 * @stream: a #GOutputStream.
24448 * Checks if an output stream is being closed. This can be
24449 * used inside e.g. a flush implementation to see if the
24450 * flush (or other i/o operation) is called from within
24451 * the closing operation.
24453 * Returns: %TRUE if @stream is being closed. %FALSE otherwise.
24459 * g_output_stream_set_pending:
24460 * @stream: a #GOutputStream.
24461 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24463 * Sets @stream to have actions pending. If the pending flag is
24464 * already set or @stream is closed, it will return %FALSE and set
24467 * Returns: %TRUE if pending was previously unset and is now set.
24472 * g_output_stream_splice:
24473 * @stream: a #GOutputStream.
24474 * @source: a #GInputStream.
24475 * @flags: a set of #GOutputStreamSpliceFlags.
24476 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24477 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24479 * Splices an input stream into an output stream.
24481 * 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.
24486 * g_output_stream_splice_async:
24487 * @stream: a #GOutputStream.
24488 * @source: a #GInputStream.
24489 * @flags: a set of #GOutputStreamSpliceFlags.
24490 * @io_priority: the io priority of the request.
24491 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24492 * @callback: (scope async): a #GAsyncReadyCallback.
24493 * @user_data: (closure): user data passed to @callback.
24495 * Splices a stream asynchronously.
24496 * When the operation is finished @callback will be called.
24497 * You can then call g_output_stream_splice_finish() to get the
24498 * result of the operation.
24500 * For the synchronous, blocking version of this function, see
24501 * g_output_stream_splice().
24506 * g_output_stream_splice_finish:
24507 * @stream: a #GOutputStream.
24508 * @result: a #GAsyncResult.
24509 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24511 * Finishes an asynchronous stream splice operation.
24513 * 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.
24518 * g_output_stream_write:
24519 * @stream: a #GOutputStream.
24520 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24521 * @count: the number of bytes to write
24522 * @cancellable: (allow-none): optional cancellable object
24523 * @error: location to store the error occurring, or %NULL to ignore
24525 * Tries to write @count bytes from @buffer into the stream. Will block
24526 * during the operation.
24528 * If count is 0, returns 0 and does nothing. A value of @count
24529 * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
24531 * On success, the number of bytes written to the stream is returned.
24532 * It is not an error if this is not the same as the requested size, as it
24533 * can happen e.g. on a partial I/O error, or if there is not enough
24534 * storage in the stream. All writes block until at least one byte
24535 * is written or an error occurs; 0 is never returned (unless
24538 * If @cancellable is not %NULL, then the operation can be cancelled by
24539 * triggering the cancellable object from another thread. If the operation
24540 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24541 * operation was partially finished when the operation was cancelled the
24542 * partial result will be returned, without an error.
24544 * On error -1 is returned and @error is set accordingly.
24546 * Virtual: write_fn
24547 * Returns: Number of bytes written, or -1 on error
24552 * g_output_stream_write_all:
24553 * @stream: a #GOutputStream.
24554 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24555 * @count: the number of bytes to write
24556 * @bytes_written: (out): location to store the number of bytes that was written to the stream
24557 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24558 * @error: location to store the error occurring, or %NULL to ignore
24560 * Tries to write @count bytes from @buffer into the stream. Will block
24561 * during the operation.
24563 * This function is similar to g_output_stream_write(), except it tries to
24564 * write as many bytes as requested, only stopping on an error.
24566 * On a successful write of @count bytes, %TRUE is returned, and @bytes_written
24567 * is set to @count.
24569 * If there is an error during the operation %FALSE is returned and @error
24570 * is set to indicate the error status, @bytes_written is updated to contain
24571 * the number of bytes written into the stream before the error occurred.
24573 * Returns: %TRUE on success, %FALSE if there was an error
24578 * g_output_stream_write_async:
24579 * @stream: A #GOutputStream.
24580 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24581 * @count: the number of bytes to write
24582 * @io_priority: the io priority of the request.
24583 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24584 * @callback: (scope async): callback to call when the request is satisfied
24585 * @user_data: (closure): the data to pass to callback function
24587 * Request an asynchronous write of @count bytes from @buffer into
24588 * the stream. When the operation is finished @callback will be called.
24589 * You can then call g_output_stream_write_finish() to get the result of the
24592 * During an async request no other sync and async calls are allowed,
24593 * and will result in %G_IO_ERROR_PENDING errors.
24595 * A value of @count larger than %G_MAXSSIZE will cause a
24596 * %G_IO_ERROR_INVALID_ARGUMENT error.
24598 * On success, the number of bytes written will be passed to the
24599 * @callback. It is not an error if this is not the same as the
24600 * requested size, as it can happen e.g. on a partial I/O error,
24601 * but generally we try to write as many bytes as requested.
24603 * You are guaranteed that this method will never fail with
24604 * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
24605 * method will just wait until this changes.
24607 * Any outstanding I/O request with higher priority (lower numerical
24608 * value) will be executed before an outstanding request with lower
24609 * priority. Default priority is %G_PRIORITY_DEFAULT.
24611 * The asyncronous methods have a default fallback that uses threads
24612 * to implement asynchronicity, so they are optional for inheriting
24613 * classes. However, if you override one you must override all.
24615 * For the synchronous, blocking version of this function, see
24616 * g_output_stream_write().
24621 * g_output_stream_write_bytes:
24622 * @stream: a #GOutputStream.
24623 * @bytes: the #GBytes to write
24624 * @cancellable: (allow-none): optional cancellable object
24625 * @error: location to store the error occurring, or %NULL to ignore
24627 * Tries to write the data from @bytes into the stream. Will block
24628 * during the operation.
24630 * If @bytes is 0-length, returns 0 and does nothing. A #GBytes larger
24631 * than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
24633 * On success, the number of bytes written to the stream is returned.
24634 * It is not an error if this is not the same as the requested size, as it
24635 * can happen e.g. on a partial I/O error, or if there is not enough
24636 * storage in the stream. All writes block until at least one byte
24637 * is written or an error occurs; 0 is never returned (unless
24638 * the size of @bytes is 0).
24640 * If @cancellable is not %NULL, then the operation can be cancelled by
24641 * triggering the cancellable object from another thread. If the operation
24642 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24643 * operation was partially finished when the operation was cancelled the
24644 * partial result will be returned, without an error.
24646 * On error -1 is returned and @error is set accordingly.
24648 * Returns: Number of bytes written, or -1 on error
24653 * g_output_stream_write_bytes_async:
24654 * @stream: A #GOutputStream.
24655 * @bytes: The bytes to write
24656 * @io_priority: the io priority of the request.
24657 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24658 * @callback: (scope async): callback to call when the request is satisfied
24659 * @user_data: (closure): the data to pass to callback function
24661 * Request an asynchronous write of the data in @bytes to the stream.
24662 * When the operation is finished @callback will be called. You can
24663 * then call g_output_stream_write_bytes_finish() to get the result of
24666 * During an async request no other sync and async calls are allowed,
24667 * and will result in %G_IO_ERROR_PENDING errors.
24669 * A #GBytes larger than %G_MAXSSIZE will cause a
24670 * %G_IO_ERROR_INVALID_ARGUMENT error.
24672 * On success, the number of bytes written will be passed to the
24673 * @callback. It is not an error if this is not the same as the
24674 * requested size, as it can happen e.g. on a partial I/O error,
24675 * but generally we try to write as many bytes as requested.
24677 * You are guaranteed that this method will never fail with
24678 * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
24679 * method will just wait until this changes.
24681 * Any outstanding I/O request with higher priority (lower numerical
24682 * value) will be executed before an outstanding request with lower
24683 * priority. Default priority is %G_PRIORITY_DEFAULT.
24685 * For the synchronous, blocking version of this function, see
24686 * g_output_stream_write_bytes().
24691 * g_output_stream_write_bytes_finish:
24692 * @stream: a #GOutputStream.
24693 * @result: a #GAsyncResult.
24694 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24696 * Finishes a stream write-from-#GBytes operation.
24698 * Returns: a #gssize containing the number of bytes written to the stream.
24703 * g_output_stream_write_finish:
24704 * @stream: a #GOutputStream.
24705 * @result: a #GAsyncResult.
24706 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24708 * Finishes a stream write operation.
24710 * Returns: a #gssize containing the number of bytes written to the stream.
24715 * g_permission_acquire:
24716 * @permission: a #GPermission instance
24717 * @cancellable: (allow-none): a #GCancellable, or %NULL
24718 * @error: a pointer to a %NULL #GError, or %NULL
24720 * Attempts to acquire the permission represented by @permission.
24722 * The precise method by which this happens depends on the permission
24723 * and the underlying authentication mechanism. A simple example is
24724 * that a dialog may appear asking the user to enter their password.
24726 * You should check with g_permission_get_can_acquire() before calling
24729 * If the permission is acquired then %TRUE is returned. Otherwise,
24730 * %FALSE is returned and @error is set appropriately.
24732 * This call is blocking, likely for a very long time (in the case that
24733 * user interaction is required). See g_permission_acquire_async() for
24734 * the non-blocking version.
24736 * Returns: %TRUE if the permission was successfully acquired
24742 * g_permission_acquire_async:
24743 * @permission: a #GPermission instance
24744 * @cancellable: (allow-none): a #GCancellable, or %NULL
24745 * @callback: the #GAsyncReadyCallback to call when done
24746 * @user_data: the user data to pass to @callback
24748 * Attempts to acquire the permission represented by @permission.
24750 * This is the first half of the asynchronous version of
24751 * g_permission_acquire().
24758 * g_permission_acquire_finish:
24759 * @permission: a #GPermission instance
24760 * @result: the #GAsyncResult given to the #GAsyncReadyCallback
24761 * @error: a pointer to a %NULL #GError, or %NULL
24763 * Collects the result of attempting to acquire the permission
24764 * represented by @permission.
24766 * This is the second half of the asynchronous version of
24767 * g_permission_acquire().
24769 * Returns: %TRUE if the permission was successfully acquired
24775 * g_permission_get_allowed:
24776 * @permission: a #GPermission instance
24778 * Gets the value of the 'allowed' property. This property is %TRUE if
24779 * the caller currently has permission to perform the action that
24780 * @permission represents the permission to perform.
24782 * Returns: the value of the 'allowed' property
24788 * g_permission_get_can_acquire:
24789 * @permission: a #GPermission instance
24791 * Gets the value of the 'can-acquire' property. This property is %TRUE
24792 * if it is generally possible to acquire the permission by calling
24793 * g_permission_acquire().
24795 * Returns: the value of the 'can-acquire' property
24801 * g_permission_get_can_release:
24802 * @permission: a #GPermission instance
24804 * Gets the value of the 'can-release' property. This property is %TRUE
24805 * if it is generally possible to release the permission by calling
24806 * g_permission_release().
24808 * Returns: the value of the 'can-release' property
24814 * g_permission_impl_update:
24815 * @permission: a #GPermission instance
24816 * @allowed: the new value for the 'allowed' property
24817 * @can_acquire: the new value for the 'can-acquire' property
24818 * @can_release: the new value for the 'can-release' property
24820 * This function is called by the #GPermission implementation to update
24821 * the properties of the permission. You should never call this
24822 * function except from a #GPermission implementation.
24824 * GObject notify signals are generated, as appropriate.
24831 * g_permission_release:
24832 * @permission: a #GPermission instance
24833 * @cancellable: (allow-none): a #GCancellable, or %NULL
24834 * @error: a pointer to a %NULL #GError, or %NULL
24836 * Attempts to release the permission represented by @permission.
24838 * The precise method by which this happens depends on the permission
24839 * and the underlying authentication mechanism. In most cases the
24840 * permission will be dropped immediately without further action.
24842 * You should check with g_permission_get_can_release() before calling
24845 * If the permission is released then %TRUE is returned. Otherwise,
24846 * %FALSE is returned and @error is set appropriately.
24848 * This call is blocking, likely for a very long time (in the case that
24849 * user interaction is required). See g_permission_release_async() for
24850 * the non-blocking version.
24852 * Returns: %TRUE if the permission was successfully released
24858 * g_permission_release_async:
24859 * @permission: a #GPermission instance
24860 * @cancellable: (allow-none): a #GCancellable, or %NULL
24861 * @callback: the #GAsyncReadyCallback to call when done
24862 * @user_data: the user data to pass to @callback
24864 * Attempts to release the permission represented by @permission.
24866 * This is the first half of the asynchronous version of
24867 * g_permission_release().
24874 * g_permission_release_finish:
24875 * @permission: a #GPermission instance
24876 * @result: the #GAsyncResult given to the #GAsyncReadyCallback
24877 * @error: a pointer to a %NULL #GError, or %NULL
24879 * Collects the result of attempting to release the permission
24880 * represented by @permission.
24882 * This is the second half of the asynchronous version of
24883 * g_permission_release().
24885 * Returns: %TRUE if the permission was successfully released
24891 * g_poll_file_monitor_new:
24894 * Polls @file for changes.
24896 * Returns: a new #GFileMonitor for the given #GFile.
24901 * g_pollable_input_stream_can_poll:
24902 * @stream: a #GPollableInputStream.
24904 * Checks if @stream is actually pollable. Some classes may implement
24905 * #GPollableInputStream but have only certain instances of that class
24906 * be pollable. If this method returns %FALSE, then the behavior of
24907 * other #GPollableInputStream methods is undefined.
24909 * For any given stream, the value returned by this method is constant;
24910 * a stream cannot switch from pollable to non-pollable or vice versa.
24912 * Returns: %TRUE if @stream is pollable, %FALSE if not.
24918 * g_pollable_input_stream_create_source:
24919 * @stream: a #GPollableInputStream.
24920 * @cancellable: (allow-none): a #GCancellable, or %NULL
24922 * Creates a #GSource that triggers when @stream can be read, or
24923 * @cancellable is triggered or an error occurs. The callback on the
24924 * source is of the #GPollableSourceFunc type.
24926 * As with g_pollable_input_stream_is_readable(), it is possible that
24927 * the stream may not actually be readable even after the source
24928 * triggers, so you should use g_pollable_input_stream_read_nonblocking()
24929 * rather than g_input_stream_read() from the callback.
24931 * Returns: (transfer full): a new #GSource
24937 * g_pollable_input_stream_is_readable:
24938 * @stream: a #GPollableInputStream.
24940 * Checks if @stream can be read.
24942 * Note that some stream types may not be able to implement this 100%
24943 * reliably, and it is possible that a call to g_input_stream_read()
24944 * after this returns %TRUE would still block. To guarantee
24945 * non-blocking behavior, you should always use
24946 * g_pollable_input_stream_read_nonblocking(), which will return a
24947 * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
24949 * 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.
24955 * g_pollable_input_stream_read_nonblocking:
24956 * @stream: a #GPollableInputStream
24957 * @buffer: a buffer to read data into (which should be at least @count bytes long).
24958 * @count: the number of bytes you want to read
24959 * @cancellable: (allow-none): a #GCancellable, or %NULL
24960 * @error: #GError for error reporting, or %NULL to ignore.
24962 * Attempts to read up to @count bytes from @stream into @buffer, as
24963 * with g_input_stream_read(). If @stream is not currently readable,
24964 * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
24965 * use g_pollable_input_stream_create_source() to create a #GSource
24966 * that will be triggered when @stream is readable.
24968 * Note that since this method never blocks, you cannot actually
24969 * use @cancellable to cancel it. However, it will return an error
24970 * if @cancellable has already been cancelled when you call, which
24971 * may happen if you call this method after a source triggers due
24972 * to having been cancelled.
24974 * Virtual: read_nonblocking
24975 * Returns: the number of bytes read, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
24980 * g_pollable_output_stream_can_poll:
24981 * @stream: a #GPollableOutputStream.
24983 * Checks if @stream is actually pollable. Some classes may implement
24984 * #GPollableOutputStream but have only certain instances of that
24985 * class be pollable. If this method returns %FALSE, then the behavior
24986 * of other #GPollableOutputStream methods is undefined.
24988 * For any given stream, the value returned by this method is constant;
24989 * a stream cannot switch from pollable to non-pollable or vice versa.
24991 * Returns: %TRUE if @stream is pollable, %FALSE if not.
24997 * g_pollable_output_stream_create_source:
24998 * @stream: a #GPollableOutputStream.
24999 * @cancellable: (allow-none): a #GCancellable, or %NULL
25001 * Creates a #GSource that triggers when @stream can be written, or
25002 * @cancellable is triggered or an error occurs. The callback on the
25003 * source is of the #GPollableSourceFunc type.
25005 * As with g_pollable_output_stream_is_writable(), it is possible that
25006 * the stream may not actually be writable even after the source
25007 * triggers, so you should use g_pollable_output_stream_write_nonblocking()
25008 * rather than g_output_stream_write() from the callback.
25010 * Returns: (transfer full): a new #GSource
25016 * g_pollable_output_stream_is_writable:
25017 * @stream: a #GPollableOutputStream.
25019 * Checks if @stream can be written.
25021 * Note that some stream types may not be able to implement this 100%
25022 * reliably, and it is possible that a call to g_output_stream_write()
25023 * after this returns %TRUE would still block. To guarantee
25024 * non-blocking behavior, you should always use
25025 * g_pollable_output_stream_write_nonblocking(), which will return a
25026 * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
25028 * 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.
25034 * g_pollable_output_stream_write_nonblocking:
25035 * @stream: a #GPollableOutputStream
25036 * @buffer: (array length=count) (element-type guint8): a buffer to write data from
25037 * @count: the number of bytes you want to write
25038 * @cancellable: (allow-none): a #GCancellable, or %NULL
25039 * @error: #GError for error reporting, or %NULL to ignore.
25041 * Attempts to write up to @count bytes from @buffer to @stream, as
25042 * with g_output_stream_write(). If @stream is not currently writable,
25043 * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
25044 * use g_pollable_output_stream_create_source() to create a #GSource
25045 * that will be triggered when @stream is writable.
25047 * Note that since this method never blocks, you cannot actually
25048 * use @cancellable to cancel it. However, it will return an error
25049 * if @cancellable has already been cancelled when you call, which
25050 * may happen if you call this method after a source triggers due
25051 * to having been cancelled.
25053 * Virtual: write_nonblocking
25054 * Returns: the number of bytes written, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
25059 * g_pollable_source_new:
25060 * @pollable_stream: the stream associated with the new source
25062 * Utility method for #GPollableInputStream and #GPollableOutputStream
25063 * implementations. Creates a new #GSource that expects a callback of
25064 * type #GPollableSourceFunc. The new source does not actually do
25065 * anything on its own; use g_source_add_child_source() to add other
25066 * sources to it to cause it to trigger.
25068 * Returns: (transfer full): the new #GSource.
25074 * g_pollable_source_new_full:
25075 * @pollable_stream: (type GObject): the stream associated with the new source
25076 * @child_source: (allow-none): optional child source to attach
25077 * @cancellable: (allow-none): optional #GCancellable to attach
25079 * Utility method for #GPollableInputStream and #GPollableOutputStream
25080 * implementations. Creates a new #GSource, as with
25081 * g_pollable_source_new(), but also attaching @child_source (with a
25082 * dummy callback), and @cancellable, if they are non-%NULL.
25084 * Returns: (transfer full): the new #GSource.
25090 * g_pollable_stream_read:
25091 * @stream: a #GInputStream
25092 * @buffer: a buffer to read data into
25093 * @count: the number of bytes to read
25094 * @blocking: whether to do blocking I/O
25095 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25096 * @error: location to store the error occurring, or %NULL to ignore
25098 * Tries to read from @stream, as with g_input_stream_read() (if
25099 * @blocking is %TRUE) or g_pollable_input_stream_read_nonblocking()
25100 * (if @blocking is %FALSE). This can be used to more easily share
25101 * code between blocking and non-blocking implementations of a method.
25103 * If @blocking is %FALSE, then @stream must be a
25104 * #GPollableInputStream for which g_pollable_input_stream_can_poll()
25105 * returns %TRUE, or else the behavior is undefined. If @blocking is
25106 * %TRUE, then @stream does not need to be a #GPollableInputStream.
25108 * Returns: the number of bytes read, or -1 on error.
25114 * g_pollable_stream_write:
25115 * @stream: a #GOutputStream.
25116 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25117 * @count: the number of bytes to write
25118 * @blocking: whether to do blocking I/O
25119 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25120 * @error: location to store the error occurring, or %NULL to ignore
25122 * Tries to write to @stream, as with g_output_stream_write() (if
25123 * @blocking is %TRUE) or g_pollable_output_stream_write_nonblocking()
25124 * (if @blocking is %FALSE). This can be used to more easily share
25125 * code between blocking and non-blocking implementations of a method.
25127 * If @blocking is %FALSE, then @stream must be a
25128 * #GPollableOutputStream for which
25129 * g_pollable_output_stream_can_poll() returns %TRUE or else the
25130 * behavior is undefined. If @blocking is %TRUE, then @stream does not
25131 * need to be a #GPollableOutputStream.
25133 * Returns: the number of bytes written, or -1 on error.
25139 * g_pollable_stream_write_all:
25140 * @stream: a #GOutputStream.
25141 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25142 * @count: the number of bytes to write
25143 * @blocking: whether to do blocking I/O
25144 * @bytes_written: (out): location to store the number of bytes that was written to the stream
25145 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25146 * @error: location to store the error occurring, or %NULL to ignore
25148 * Tries to write @count bytes to @stream, as with
25149 * g_output_stream_write_all(), but using g_pollable_stream_write()
25150 * rather than g_output_stream_write().
25152 * On a successful write of @count bytes, %TRUE is returned, and
25153 * @bytes_written is set to @count.
25155 * If there is an error during the operation (including
25156 * %G_IO_ERROR_WOULD_BLOCK in the non-blocking case), %FALSE is
25157 * returned and @error is set to indicate the error status,
25158 * @bytes_written is updated to contain the number of bytes written
25159 * into the stream before the error occurred.
25161 * As with g_pollable_stream_write(), if @blocking is %FALSE, then
25162 * @stream must be a #GPollableOutputStream for which
25163 * g_pollable_output_stream_can_poll() returns %TRUE or else the
25164 * behavior is undefined. If @blocking is %TRUE, then @stream does not
25165 * need to be a #GPollableOutputStream.
25167 * Returns: %TRUE on success, %FALSE if there was an error
25173 * g_proxy_address_get_destination_hostname:
25174 * @proxy: a #GProxyAddress
25176 * Gets @proxy's destination hostname; that is, the name of the host
25177 * that will be connected to via the proxy, not the name of the proxy
25180 * Returns: the @proxy's destination hostname
25186 * g_proxy_address_get_destination_port:
25187 * @proxy: a #GProxyAddress
25189 * Gets @proxy's destination port; that is, the port on the
25190 * destination host that will be connected to via the proxy, not the
25191 * port number of the proxy itself.
25193 * Returns: the @proxy's destination port
25199 * g_proxy_address_get_destination_protocol:
25200 * @proxy: a #GProxyAddress
25202 * Gets the protocol that is being spoken to the destination
25203 * server; eg, "http" or "ftp".
25205 * Returns: the @proxy's destination protocol
25211 * g_proxy_address_get_password:
25212 * @proxy: a #GProxyAddress
25214 * Gets @proxy's password.
25216 * Returns: the @proxy's password
25222 * g_proxy_address_get_protocol:
25223 * @proxy: a #GProxyAddress
25225 * Gets @proxy's protocol. eg, "socks" or "http"
25227 * Returns: the @proxy's protocol
25233 * g_proxy_address_get_uri:
25234 * @proxy: a #GProxyAddress
25236 * Gets the proxy URI that @proxy was constructed from.
25238 * Returns: the @proxy's URI, or %NULL if unknown
25244 * g_proxy_address_get_username:
25245 * @proxy: a #GProxyAddress
25247 * Gets @proxy's username.
25249 * Returns: the @proxy's username
25255 * g_proxy_address_new:
25256 * @inetaddr: The proxy server #GInetAddress.
25257 * @port: The proxy server port.
25258 * @protocol: The proxy protocol to support, in lower case (e.g. socks, http).
25259 * @dest_hostname: The destination hostname the proxy should tunnel to.
25260 * @dest_port: The destination port to tunnel to.
25261 * @username: (allow-none): The username to authenticate to the proxy server (or %NULL).
25262 * @password: (allow-none): The password to authenticate to the proxy server (or %NULL).
25264 * Creates a new #GProxyAddress for @inetaddr with @protocol that should
25265 * tunnel through @dest_hostname and @dest_port.
25267 * (Note that this method doesn't set the #GProxyAddress:uri or
25268 * #GProxyAddress:destination-protocol fields; use g_object_new()
25269 * directly if you want to set those.)
25271 * Returns: a new #GProxyAddress
25278 * @proxy: a #GProxy
25279 * @connection: a #GIOStream
25280 * @proxy_address: a #GProxyAddress
25281 * @cancellable: (allow-none): a #GCancellable
25282 * @error: return #GError
25284 * Given @connection to communicate with a proxy (eg, a
25285 * #GSocketConnection that is connected to the proxy server), this
25286 * does the necessary handshake to connect to @proxy_address, and if
25287 * required, wraps the #GIOStream to handle proxy payload.
25289 * Returns: (transfer full): a #GIOStream that will replace @connection. This might be the same as @connection, in which case a reference will be added.
25295 * g_proxy_connect_async:
25296 * @proxy: a #GProxy
25297 * @connection: a #GIOStream
25298 * @proxy_address: a #GProxyAddress
25299 * @cancellable: (allow-none): a #GCancellable
25300 * @callback: (scope async): a #GAsyncReadyCallback
25301 * @user_data: (closure): callback data
25303 * Asynchronous version of g_proxy_connect().
25310 * g_proxy_connect_finish:
25311 * @proxy: a #GProxy
25312 * @result: a #GAsyncResult
25313 * @error: return #GError
25315 * See g_proxy_connect().
25317 * Returns: (transfer full): a #GIOStream.
25323 * g_proxy_get_default_for_protocol:
25324 * @protocol: the proxy protocol name (e.g. http, socks, etc)
25326 * Lookup "gio-proxy" extension point for a proxy implementation that supports
25327 * specified protocol.
25329 * Returns: (transfer full): return a #GProxy or NULL if protocol is not supported.
25335 * g_proxy_resolver_get_default:
25337 * Gets the default #GProxyResolver for the system.
25339 * Returns: (transfer none): the default #GProxyResolver.
25345 * g_proxy_resolver_is_supported:
25346 * @resolver: a #GProxyResolver
25348 * Checks if @resolver can be used on this system. (This is used
25349 * internally; g_proxy_resolver_get_default() will only return a proxy
25350 * resolver that returns %TRUE for this method.)
25352 * Returns: %TRUE if @resolver is supported.
25358 * g_proxy_resolver_lookup:
25359 * @resolver: a #GProxyResolver
25360 * @uri: a URI representing the destination to connect to
25361 * @cancellable: (allow-none): a #GCancellable, or %NULL
25362 * @error: return location for a #GError, or %NULL
25364 * Looks into the system proxy configuration to determine what proxy,
25365 * if any, to use to connect to @uri. The returned proxy URIs are of the
25366 * form <literal><protocol>://[user[:password]@]host:port</literal>
25367 * or <literal>direct://</literal>, where <protocol> could be
25368 * http, rtsp, socks or other proxying protocol.
25370 * If you don't know what network protocol is being used on the
25371 * socket, you should use <literal>none</literal> as the URI protocol.
25372 * In this case, the resolver might still return a generic proxy type
25373 * (such as SOCKS), but would not return protocol-specific proxy types
25376 * <literal>direct://</literal> is used when no proxy is needed.
25377 * Direct connection should not be attempted unless it is part of the
25378 * returned array of proxies.
25380 * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
25386 * g_proxy_resolver_lookup_async:
25387 * @resolver: a #GProxyResolver
25388 * @uri: a URI representing the destination to connect to
25389 * @cancellable: (allow-none): a #GCancellable, or %NULL
25390 * @callback: (scope async): callback to call after resolution completes
25391 * @user_data: (closure): data for @callback
25393 * Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more
25401 * g_proxy_resolver_lookup_finish:
25402 * @resolver: a #GProxyResolver
25403 * @result: the result passed to your #GAsyncReadyCallback
25404 * @error: return location for a #GError, or %NULL
25406 * Call this function to obtain the array of proxy URIs when
25407 * g_proxy_resolver_lookup_async() is complete. See
25408 * g_proxy_resolver_lookup() for more details.
25410 * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
25416 * g_proxy_supports_hostname:
25417 * @proxy: a #GProxy
25419 * Some proxy protocols expect to be passed a hostname, which they
25420 * will resolve to an IP address themselves. Others, like SOCKS4, do
25421 * not allow this. This function will return %FALSE if @proxy is
25422 * implementing such a protocol. When %FALSE is returned, the caller
25423 * should resolve the destination hostname first, and then pass a
25424 * #GProxyAddress containing the stringified IP address to
25425 * g_proxy_connect() or g_proxy_connect_async().
25427 * Returns: %TRUE if hostname resolution is supported.
25433 * g_remote_action_group_activate_action_full:
25434 * @remote: a #GDBusActionGroup
25435 * @action_name: the name of the action to activate
25436 * @parameter: (allow-none): the optional parameter to the activation
25437 * @platform_data: the platform data to send
25439 * Activates the remote action.
25441 * This is the same as g_action_group_activate_action() except that it
25442 * allows for provision of "platform data" to be sent along with the
25443 * activation request. This typically contains details such as the user
25444 * interaction timestamp or startup notification information.
25446 * @platform_data must be non-%NULL and must have the type
25447 * %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed.
25454 * g_remote_action_group_change_action_state_full:
25455 * @remote: a #GRemoteActionGroup
25456 * @action_name: the name of the action to change the state of
25457 * @value: the new requested value for the state
25458 * @platform_data: the platform data to send
25460 * Changes the state of a remote action.
25462 * This is the same as g_action_group_change_action_state() except that
25463 * it allows for provision of "platform data" to be sent along with the
25464 * state change request. This typically contains details such as the
25465 * user interaction timestamp or startup notification information.
25467 * @platform_data must be non-%NULL and must have the type
25468 * %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed.
25475 * g_resolver_error_quark:
25477 * Gets the #GResolver Error Quark.
25479 * Returns: a #GQuark.
25485 * g_resolver_free_addresses: (skip)
25486 * @addresses: a #GList of #GInetAddress
25488 * Frees @addresses (which should be the return value from
25489 * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_finish()).
25490 * (This is a convenience method; you can also simply free the results
25498 * g_resolver_free_targets: (skip)
25499 * @targets: a #GList of #GSrvTarget
25501 * Frees @targets (which should be the return value from
25502 * g_resolver_lookup_service() or g_resolver_lookup_service_finish()).
25503 * (This is a convenience method; you can also simply free the
25504 * results by hand.)
25511 * g_resolver_get_default:
25513 * Gets the default #GResolver. You should unref it when you are done
25514 * with it. #GResolver may use its reference count as a hint about how
25515 * many threads it should allocate for concurrent DNS resolutions.
25517 * Returns: (transfer full): the default #GResolver.
25523 * g_resolver_lookup_by_address:
25524 * @resolver: a #GResolver
25525 * @address: the address to reverse-resolve
25526 * @cancellable: (allow-none): a #GCancellable, or %NULL
25527 * @error: return location for a #GError, or %NULL
25529 * Synchronously reverse-resolves @address to determine its
25530 * associated hostname.
25532 * If the DNS resolution fails, @error (if non-%NULL) will be set to
25533 * a value from #GResolverError.
25535 * If @cancellable is non-%NULL, it can be used to cancel the
25536 * operation, in which case @error (if non-%NULL) will be set to
25537 * %G_IO_ERROR_CANCELLED.
25539 * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
25545 * g_resolver_lookup_by_address_async:
25546 * @resolver: a #GResolver
25547 * @address: the address to reverse-resolve
25548 * @cancellable: (allow-none): a #GCancellable, or %NULL
25549 * @callback: (scope async): callback to call after resolution completes
25550 * @user_data: (closure): data for @callback
25552 * Begins asynchronously reverse-resolving @address to determine its
25553 * associated hostname, and eventually calls @callback, which must
25554 * call g_resolver_lookup_by_address_finish() to get the final result.
25561 * g_resolver_lookup_by_address_finish:
25562 * @resolver: a #GResolver
25563 * @result: the result passed to your #GAsyncReadyCallback
25564 * @error: return location for a #GError, or %NULL
25566 * Retrieves the result of a previous call to
25567 * g_resolver_lookup_by_address_async().
25569 * If the DNS resolution failed, @error (if non-%NULL) will be set to
25570 * a value from #GResolverError. If the operation was cancelled,
25571 * @error will be set to %G_IO_ERROR_CANCELLED.
25573 * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
25579 * g_resolver_lookup_by_name:
25580 * @resolver: a #GResolver
25581 * @hostname: the hostname to look up
25582 * @cancellable: (allow-none): a #GCancellable, or %NULL
25583 * @error: return location for a #GError, or %NULL
25585 * Synchronously resolves @hostname to determine its associated IP
25586 * address(es). @hostname may be an ASCII-only or UTF-8 hostname, or
25587 * the textual form of an IP address (in which case this just becomes
25588 * a wrapper around g_inet_address_new_from_string()).
25590 * On success, g_resolver_lookup_by_name() will return a #GList of
25591 * #GInetAddress, sorted in order of preference and guaranteed to not
25592 * contain duplicates. That is, if using the result to connect to
25593 * @hostname, you should attempt to connect to the first address
25594 * first, then the second if the first fails, etc. If you are using
25595 * the result to listen on a socket, it is appropriate to add each
25596 * result using e.g. g_socket_listener_add_address().
25598 * If the DNS resolution fails, @error (if non-%NULL) will be set to a
25599 * value from #GResolverError.
25601 * If @cancellable is non-%NULL, it can be used to cancel the
25602 * operation, in which case @error (if non-%NULL) will be set to
25603 * %G_IO_ERROR_CANCELLED.
25605 * If you are planning to connect to a socket on the resolved IP
25606 * address, it may be easier to create a #GNetworkAddress and use its
25607 * #GSocketConnectable interface.
25609 * 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.)
25615 * g_resolver_lookup_by_name_async:
25616 * @resolver: a #GResolver
25617 * @hostname: the hostname to look up the address of
25618 * @cancellable: (allow-none): a #GCancellable, or %NULL
25619 * @callback: (scope async): callback to call after resolution completes
25620 * @user_data: (closure): data for @callback
25622 * Begins asynchronously resolving @hostname to determine its
25623 * associated IP address(es), and eventually calls @callback, which
25624 * must call g_resolver_lookup_by_name_finish() to get the result.
25625 * See g_resolver_lookup_by_name() for more details.
25632 * g_resolver_lookup_by_name_finish:
25633 * @resolver: a #GResolver
25634 * @result: the result passed to your #GAsyncReadyCallback
25635 * @error: return location for a #GError, or %NULL
25637 * Retrieves the result of a call to
25638 * g_resolver_lookup_by_name_async().
25640 * If the DNS resolution failed, @error (if non-%NULL) will be set to
25641 * a value from #GResolverError. If the operation was cancelled,
25642 * @error will be set to %G_IO_ERROR_CANCELLED.
25644 * Returns: (element-type GInetAddress) (transfer full): a #GList of #GInetAddress, or %NULL on error. See g_resolver_lookup_by_name() for more details.
25650 * g_resolver_lookup_records:
25651 * @resolver: a #GResolver
25652 * @rrname: the DNS name to lookup the record for
25653 * @record_type: the type of DNS record to lookup
25654 * @cancellable: (allow-none): a #GCancellable, or %NULL
25655 * @error: return location for a #GError, or %NULL
25657 * Synchronously performs a DNS record lookup for the given @rrname and returns
25658 * a list of records as #GVariant tuples. See #GResolverRecordType for
25659 * information on what the records contain for each @record_type.
25661 * If the DNS resolution fails, @error (if non-%NULL) will be set to
25662 * a value from #GResolverError.
25664 * If @cancellable is non-%NULL, it can be used to cancel the
25665 * operation, in which case @error (if non-%NULL) will be set to
25666 * %G_IO_ERROR_CANCELLED.
25668 * 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.)
25674 * g_resolver_lookup_records_async:
25675 * @resolver: a #GResolver
25676 * @rrname: the DNS name to lookup the record for
25677 * @record_type: the type of DNS record to lookup
25678 * @cancellable: (allow-none): a #GCancellable, or %NULL
25679 * @callback: (scope async): callback to call after resolution completes
25680 * @user_data: (closure): data for @callback
25682 * Begins asynchronously performing a DNS lookup for the given
25683 * @rrname, and eventually calls @callback, which must call
25684 * g_resolver_lookup_records_finish() to get the final result. See
25685 * g_resolver_lookup_records() for more details.
25692 * g_resolver_lookup_records_finish:
25693 * @resolver: a #GResolver
25694 * @result: the result passed to your #GAsyncReadyCallback
25695 * @error: return location for a #GError, or %NULL
25697 * Retrieves the result of a previous call to
25698 * g_resolver_lookup_records_async(). Returns a list of records as #GVariant
25699 * tuples. See #GResolverRecordType for information on what the records contain.
25701 * If the DNS resolution failed, @error (if non-%NULL) will be set to
25702 * a value from #GResolverError. If the operation was cancelled,
25703 * @error will be set to %G_IO_ERROR_CANCELLED.
25705 * 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.)
25711 * g_resolver_lookup_service:
25712 * @resolver: a #GResolver
25713 * @service: the service type to look up (eg, "ldap")
25714 * @protocol: the networking protocol to use for @service (eg, "tcp")
25715 * @domain: the DNS domain to look up the service in
25716 * @cancellable: (allow-none): a #GCancellable, or %NULL
25717 * @error: return location for a #GError, or %NULL
25719 * Synchronously performs a DNS SRV lookup for the given @service and
25720 * @protocol in the given @domain and returns an array of #GSrvTarget.
25721 * @domain may be an ASCII-only or UTF-8 hostname. Note also that the
25722 * @service and @protocol arguments <emphasis>do not</emphasis>
25723 * include the leading underscore that appears in the actual DNS
25726 * On success, g_resolver_lookup_service() will return a #GList of
25727 * #GSrvTarget, sorted in order of preference. (That is, you should
25728 * attempt to connect to the first target first, then the second if
25729 * the first fails, etc.)
25731 * If the DNS resolution fails, @error (if non-%NULL) will be set to
25732 * a value from #GResolverError.
25734 * If @cancellable is non-%NULL, it can be used to cancel the
25735 * operation, in which case @error (if non-%NULL) will be set to
25736 * %G_IO_ERROR_CANCELLED.
25738 * If you are planning to connect to the service, it is usually easier
25739 * to create a #GNetworkService and use its #GSocketConnectable
25742 * 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.)
25748 * g_resolver_lookup_service_async:
25749 * @resolver: a #GResolver
25750 * @service: the service type to look up (eg, "ldap")
25751 * @protocol: the networking protocol to use for @service (eg, "tcp")
25752 * @domain: the DNS domain to look up the service in
25753 * @cancellable: (allow-none): a #GCancellable, or %NULL
25754 * @callback: (scope async): callback to call after resolution completes
25755 * @user_data: (closure): data for @callback
25757 * Begins asynchronously performing a DNS SRV lookup for the given
25758 * @service and @protocol in the given @domain, and eventually calls
25759 * @callback, which must call g_resolver_lookup_service_finish() to
25760 * get the final result. See g_resolver_lookup_service() for more
25768 * g_resolver_lookup_service_finish:
25769 * @resolver: a #GResolver
25770 * @result: the result passed to your #GAsyncReadyCallback
25771 * @error: return location for a #GError, or %NULL
25773 * Retrieves the result of a previous call to
25774 * g_resolver_lookup_service_async().
25776 * If the DNS resolution failed, @error (if non-%NULL) will be set to
25777 * a value from #GResolverError. If the operation was cancelled,
25778 * @error will be set to %G_IO_ERROR_CANCELLED.
25780 * Returns: (element-type GSrvTarget) (transfer full): a #GList of #GSrvTarget, or %NULL on error. See g_resolver_lookup_service() for more details.
25786 * g_resolver_set_default:
25787 * @resolver: the new default #GResolver
25789 * Sets @resolver to be the application's default resolver (reffing
25790 * @resolver, and unreffing the previous default resolver, if any).
25791 * Future calls to g_resolver_get_default() will return this resolver.
25793 * This can be used if an application wants to perform any sort of DNS
25794 * caching or "pinning"; it can implement its own #GResolver that
25795 * calls the original default resolver for DNS operations, and
25796 * implements its own cache policies on top of that, and then set
25797 * itself as the default resolver for all later code to use.
25804 * g_resource_enumerate_children:
25805 * @resource: A #GResource
25806 * @path: A pathname inside the resource
25807 * @lookup_flags: A #GResourceLookupFlags
25808 * @error: return location for a #GError, or %NULL
25810 * Returns all the names of children at the specified @path in the resource.
25811 * The return result is a %NULL terminated list of strings which should
25812 * be released with g_strfreev().
25814 * @lookup_flags controls the behaviour of the lookup.
25816 * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
25822 * g_resource_error_quark:
25824 * Gets the #GResource Error Quark.
25826 * Returns: a #GQuark
25832 * g_resource_get_info:
25833 * @resource: A #GResource
25834 * @path: A pathname inside the resource
25835 * @lookup_flags: A #GResourceLookupFlags
25836 * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
25837 * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
25838 * @error: return location for a #GError, or %NULL
25840 * Looks for a file at the specified @path in the resource and
25841 * if found returns information about it.
25843 * @lookup_flags controls the behaviour of the lookup.
25845 * Returns: %TRUE if the file was found. %FALSE if there were errors
25852 * @filename: (type filename): the path of a filename to load, in the GLib filename encoding
25853 * @error: return location for a #GError, or %NULL
25855 * Loads a binary resource bundle and creates a #GResource representation of it, allowing
25856 * you to query it for data.
25858 * If you want to use this resource in the global resource namespace you need
25859 * to register it with g_resources_register().
25861 * Returns: (transfer full): a new #GResource, or %NULL on error
25867 * g_resource_lookup_data:
25868 * @resource: A #GResource
25869 * @path: A pathname inside the resource
25870 * @lookup_flags: A #GResourceLookupFlags
25871 * @error: return location for a #GError, or %NULL
25873 * Looks for a file at the specified @path in the resource and
25874 * returns a #GBytes that lets you directly access the data in
25877 * The data is always followed by a zero byte, so you
25878 * can safely use the data as a C string. However, that byte
25879 * is not included in the size of the GBytes.
25881 * For uncompressed resource files this is a pointer directly into
25882 * the resource bundle, which is typically in some readonly data section
25883 * in the program binary. For compressed files we allocate memory on
25884 * the heap and automatically uncompress the data.
25886 * @lookup_flags controls the behaviour of the lookup.
25888 * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
25894 * g_resource_new_from_data:
25896 * @error: return location for a #GError, or %NULL
25898 * Creates a GResource from a reference to the binary resource bundle.
25899 * This will keep a reference to @data while the resource lives, so
25900 * the data should not be modified or freed.
25902 * If you want to use this resource in the global resource namespace you need
25903 * to register it with g_resources_register().
25905 * Returns: (transfer full): a new #GResource, or %NULL on error
25911 * g_resource_open_stream:
25912 * @resource: A #GResource
25913 * @path: A pathname inside the resource
25914 * @lookup_flags: A #GResourceLookupFlags
25915 * @error: return location for a #GError, or %NULL
25917 * Looks for a file at the specified @path in the resource and
25918 * returns a #GInputStream that lets you read the data.
25920 * @lookup_flags controls the behaviour of the lookup.
25922 * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
25929 * @resource: A #GResource
25931 * Atomically increments the reference count of @array by one. This
25932 * function is MT-safe and may be called from any thread.
25934 * Returns: The passed in #GResource
25940 * g_resource_unref:
25941 * @resource: A #GResource
25943 * Atomically decrements the reference count of @resource by one. If the
25944 * reference count drops to 0, all memory allocated by the array is
25945 * released. This function is MT-safe and may be called from any
25953 * g_resources_enumerate_children:
25954 * @path: A pathname inside the resource
25955 * @lookup_flags: A #GResourceLookupFlags
25956 * @error: return location for a #GError, or %NULL
25958 * Returns all the names of children at the specified @path in the set of
25959 * globally registered resources.
25960 * The return result is a %NULL terminated list of strings which should
25961 * be released with g_strfreev().
25963 * @lookup_flags controls the behaviour of the lookup.
25965 * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
25971 * g_resources_get_info:
25972 * @path: A pathname inside the resource
25973 * @lookup_flags: A #GResourceLookupFlags
25974 * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
25975 * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
25976 * @error: return location for a #GError, or %NULL
25978 * Looks for a file at the specified @path in the set of
25979 * globally registered resources and if found returns information about it.
25981 * @lookup_flags controls the behaviour of the lookup.
25983 * Returns: %TRUE if the file was found. %FALSE if there were errors
25989 * g_resources_lookup_data:
25990 * @path: A pathname inside the resource
25991 * @lookup_flags: A #GResourceLookupFlags
25992 * @error: return location for a #GError, or %NULL
25994 * Looks for a file at the specified @path in the set of
25995 * globally registered resources and returns a #GBytes that
25996 * lets you directly access the data in memory.
25998 * The data is always followed by a zero byte, so you
25999 * can safely use the data as a C string. However, that byte
26000 * is not included in the size of the GBytes.
26002 * For uncompressed resource files this is a pointer directly into
26003 * the resource bundle, which is typically in some readonly data section
26004 * in the program binary. For compressed files we allocate memory on
26005 * the heap and automatically uncompress the data.
26007 * @lookup_flags controls the behaviour of the lookup.
26009 * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
26015 * g_resources_open_stream:
26016 * @path: A pathname inside the resource
26017 * @lookup_flags: A #GResourceLookupFlags
26018 * @error: return location for a #GError, or %NULL
26020 * Looks for a file at the specified @path in the set of
26021 * globally registered resources and returns a #GInputStream
26022 * that lets you read the data.
26024 * @lookup_flags controls the behaviour of the lookup.
26026 * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
26032 * g_resources_register:
26033 * @resource: A #GResource
26035 * Registers the resource with the process-global set of resources.
26036 * Once a resource is registered the files in it can be accessed
26037 * with the global resource lookup functions like g_resources_lookup_data().
26044 * g_resources_unregister:
26045 * @resource: A #GResource
26047 * Unregisters the resource from the process-global set of resources.
26054 * g_seekable_can_seek:
26055 * @seekable: a #GSeekable.
26057 * Tests if the stream supports the #GSeekableIface.
26059 * Returns: %TRUE if @seekable can be seeked. %FALSE otherwise.
26064 * g_seekable_can_truncate:
26065 * @seekable: a #GSeekable.
26067 * Tests if the stream can be truncated.
26069 * Returns: %TRUE if the stream can be truncated, %FALSE otherwise.
26075 * @seekable: a #GSeekable.
26076 * @offset: a #goffset.
26077 * @type: a #GSeekType.
26078 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
26079 * @error: a #GError location to store the error occurring, or %NULL to ignore.
26081 * Seeks in the stream by the given @offset, modified by @type.
26083 * If @cancellable is not %NULL, then the operation can be cancelled by
26084 * triggering the cancellable object from another thread. If the operation
26085 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
26087 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
26093 * @seekable: a #GSeekable.
26095 * Tells the current position within the stream.
26097 * Returns: the offset from the beginning of the buffer.
26102 * g_seekable_truncate:
26103 * @seekable: a #GSeekable.
26104 * @offset: a #goffset.
26105 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
26106 * @error: a #GError location to store the error occurring, or %NULL to ignore.
26108 * Truncates a stream with a given #offset.
26110 * If @cancellable is not %NULL, then the operation can be cancelled by
26111 * triggering the cancellable object from another thread. If the operation
26112 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
26113 * operation was partially finished when the operation was cancelled the
26114 * partial result will be returned, without an error.
26116 * Virtual: truncate_fn
26117 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
26122 * g_settings_apply:
26123 * @settings: a #GSettings instance
26125 * Applies any changes that have been made to the settings. This
26126 * function does nothing unless @settings is in 'delay-apply' mode;
26127 * see g_settings_delay(). In the normal case settings are always
26128 * applied immediately.
26133 * g_settings_backend_changed:
26134 * @backend: a #GSettingsBackend implementation
26135 * @key: the name of the key
26136 * @origin_tag: the origin tag
26138 * Signals that a single key has possibly changed. Backend
26139 * implementations should call this if a key has possibly changed its
26142 * @key must be a valid key (ie starting with a slash, not containing
26143 * '//', and not ending with a slash).
26145 * The implementation must call this function during any call to
26146 * g_settings_backend_write(), before the call returns (except in the
26147 * case that no keys are actually changed and it cares to detect this
26148 * fact). It may not rely on the existence of a mainloop for
26149 * dispatching the signal later.
26151 * The implementation may call this function at any other time it likes
26152 * in response to other events (such as changes occurring outside of the
26153 * program). These calls may originate from a mainloop or may originate
26154 * in response to any other action (including from calls to
26155 * g_settings_backend_write()).
26157 * In the case that this call is in response to a call to
26158 * g_settings_backend_write() then @origin_tag must be set to the same
26159 * value that was passed to that call.
26166 * g_settings_backend_changed_tree:
26167 * @backend: a #GSettingsBackend implementation
26168 * @tree: a #GTree containing the changes
26169 * @origin_tag: the origin tag
26171 * This call is a convenience wrapper. It gets the list of changes from
26172 * @tree, computes the longest common prefix and calls
26173 * g_settings_backend_changed().
26180 * g_settings_backend_flatten_tree:
26181 * @tree: a #GTree containing the changes
26182 * @path: (out): the location to save the path
26183 * @keys: (out) (transfer container) (array zero-terminated=1): the location to save the relative keys
26184 * @values: (out) (allow-none) (transfer container) (array zero-terminated=1): the location to save the values, or %NULL
26186 * Calculate the longest common prefix of all keys in a tree and write
26187 * out an array of the key names relative to that prefix and,
26188 * optionally, the value to store at each of those keys.
26190 * You must free the value returned in @path, @keys and @values using
26191 * g_free(). You should not attempt to free or unref the contents of
26192 * @keys or @values.
26199 * g_settings_backend_get_default:
26201 * Returns the default #GSettingsBackend. It is possible to override
26202 * the default by setting the <envar>GSETTINGS_BACKEND</envar>
26203 * environment variable to the name of a settings backend.
26205 * The user gets a reference to the backend.
26207 * Returns: (transfer full): the default #GSettingsBackend
26213 * g_settings_backend_keys_changed:
26214 * @backend: a #GSettingsBackend implementation
26215 * @path: the path containing the changes
26216 * @items: (array zero-terminated=1): the %NULL-terminated list of changed keys
26217 * @origin_tag: the origin tag
26219 * Signals that a list of keys have possibly changed. Backend
26220 * implementations should call this if keys have possibly changed their
26223 * @path must be a valid path (ie starting and ending with a slash and
26224 * not containing '//'). Each string in @items must form a valid key
26225 * name when @path is prefixed to it (ie: each item must not start or
26226 * end with '/' and must not contain '//').
26228 * The meaning of this signal is that any of the key names resulting
26229 * from the contatenation of @path with each item in @items may have
26232 * The same rules for when notifications must occur apply as per
26233 * g_settings_backend_changed(). These two calls can be used
26234 * interchangeably if exactly one item has changed (although in that
26235 * case g_settings_backend_changed() is definitely preferred).
26237 * For efficiency reasons, the implementation should strive for @path to
26238 * be as long as possible (ie: the longest common prefix of all of the
26239 * keys that were changed) but this is not strictly required.
26246 * g_settings_backend_path_changed:
26247 * @backend: a #GSettingsBackend implementation
26248 * @path: the path containing the changes
26249 * @origin_tag: the origin tag
26251 * Signals that all keys below a given path may have possibly changed.
26252 * Backend implementations should call this if an entire path of keys
26253 * have possibly changed their values.
26255 * @path must be a valid path (ie starting and ending with a slash and
26256 * not containing '//').
26258 * The meaning of this signal is that any of the key which has a name
26259 * starting with @path may have changed.
26261 * The same rules for when notifications must occur apply as per
26262 * g_settings_backend_changed(). This call might be an appropriate
26263 * reasponse to a 'reset' call but implementations are also free to
26264 * explicitly list the keys that were affected by that call if they can
26267 * For efficiency reasons, the implementation should strive for @path to
26268 * be as long as possible (ie: the longest common prefix of all of the
26269 * keys that were changed) but this is not strictly required. As an
26270 * example, if this function is called with the path of "/" then every
26271 * single key in the application will be notified of a possible change.
26278 * g_settings_backend_path_writable_changed:
26279 * @backend: a #GSettingsBackend implementation
26280 * @path: the name of the path
26282 * Signals that the writability of all keys below a given path may have
26285 * Since GSettings performs no locking operations for itself, this call
26286 * will always be made in response to external events.
26293 * g_settings_backend_writable_changed:
26294 * @backend: a #GSettingsBackend implementation
26295 * @key: the name of the key
26297 * Signals that the writability of a single key has possibly changed.
26299 * Since GSettings performs no locking operations for itself, this call
26300 * will always be made in response to external events.
26308 * @settings: a #GSettings object
26309 * @key: the key to bind
26310 * @object: (type GObject.Object): a #GObject
26311 * @property: the name of the property to bind
26312 * @flags: flags for the binding
26314 * Create a binding between the @key in the @settings object
26315 * and the property @property of @object.
26317 * The binding uses the default GIO mapping functions to map
26318 * between the settings and property values. These functions
26319 * handle booleans, numeric types and string types in a
26320 * straightforward way. Use g_settings_bind_with_mapping() if
26321 * you need a custom mapping, or map between types that are not
26322 * supported by the default mapping functions.
26324 * Unless the @flags include %G_SETTINGS_BIND_NO_SENSITIVITY, this
26325 * function also establishes a binding between the writability of
26326 * @key and the "sensitive" property of @object (if @object has
26327 * a boolean property by that name). See g_settings_bind_writable()
26328 * for more details about writable bindings.
26330 * Note that the lifecycle of the binding is tied to the object,
26331 * and that you can have only one binding per object property.
26332 * If you bind the same property twice on the same object, the second
26333 * binding overrides the first one.
26340 * g_settings_bind_with_mapping: (skip)
26341 * @settings: a #GSettings object
26342 * @key: the key to bind
26343 * @object: (type GObject.Object): a #GObject
26344 * @property: the name of the property to bind
26345 * @flags: flags for the binding
26346 * @get_mapping: a function that gets called to convert values from @settings to @object, or %NULL to use the default GIO mapping
26347 * @set_mapping: a function that gets called to convert values from @object to @settings, or %NULL to use the default GIO mapping
26348 * @user_data: data that gets passed to @get_mapping and @set_mapping
26349 * @destroy: #GDestroyNotify function for @user_data
26351 * Create a binding between the @key in the @settings object
26352 * and the property @property of @object.
26354 * The binding uses the provided mapping functions to map between
26355 * settings and property values.
26357 * Note that the lifecycle of the binding is tied to the object,
26358 * and that you can have only one binding per object property.
26359 * If you bind the same property twice on the same object, the second
26360 * binding overrides the first one.
26367 * g_settings_bind_writable:
26368 * @settings: a #GSettings object
26369 * @key: the key to bind
26370 * @object: (type GObject.Object): a #GObject
26371 * @property: the name of a boolean property to bind
26372 * @inverted: whether to 'invert' the value
26374 * Create a binding between the writability of @key in the
26375 * @settings object and the property @property of @object.
26376 * The property must be boolean; "sensitive" or "visible"
26377 * properties of widgets are the most likely candidates.
26379 * Writable bindings are always uni-directional; changes of the
26380 * writability of the setting will be propagated to the object
26381 * property, not the other way.
26383 * When the @inverted argument is %TRUE, the binding inverts the
26384 * value as it passes from the setting to the object, i.e. @property
26385 * will be set to %TRUE if the key is <emphasis>not</emphasis>
26388 * Note that the lifecycle of the binding is tied to the object,
26389 * and that you can have only one binding per object property.
26390 * If you bind the same property twice on the same object, the second
26391 * binding overrides the first one.
26398 * g_settings_create_action:
26399 * @settings: a #GSettings
26400 * @key: the name of a key in @settings
26402 * Creates a #GAction corresponding to a given #GSettings key.
26404 * The action has the same name as the key.
26406 * The value of the key becomes the state of the action and the action
26407 * is enabled when the key is writable. Changing the state of the
26408 * action results in the key being written to. Changes to the value or
26409 * writability of the key cause appropriate change notifications to be
26410 * emitted for the action.
26412 * For boolean-valued keys, action activations take no parameter and
26413 * result in the toggling of the value. For all other types,
26414 * activations take the new value for the key (which must have the
26417 * Returns: (transfer full): a new #GAction
26423 * g_settings_delay:
26424 * @settings: a #GSettings object
26426 * Changes the #GSettings object into 'delay-apply' mode. In this
26427 * mode, changes to @settings are not immediately propagated to the
26428 * backend, but kept locally until g_settings_apply() is called.
26436 * @settings: a #GSettings object
26437 * @key: the key to get the value for
26438 * @format: a #GVariant format string
26439 * @...: arguments as per @format
26441 * Gets the value that is stored at @key in @settings.
26443 * A convenience function that combines g_settings_get_value() with
26446 * It is a programmer error to give a @key that isn't contained in the
26447 * schema for @settings or for the #GVariantType of @format to mismatch
26448 * the type given in the schema.
26455 * g_settings_get_boolean:
26456 * @settings: a #GSettings object
26457 * @key: the key to get the value for
26459 * Gets the value that is stored at @key in @settings.
26461 * A convenience variant of g_settings_get() for booleans.
26463 * It is a programmer error to give a @key that isn't specified as
26464 * having a boolean type in the schema for @settings.
26466 * Returns: a boolean
26472 * g_settings_get_child:
26473 * @settings: a #GSettings object
26474 * @name: the name of the 'child' schema
26476 * Creates a 'child' settings object which has a base path of
26477 * <replaceable>base-path</replaceable>/@name, where
26478 * <replaceable>base-path</replaceable> is the base path of @settings.
26480 * The schema for the child settings object must have been declared
26481 * in the schema of @settings using a <tag class="starttag">child</tag> element.
26483 * Returns: (transfer full): a 'child' settings object
26489 * g_settings_get_double:
26490 * @settings: a #GSettings object
26491 * @key: the key to get the value for
26493 * Gets the value that is stored at @key in @settings.
26495 * A convenience variant of g_settings_get() for doubles.
26497 * It is a programmer error to give a @key that isn't specified as
26498 * having a 'double' type in the schema for @settings.
26500 * Returns: a double
26506 * g_settings_get_enum:
26507 * @settings: a #GSettings object
26508 * @key: the key to get the value for
26510 * Gets the value that is stored in @settings for @key and converts it
26511 * to the enum value that it represents.
26513 * In order to use this function the type of the value must be a string
26514 * and it must be marked in the schema file as an enumerated type.
26516 * It is a programmer error to give a @key that isn't contained in the
26517 * schema for @settings or is not marked as an enumerated type.
26519 * If the value stored in the configuration database is not a valid
26520 * value for the enumerated type then this function will return the
26523 * Returns: the enum value
26529 * g_settings_get_flags:
26530 * @settings: a #GSettings object
26531 * @key: the key to get the value for
26533 * Gets the value that is stored in @settings for @key and converts it
26534 * to the flags value that it represents.
26536 * In order to use this function the type of the value must be an array
26537 * of strings and it must be marked in the schema file as an flags type.
26539 * It is a programmer error to give a @key that isn't contained in the
26540 * schema for @settings or is not marked as a flags type.
26542 * If the value stored in the configuration database is not a valid
26543 * value for the flags type then this function will return the default
26546 * Returns: the flags value
26552 * g_settings_get_has_unapplied:
26553 * @settings: a #GSettings object
26555 * Returns whether the #GSettings object has any unapplied
26556 * changes. This can only be the case if it is in 'delayed-apply' mode.
26558 * Returns: %TRUE if @settings has unapplied changes
26564 * g_settings_get_int:
26565 * @settings: a #GSettings object
26566 * @key: the key to get the value for
26568 * Gets the value that is stored at @key in @settings.
26570 * A convenience variant of g_settings_get() for 32-bit integers.
26572 * It is a programmer error to give a @key that isn't specified as
26573 * having a int32 type in the schema for @settings.
26575 * Returns: an integer
26581 * g_settings_get_mapped:
26582 * @settings: a #GSettings object
26583 * @key: the key to get the value for
26584 * @mapping: (scope call): the function to map the value in the settings database to the value used by the application
26585 * @user_data: user data for @mapping
26587 * Gets the value that is stored at @key in @settings, subject to
26588 * application-level validation/mapping.
26590 * You should use this function when the application needs to perform
26591 * some processing on the value of the key (for example, parsing). The
26592 * @mapping function performs that processing. If the function
26593 * indicates that the processing was unsuccessful (due to a parse error,
26594 * for example) then the mapping is tried again with another value.
26596 * This allows a robust 'fall back to defaults' behaviour to be
26597 * implemented somewhat automatically.
26599 * The first value that is tried is the user's setting for the key. If
26600 * the mapping function fails to map this value, other values may be
26601 * tried in an unspecified order (system or site defaults, translated
26602 * schema default values, untranslated schema default values, etc).
26604 * If the mapping function fails for all possible values, one additional
26605 * attempt is made: the mapping function is called with a %NULL value.
26606 * If the mapping function still indicates failure at this point then
26607 * the application will be aborted.
26609 * The result parameter for the @mapping function is pointed to a
26610 * #gpointer which is initially set to %NULL. The same pointer is given
26611 * to each invocation of @mapping. The final value of that #gpointer is
26612 * what is returned by this function. %NULL is valid; it is returned
26613 * just as any other value would be.
26615 * Returns: (transfer full): the result, which may be %NULL
26620 * g_settings_get_range:
26621 * @settings: a #GSettings
26622 * @key: the key to query the range of
26624 * Queries the range of a key.
26626 * This function will return a #GVariant that fully describes the range
26627 * of values that are valid for @key.
26629 * The type of #GVariant returned is <literal>(sv)</literal>. The
26630 * string describes the type of range restriction in effect. The type
26631 * and meaning of the value contained in the variant depends on the
26634 * If the string is <literal>'type'</literal> then the variant contains
26635 * an empty array. The element type of that empty array is the expected
26636 * type of value and all values of that type are valid.
26638 * If the string is <literal>'enum'</literal> then the variant contains
26639 * an array enumerating the possible values. Each item in the array is
26640 * a possible valid value and no other values are valid.
26642 * If the string is <literal>'flags'</literal> then the variant contains
26643 * an array. Each item in the array is a value that may appear zero or
26644 * one times in an array to be used as the value for this key. For
26645 * example, if the variant contained the array <literal>['x',
26646 * 'y']</literal> then the valid values for the key would be
26647 * <literal>[]</literal>, <literal>['x']</literal>,
26648 * <literal>['y']</literal>, <literal>['x', 'y']</literal> and
26649 * <literal>['y', 'x']</literal>.
26651 * Finally, if the string is <literal>'range'</literal> then the variant
26652 * contains a pair of like-typed values -- the minimum and maximum
26653 * permissible values for this key.
26655 * This information should not be used by normal programs. It is
26656 * considered to be a hint for introspection purposes. Normal programs
26657 * should already know what is permitted by their own schema. The
26658 * format may change in any way in the future -- but particularly, new
26659 * forms may be added to the possibilities described above.
26661 * It is a programmer error to give a @key that isn't contained in the
26662 * schema for @settings.
26664 * You should free the returned value with g_variant_unref() when it is
26665 * no longer needed.
26667 * Returns: a #GVariant describing the range
26673 * g_settings_get_string:
26674 * @settings: a #GSettings object
26675 * @key: the key to get the value for
26677 * Gets the value that is stored at @key in @settings.
26679 * A convenience variant of g_settings_get() for strings.
26681 * It is a programmer error to give a @key that isn't specified as
26682 * having a string type in the schema for @settings.
26684 * Returns: a newly-allocated string
26690 * g_settings_get_strv:
26691 * @settings: a #GSettings object
26692 * @key: the key to get the value for
26694 * A convenience variant of g_settings_get() for string arrays.
26696 * It is a programmer error to give a @key that isn't specified as
26697 * having an array of strings type in the schema for @settings.
26699 * Returns: (array zero-terminated=1) (transfer full): a newly-allocated, %NULL-terminated array of strings, the value that is stored at @key in @settings.
26705 * g_settings_get_uint:
26706 * @settings: a #GSettings object
26707 * @key: the key to get the value for
26709 * Gets the value that is stored at @key in @settings.
26711 * A convenience variant of g_settings_get() for 32-bit unsigned
26714 * It is a programmer error to give a @key that isn't specified as
26715 * having a uint32 type in the schema for @settings.
26717 * Returns: an unsigned integer
26723 * g_settings_get_value:
26724 * @settings: a #GSettings object
26725 * @key: the key to get the value for
26727 * Gets the value that is stored in @settings for @key.
26729 * It is a programmer error to give a @key that isn't contained in the
26730 * schema for @settings.
26732 * Returns: a new #GVariant
26738 * g_settings_is_writable:
26739 * @settings: a #GSettings object
26740 * @name: the name of a key
26742 * Finds out if a key can be written or not
26744 * Returns: %TRUE if the key @name is writable
26750 * g_settings_list_children:
26751 * @settings: a #GSettings object
26753 * Gets the list of children on @settings.
26755 * The list is exactly the list of strings for which it is not an error
26756 * to call g_settings_get_child().
26758 * For GSettings objects that are lists, this value can change at any
26759 * time and you should connect to the "children-changed" signal to watch
26760 * for those changes. Note that there is a race condition here: you may
26761 * request a child after listing it only for it to have been destroyed
26762 * in the meantime. For this reason, g_settings_get_child() may return
26763 * %NULL even for a child that was listed by this function.
26765 * For GSettings objects that are not lists, you should probably not be
26766 * calling this function from "normal" code (since you should already
26767 * know what children are in your schema). This function may still be
26768 * useful there for introspection reasons, however.
26770 * You should free the return value with g_strfreev() when you are done
26773 * Returns: (transfer full) (element-type utf8): a list of the children on @settings
26778 * g_settings_list_keys:
26779 * @settings: a #GSettings object
26781 * Introspects the list of keys on @settings.
26783 * You should probably not be calling this function from "normal" code
26784 * (since you should already know what keys are in your schema). This
26785 * function is intended for introspection reasons.
26787 * You should free the return value with g_strfreev() when you are done
26790 * Returns: (transfer full) (element-type utf8): a list of the keys on @settings
26795 * g_settings_list_relocatable_schemas:
26797 * Gets a list of the relocatable #GSettings schemas installed on the
26798 * system. These are schemas that do not provide their own path. It is
26799 * usual to instantiate these schemas directly, but if you want to you
26800 * can use g_settings_new_with_path() to specify the path.
26802 * The output of this function, taken together with the output of
26803 * g_settings_list_schemas() represents the complete list of all
26804 * installed schemas.
26806 * Returns: (element-type utf8) (transfer none): a list of relocatable #GSettings schemas that are available. The list must not be modified or freed.
26812 * g_settings_list_schemas:
26814 * Gets a list of the #GSettings schemas installed on the system. The
26815 * returned list is exactly the list of schemas for which you may call
26816 * g_settings_new() without adverse effects.
26818 * This function does not list the schemas that do not provide their own
26819 * paths (ie: schemas for which you must use
26820 * g_settings_new_with_path()). See
26821 * g_settings_list_relocatable_schemas() for that.
26823 * Returns: (element-type utf8) (transfer none): a list of #GSettings schemas that are available. The list must not be modified or freed.
26830 * @schema_id: the id of the schema
26832 * Creates a new #GSettings object with the schema specified by
26835 * Signals on the newly created #GSettings object will be dispatched
26836 * via the thread-default #GMainContext in effect at the time of the
26837 * call to g_settings_new(). The new #GSettings will hold a reference
26838 * on the context. See g_main_context_push_thread_default().
26840 * Returns: a new #GSettings object
26846 * g_settings_new_full:
26847 * @schema: a #GSettingsSchema
26848 * @backend: (allow-none): a #GSettingsBackend
26849 * @path: (allow-none): the path to use
26851 * Creates a new #GSettings object with a given schema, backend and
26854 * It should be extremely rare that you ever want to use this function.
26855 * It is made available for advanced use-cases (such as plugin systems
26856 * that want to provide access to schemas loaded from custom locations,
26859 * At the most basic level, a #GSettings object is a pure composition of
26860 * 4 things: a #GSettingsSchema, a #GSettingsBackend, a path within that
26861 * backend, and a #GMainContext to which signals are dispatched.
26863 * This constructor therefore gives you full control over constructing
26864 * #GSettings instances. The first 4 parameters are given directly as
26865 * @schema, @backend and @path, and the main context is taken from the
26866 * thread-default (as per g_settings_new()).
26868 * If @backend is %NULL then the default backend is used.
26870 * If @path is %NULL then the path from the schema is used. It is an
26871 * error f @path is %NULL and the schema has no path of its own or if
26872 * @path is non-%NULL and not equal to the path that the schema does
26875 * Returns: a new #GSettings object
26881 * g_settings_new_with_backend:
26882 * @schema_id: the id of the schema
26883 * @backend: the #GSettingsBackend to use
26885 * Creates a new #GSettings object with the schema specified by
26886 * @schema_id and a given #GSettingsBackend.
26888 * Creating a #GSettings object with a different backend allows accessing
26889 * settings from a database other than the usual one. For example, it may make
26890 * sense to pass a backend corresponding to the "defaults" settings database on
26891 * the system to get a settings object that modifies the system default
26892 * settings instead of the settings for this user.
26894 * Returns: a new #GSettings object
26900 * g_settings_new_with_backend_and_path:
26901 * @schema_id: the id of the schema
26902 * @backend: the #GSettingsBackend to use
26903 * @path: the path to use
26905 * Creates a new #GSettings object with the schema specified by
26906 * @schema_id and a given #GSettingsBackend and path.
26908 * This is a mix of g_settings_new_with_backend() and
26909 * g_settings_new_with_path().
26911 * Returns: a new #GSettings object
26917 * g_settings_new_with_path:
26918 * @schema_id: the id of the schema
26919 * @path: the path to use
26921 * Creates a new #GSettings object with the relocatable schema specified
26922 * by @schema_id and a given path.
26924 * You only need to do this if you want to directly create a settings
26925 * object with a schema that doesn't have a specified path of its own.
26926 * That's quite rare.
26928 * It is a programmer error to call this function for a schema that
26929 * has an explicitly specified path.
26931 * Returns: a new #GSettings object
26937 * g_settings_range_check:
26938 * @settings: a #GSettings
26939 * @key: the key to check
26940 * @value: the value to check
26942 * Checks if the given @value is of the correct type and within the
26943 * permitted range for @key.
26945 * This API is not intended to be used by normal programs -- they should
26946 * already know what is permitted by their own schemas. This API is
26947 * meant to be used by programs such as editors or commandline tools.
26949 * It is a programmer error to give a @key that isn't contained in the
26950 * schema for @settings.
26952 * Returns: %TRUE if @value is valid for @key
26958 * g_settings_reset:
26959 * @settings: a #GSettings object
26960 * @key: the name of a key
26962 * Resets @key to its default value.
26964 * This call resets the key, as much as possible, to its default value.
26965 * That might the value specified in the schema or the one set by the
26971 * g_settings_revert:
26972 * @settings: a #GSettings instance
26974 * Reverts all non-applied changes to the settings. This function
26975 * does nothing unless @settings is in 'delay-apply' mode; see
26976 * g_settings_delay(). In the normal case settings are always applied
26979 * Change notifications will be emitted for affected keys.
26984 * g_settings_schema_get_id:
26985 * @schema: a #GSettingsSchema
26987 * Get the ID of @schema.
26989 * Returns: (transfer none): the ID
26994 * g_settings_schema_get_path:
26995 * @schema: a #GSettingsSchema
26997 * Gets the path associated with @schema, or %NULL.
26999 * Schemas may be single-instance or relocatable. Single-instance
27000 * schemas correspond to exactly one set of keys in the backend
27001 * database: those located at the path returned by this function.
27003 * Relocatable schemas can be referenced by other schemas and can
27004 * threfore describe multiple sets of keys at different locations. For
27005 * relocatable schemas, this function will return %NULL.
27007 * Returns: (transfer none): the path of the schema, or %NULL
27013 * g_settings_schema_ref:
27014 * @schema: a #GSettingsSchema
27016 * Increase the reference count of @schema, returning a new reference.
27018 * Returns: a new reference to @schema
27024 * g_settings_schema_source_get_default:
27026 * Gets the default system schema source.
27028 * This function is not required for normal uses of #GSettings but it
27029 * may be useful to authors of plugin management systems or to those who
27030 * want to introspect the content of schemas.
27032 * If no schemas are installed, %NULL will be returned.
27034 * The returned source may actually consist of multiple schema sources
27035 * from different directories, depending on which directories were given
27036 * in <envar>XDG_DATA_DIRS</envar> and
27037 * <envar>GSETTINGS_SCHEMA_DIR</envar>. For this reason, all lookups
27038 * performed against the default source should probably be done
27041 * Returns: (transfer none): the default schema source
27047 * g_settings_schema_source_lookup:
27048 * @source: a #GSettingsSchemaSource
27049 * @schema_id: a schema ID
27050 * @recursive: %TRUE if the lookup should be recursive
27052 * Looks up a schema with the identifier @schema_id in @source.
27054 * This function is not required for normal uses of #GSettings but it
27055 * may be useful to authors of plugin management systems or to those who
27056 * want to introspect the content of schemas.
27058 * If the schema isn't found directly in @source and @recursive is %TRUE
27059 * then the parent sources will also be checked.
27061 * If the schema isn't found, %NULL is returned.
27063 * Returns: (transfer full): a new #GSettingsSchema
27069 * g_settings_schema_source_new_from_directory:
27070 * @directory: the filename of a directory
27071 * @parent: (allow-none): a #GSettingsSchemaSource, or %NULL
27072 * @trusted: %TRUE, if the directory is trusted
27073 * @error: a pointer to a #GError pointer set to %NULL, or %NULL
27075 * Attempts to create a new schema source corresponding to the contents
27076 * of the given directory.
27078 * This function is not required for normal uses of #GSettings but it
27079 * may be useful to authors of plugin management systems.
27081 * The directory should contain a file called
27082 * <filename>gschemas.compiled</filename> as produced by
27083 * <command>glib-compile-schemas</command>.
27085 * If @trusted is %TRUE then <filename>gschemas.compiled</filename> is
27086 * trusted not to be corrupted. This assumption has a performance
27087 * advantage, but can result in crashes or inconsistent behaviour in the
27088 * case of a corrupted file. Generally, you should set @trusted to
27089 * %TRUE for files installed by the system and to %FALSE for files in
27090 * the home directory.
27092 * If @parent is non-%NULL then there are two effects.
27094 * First, if g_settings_schema_source_lookup() is called with the
27095 * @recursive flag set to %TRUE and the schema can not be found in the
27096 * source, the lookup will recurse to the parent.
27098 * Second, any references to other schemas specified within this
27099 * source (ie: <literal>child</literal> or <literal>extends</literal>)
27100 * references may be resolved from the @parent.
27102 * For this second reason, except in very unusual situations, the
27103 * @parent should probably be given as the default schema source, as
27104 * returned by g_settings_schema_source_get_default().
27111 * g_settings_schema_source_ref:
27112 * @source: a #GSettingsSchemaSource
27114 * Increase the reference count of @source, returning a new reference.
27116 * Returns: a new reference to @source
27122 * g_settings_schema_source_unref:
27123 * @source: a #GSettingsSchemaSource
27125 * Decrease the reference count of @source, possibly freeing it.
27132 * g_settings_schema_unref:
27133 * @schema: a #GSettingsSchema
27135 * Decrease the reference count of @schema, possibly freeing it.
27143 * @settings: a #GSettings object
27144 * @key: the name of the key to set
27145 * @format: a #GVariant format string
27146 * @...: arguments as per @format
27148 * Sets @key in @settings to @value.
27150 * A convenience function that combines g_settings_set_value() with
27153 * It is a programmer error to give a @key that isn't contained in the
27154 * schema for @settings or for the #GVariantType of @format to mismatch
27155 * the type given in the schema.
27157 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27163 * g_settings_set_boolean:
27164 * @settings: a #GSettings object
27165 * @key: the name of the key to set
27166 * @value: the value to set it to
27168 * Sets @key in @settings to @value.
27170 * A convenience variant of g_settings_set() for booleans.
27172 * It is a programmer error to give a @key that isn't specified as
27173 * having a boolean type in the schema for @settings.
27175 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27181 * g_settings_set_double:
27182 * @settings: a #GSettings object
27183 * @key: the name of the key to set
27184 * @value: the value to set it to
27186 * Sets @key in @settings to @value.
27188 * A convenience variant of g_settings_set() for doubles.
27190 * It is a programmer error to give a @key that isn't specified as
27191 * having a 'double' type in the schema for @settings.
27193 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27199 * g_settings_set_enum:
27200 * @settings: a #GSettings object
27201 * @key: a key, within @settings
27202 * @value: an enumerated value
27204 * Looks up the enumerated type nick for @value and writes it to @key,
27205 * within @settings.
27207 * It is a programmer error to give a @key that isn't contained in the
27208 * schema for @settings or is not marked as an enumerated type, or for
27209 * @value not to be a valid value for the named type.
27211 * After performing the write, accessing @key directly with
27212 * g_settings_get_string() will return the 'nick' associated with
27215 * Returns: %TRUE, if the set succeeds
27220 * g_settings_set_flags:
27221 * @settings: a #GSettings object
27222 * @key: a key, within @settings
27223 * @value: a flags value
27225 * Looks up the flags type nicks for the bits specified by @value, puts
27226 * them in an array of strings and writes the array to @key, within
27229 * It is a programmer error to give a @key that isn't contained in the
27230 * schema for @settings or is not marked as a flags type, or for @value
27231 * to contain any bits that are not value for the named type.
27233 * After performing the write, accessing @key directly with
27234 * g_settings_get_strv() will return an array of 'nicks'; one for each
27237 * Returns: %TRUE, if the set succeeds
27242 * g_settings_set_int:
27243 * @settings: a #GSettings object
27244 * @key: the name of the key to set
27245 * @value: the value to set it to
27247 * Sets @key in @settings to @value.
27249 * A convenience variant of g_settings_set() for 32-bit integers.
27251 * It is a programmer error to give a @key that isn't specified as
27252 * having a int32 type in the schema for @settings.
27254 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27260 * g_settings_set_string:
27261 * @settings: a #GSettings object
27262 * @key: the name of the key to set
27263 * @value: the value to set it to
27265 * Sets @key in @settings to @value.
27267 * A convenience variant of g_settings_set() for strings.
27269 * It is a programmer error to give a @key that isn't specified as
27270 * having a string type in the schema for @settings.
27272 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27278 * g_settings_set_strv:
27279 * @settings: a #GSettings object
27280 * @key: the name of the key to set
27281 * @value: (allow-none) (array zero-terminated=1): the value to set it to, or %NULL
27283 * Sets @key in @settings to @value.
27285 * A convenience variant of g_settings_set() for string arrays. If
27286 * @value is %NULL, then @key is set to be the empty array.
27288 * It is a programmer error to give a @key that isn't specified as
27289 * having an array of strings type in the schema for @settings.
27291 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27297 * g_settings_set_uint:
27298 * @settings: a #GSettings object
27299 * @key: the name of the key to set
27300 * @value: the value to set it to
27302 * Sets @key in @settings to @value.
27304 * A convenience variant of g_settings_set() for 32-bit unsigned
27307 * It is a programmer error to give a @key that isn't specified as
27308 * having a uint32 type in the schema for @settings.
27310 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27316 * g_settings_set_value:
27317 * @settings: a #GSettings object
27318 * @key: the name of the key to set
27319 * @value: a #GVariant of the correct type
27321 * Sets @key in @settings to @value.
27323 * It is a programmer error to give a @key that isn't contained in the
27324 * schema for @settings or for @value to have the incorrect type, per
27327 * If @value is floating then this function consumes the reference.
27329 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27337 * Ensures that all pending operations for the given are complete for
27338 * the default backend.
27340 * Writes made to a #GSettings are handled asynchronously. For this
27341 * reason, it is very unlikely that the changes have it to disk by the
27342 * time g_settings_set() returns.
27344 * This call will block until all of the writes have made it to the
27345 * backend. Since the mainloop is not running, no change notifications
27346 * will be dispatched during this call (but some may be queued by the
27347 * time the call is done).
27352 * g_settings_unbind:
27353 * @object: the object
27354 * @property: the property whose binding is removed
27356 * Removes an existing binding for @property on @object.
27358 * Note that bindings are automatically removed when the
27359 * object is finalized, so it is rarely necessary to call this
27367 * g_simple_action_group_add_entries:
27368 * @simple: a #GSimpleActionGroup
27369 * @entries: (array length=n_entries): a pointer to the first item in an array of #GActionEntry structs
27370 * @n_entries: the length of @entries, or -1
27371 * @user_data: the user data for signal connections
27373 * A convenience function for creating multiple #GSimpleAction instances
27374 * and adding them to the action group.
27381 * g_simple_action_group_insert:
27382 * @simple: a #GSimpleActionGroup
27383 * @action: a #GAction
27385 * Adds an action to the action group.
27387 * If the action group already contains an action with the same name as
27388 * @action then the old action is dropped from the group.
27390 * The action group takes its own reference on @action.
27397 * g_simple_action_group_lookup:
27398 * @simple: a #GSimpleActionGroup
27399 * @action_name: the name of an action
27401 * Looks up the action with the name @action_name in the group.
27403 * If no such action exists, returns %NULL.
27405 * Returns: (transfer none): a #GAction, or %NULL
27411 * g_simple_action_group_new:
27413 * Creates a new, empty, #GSimpleActionGroup.
27415 * Returns: a new #GSimpleActionGroup
27421 * g_simple_action_group_remove:
27422 * @simple: a #GSimpleActionGroup
27423 * @action_name: the name of the action
27425 * Removes the named action from the action group.
27427 * If no action of this name is in the group then nothing happens.
27434 * g_simple_action_new:
27435 * @name: the name of the action
27436 * @parameter_type: (allow-none): the type of parameter to the activate function
27438 * Creates a new action.
27440 * The created action is stateless. See g_simple_action_new_stateful().
27442 * Returns: a new #GSimpleAction
27448 * g_simple_action_new_stateful:
27449 * @name: the name of the action
27450 * @parameter_type: (allow-none): the type of the parameter to the activate function
27451 * @state: the initial state of the action
27453 * Creates a new stateful action.
27455 * @state is the initial state of the action. All future state values
27456 * must have the same #GVariantType as the initial state.
27458 * If the @state GVariant is floating, it is consumed.
27460 * Returns: a new #GSimpleAction
27466 * g_simple_action_set_enabled:
27467 * @simple: a #GSimpleAction
27468 * @enabled: whether the action is enabled
27470 * Sets the action as enabled or not.
27472 * An action must be enabled in order to be activated or in order to
27473 * have its state changed from outside callers.
27475 * This should only be called by the implementor of the action. Users
27476 * of the action should not attempt to modify its enabled flag.
27483 * g_simple_action_set_state:
27484 * @simple: a #GSimpleAction
27485 * @value: the new #GVariant for the state
27487 * Sets the state of the action.
27489 * This directly updates the 'state' property to the given value.
27491 * This should only be called by the implementor of the action. Users
27492 * of the action should not attempt to directly modify the 'state'
27493 * property. Instead, they should call g_action_change_state() to
27494 * request the change.
27501 * g_simple_async_report_error_in_idle: (skip)
27502 * @object: (allow-none): a #GObject, or %NULL.
27503 * @callback: a #GAsyncReadyCallback.
27504 * @user_data: user data passed to @callback.
27505 * @domain: a #GQuark containing the error domain (usually #G_IO_ERROR).
27506 * @code: a specific error code.
27507 * @format: a formatted error reporting string.
27508 * @...: a list of variables to fill in @format.
27510 * Reports an error in an asynchronous function in an idle function by
27511 * directly setting the contents of the #GAsyncResult with the given error
27517 * g_simple_async_report_gerror_in_idle:
27518 * @object: (allow-none): a #GObject, or %NULL
27519 * @callback: (scope async): a #GAsyncReadyCallback.
27520 * @user_data: (closure): user data passed to @callback.
27521 * @error: the #GError to report
27523 * Reports an error in an idle function. Similar to
27524 * g_simple_async_report_error_in_idle(), but takes a #GError rather
27525 * than building a new one.
27530 * g_simple_async_report_take_gerror_in_idle: (skip)
27531 * @object: (allow-none): a #GObject, or %NULL
27532 * @callback: a #GAsyncReadyCallback.
27533 * @user_data: user data passed to @callback.
27534 * @error: the #GError to report
27536 * Reports an error in an idle function. Similar to
27537 * g_simple_async_report_gerror_in_idle(), but takes over the caller's
27538 * ownership of @error, so the caller does not have to free it any more.
27545 * g_simple_async_result_complete:
27546 * @simple: a #GSimpleAsyncResult.
27548 * Completes an asynchronous I/O job immediately. Must be called in
27549 * the thread where the asynchronous result was to be delivered, as it
27550 * invokes the callback directly. If you are in a different thread use
27551 * g_simple_async_result_complete_in_idle().
27553 * Calling this function takes a reference to @simple for as long as
27554 * is needed to complete the call.
27559 * g_simple_async_result_complete_in_idle:
27560 * @simple: a #GSimpleAsyncResult.
27562 * Completes an asynchronous function in an idle handler in the <link
27563 * linkend="g-main-context-push-thread-default">thread-default main
27564 * loop</link> of the thread that @simple was initially created in
27565 * (and re-pushes that context around the invocation of the callback).
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_get_op_res_gboolean:
27574 * @simple: a #GSimpleAsyncResult.
27576 * Gets the operation result boolean from within the asynchronous result.
27578 * Returns: %TRUE if the operation's result was %TRUE, %FALSE if the operation's result was %FALSE.
27583 * g_simple_async_result_get_op_res_gpointer: (skip)
27584 * @simple: a #GSimpleAsyncResult.
27586 * Gets a pointer result as returned by the asynchronous function.
27588 * Returns: a pointer from the result.
27593 * g_simple_async_result_get_op_res_gssize:
27594 * @simple: a #GSimpleAsyncResult.
27596 * Gets a gssize from the asynchronous result.
27598 * Returns: a gssize returned from the asynchronous function.
27603 * g_simple_async_result_get_source_tag: (skip)
27604 * @simple: a #GSimpleAsyncResult.
27606 * Gets the source tag for the #GSimpleAsyncResult.
27608 * Returns: a #gpointer to the source object for the #GSimpleAsyncResult.
27613 * g_simple_async_result_is_valid:
27614 * @result: the #GAsyncResult passed to the _finish function.
27615 * @source: the #GObject passed to the _finish function.
27616 * @source_tag: the asynchronous function.
27618 * Ensures that the data passed to the _finish function of an async
27619 * operation is consistent. Three checks are performed.
27621 * First, @result is checked to ensure that it is really a
27622 * #GSimpleAsyncResult. Second, @source is checked to ensure that it
27623 * matches the source object of @result. Third, @source_tag is
27624 * checked to ensure that it is either %NULL (as it is when the result was
27625 * created by g_simple_async_report_error_in_idle() or
27626 * g_simple_async_report_gerror_in_idle()) or equal to the
27627 * @source_tag argument given to g_simple_async_result_new() (which, by
27628 * convention, is a pointer to the _async function corresponding to the
27629 * _finish function from which this function is called).
27631 * Returns: #TRUE if all checks passed or #FALSE if any failed.
27637 * g_simple_async_result_new:
27638 * @source_object: (allow-none): a #GObject, or %NULL.
27639 * @callback: (scope async): a #GAsyncReadyCallback.
27640 * @user_data: (closure): user data passed to @callback.
27641 * @source_tag: the asynchronous function.
27643 * Creates a #GSimpleAsyncResult.
27645 * The common convention is to create the #GSimpleAsyncResult in the
27646 * function that starts the asynchronous operation and use that same
27647 * function as the @source_tag.
27649 * If your operation supports cancellation with #GCancellable (which it
27650 * probably should) then you should provide the user's cancellable to
27651 * g_simple_async_result_set_check_cancellable() immediately after
27652 * this function returns.
27654 * Returns: a #GSimpleAsyncResult.
27659 * g_simple_async_result_new_error:
27660 * @source_object: (allow-none): a #GObject, or %NULL.
27661 * @callback: (scope async): a #GAsyncReadyCallback.
27662 * @user_data: (closure): user data passed to @callback.
27663 * @domain: a #GQuark.
27664 * @code: an error code.
27665 * @format: a string with format characters.
27666 * @...: a list of values to insert into @format.
27668 * Creates a new #GSimpleAsyncResult with a set error.
27670 * Returns: a #GSimpleAsyncResult.
27675 * g_simple_async_result_new_from_error:
27676 * @source_object: (allow-none): a #GObject, or %NULL.
27677 * @callback: (scope async): a #GAsyncReadyCallback.
27678 * @user_data: (closure): user data passed to @callback.
27679 * @error: a #GError
27681 * Creates a #GSimpleAsyncResult from an error condition.
27683 * Returns: a #GSimpleAsyncResult.
27688 * g_simple_async_result_new_take_error: (skip)
27689 * @source_object: (allow-none): a #GObject, or %NULL
27690 * @callback: (scope async): a #GAsyncReadyCallback
27691 * @user_data: (closure): user data passed to @callback
27692 * @error: a #GError
27694 * Creates a #GSimpleAsyncResult from an error condition, and takes over the
27695 * caller's ownership of @error, so the caller does not need to free it anymore.
27697 * Returns: a #GSimpleAsyncResult
27703 * g_simple_async_result_propagate_error:
27704 * @simple: a #GSimpleAsyncResult.
27705 * @dest: (out): a location to propagate the error to.
27707 * Propagates an error from within the simple asynchronous result to
27708 * a given destination.
27710 * If the #GCancellable given to a prior call to
27711 * g_simple_async_result_set_check_cancellable() is cancelled then this
27712 * function will return %TRUE with @dest set appropriately.
27714 * Returns: %TRUE if the error was propagated to @dest. %FALSE otherwise.
27719 * g_simple_async_result_run_in_thread: (skip)
27720 * @simple: a #GSimpleAsyncResult.
27721 * @func: a #GSimpleAsyncThreadFunc.
27722 * @io_priority: the io priority of the request.
27723 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27725 * Runs the asynchronous job in a separate thread and then calls
27726 * g_simple_async_result_complete_in_idle() on @simple to return
27727 * the result to the appropriate main loop.
27729 * Calling this function takes a reference to @simple for as long as
27730 * is needed to run the job and report its completion.
27735 * g_simple_async_result_set_check_cancellable:
27736 * @simple: a #GSimpleAsyncResult
27737 * @check_cancellable: (allow-none): a #GCancellable to check, or %NULL to unset
27739 * Sets a #GCancellable to check before dispatching results.
27741 * This function has one very specific purpose: the provided cancellable
27742 * is checked at the time of g_simple_async_result_propagate_error() If
27743 * it is cancelled, these functions will return an "Operation was
27744 * cancelled" error (%G_IO_ERROR_CANCELLED).
27746 * Implementors of cancellable asynchronous functions should use this in
27747 * order to provide a guarantee to their callers that cancelling an
27748 * async operation will reliably result in an error being returned for
27749 * that operation (even if a positive result for the operation has
27750 * already been sent as an idle to the main context to be dispatched).
27752 * The checking described above is done regardless of any call to the
27753 * unrelated g_simple_async_result_set_handle_cancellation() function.
27760 * g_simple_async_result_set_error: (skip)
27761 * @simple: a #GSimpleAsyncResult.
27762 * @domain: a #GQuark (usually #G_IO_ERROR).
27763 * @code: an error code.
27764 * @format: a formatted error reporting string.
27765 * @...: a list of variables to fill in @format.
27767 * Sets an error within the asynchronous result without a #GError.
27772 * g_simple_async_result_set_error_va: (skip)
27773 * @simple: a #GSimpleAsyncResult.
27774 * @domain: a #GQuark (usually #G_IO_ERROR).
27775 * @code: an error code.
27776 * @format: a formatted error reporting string.
27777 * @args: va_list of arguments.
27779 * Sets an error within the asynchronous result without a #GError.
27780 * Unless writing a binding, see g_simple_async_result_set_error().
27785 * g_simple_async_result_set_from_error:
27786 * @simple: a #GSimpleAsyncResult.
27789 * Sets the result from a #GError.
27794 * g_simple_async_result_set_handle_cancellation:
27795 * @simple: a #GSimpleAsyncResult.
27796 * @handle_cancellation: a #gboolean.
27798 * Sets whether to handle cancellation within the asynchronous operation.
27800 * This function has nothing to do with
27801 * g_simple_async_result_set_check_cancellable(). It only refers to the
27802 * #GCancellable passed to g_simple_async_result_run_in_thread().
27807 * g_simple_async_result_set_op_res_gboolean:
27808 * @simple: a #GSimpleAsyncResult.
27809 * @op_res: a #gboolean.
27811 * Sets the operation result to a boolean within the asynchronous result.
27816 * g_simple_async_result_set_op_res_gpointer: (skip)
27817 * @simple: a #GSimpleAsyncResult.
27818 * @op_res: a pointer result from an asynchronous function.
27819 * @destroy_op_res: a #GDestroyNotify function.
27821 * Sets the operation result within the asynchronous result to a pointer.
27826 * g_simple_async_result_set_op_res_gssize:
27827 * @simple: a #GSimpleAsyncResult.
27828 * @op_res: a #gssize.
27830 * Sets the operation result within the asynchronous result to
27831 * the given @op_res.
27836 * g_simple_async_result_take_error: (skip)
27837 * @simple: a #GSimpleAsyncResult
27838 * @error: a #GError
27840 * Sets the result from @error, and takes over the caller's ownership
27841 * of @error, so the caller does not need to free it any more.
27848 * g_simple_permission_new:
27849 * @allowed: %TRUE if the action is allowed
27851 * Creates a new #GPermission instance that represents an action that is
27852 * either always or never allowed.
27854 * Returns: the #GSimplePermission, as a #GPermission
27861 * @socket: a #GSocket.
27862 * @cancellable: (allow-none): a %GCancellable or %NULL
27863 * @error: #GError for error reporting, or %NULL to ignore.
27865 * Accept incoming connections on a connection-based socket. This removes
27866 * the first outstanding connection request from the listening socket and
27867 * creates a #GSocket object for it.
27869 * The @socket must be bound to a local address with g_socket_bind() and
27870 * must be listening for incoming connections (g_socket_listen()).
27872 * If there are no outstanding connections then the operation will block
27873 * or return %G_IO_ERROR_WOULD_BLOCK if non-blocking I/O is enabled.
27874 * To be notified of an incoming connection, wait for the %G_IO_IN condition.
27876 * Returns: (transfer full): a new #GSocket, or %NULL on error. Free the returned object with g_object_unref().
27882 * g_socket_address_enumerator_next:
27883 * @enumerator: a #GSocketAddressEnumerator
27884 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27885 * @error: a #GError.
27887 * Retrieves the next #GSocketAddress from @enumerator. Note that this
27888 * may block for some amount of time. (Eg, a #GNetworkAddress may need
27889 * to do a DNS lookup before it can return an address.) Use
27890 * g_socket_address_enumerator_next_async() if you need to avoid
27893 * If @enumerator is expected to yield addresses, but for some reason
27894 * is unable to (eg, because of a DNS error), then the first call to
27895 * g_socket_address_enumerator_next() will return an appropriate error
27896 * in *@error. However, if the first call to
27897 * g_socket_address_enumerator_next() succeeds, then any further
27898 * internal errors (other than @cancellable being triggered) will be
27901 * 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.
27906 * g_socket_address_enumerator_next_async:
27907 * @enumerator: a #GSocketAddressEnumerator
27908 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27909 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
27910 * @user_data: (closure): the data to pass to callback function
27912 * Asynchronously retrieves the next #GSocketAddress from @enumerator
27913 * and then calls @callback, which must call
27914 * g_socket_address_enumerator_next_finish() to get the result.
27919 * g_socket_address_enumerator_next_finish:
27920 * @enumerator: a #GSocketAddressEnumerator
27921 * @result: a #GAsyncResult
27922 * @error: a #GError
27924 * Retrieves the result of a completed call to
27925 * g_socket_address_enumerator_next_async(). See
27926 * g_socket_address_enumerator_next() for more information about
27929 * 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.
27934 * g_socket_address_get_family:
27935 * @address: a #GSocketAddress
27937 * Gets the socket family type of @address.
27939 * Returns: the socket family type of @address.
27945 * g_socket_address_get_native_size:
27946 * @address: a #GSocketAddress
27948 * Gets the size of @address's native <type>struct sockaddr</type>.
27949 * You can use this to allocate memory to pass to
27950 * g_socket_address_to_native().
27952 * Returns: the size of the native <type>struct sockaddr</type> that @address represents
27958 * g_socket_address_new_from_native:
27959 * @native: a pointer to a <type>struct sockaddr</type>
27960 * @len: the size of the memory location pointed to by @native
27962 * Creates a #GSocketAddress subclass corresponding to the native
27963 * <type>struct sockaddr</type> @native.
27965 * Returns: a new #GSocketAddress if @native could successfully be converted, otherwise %NULL.
27971 * g_socket_address_to_native:
27972 * @address: a #GSocketAddress
27973 * @dest: a pointer to a memory location that will contain the native <type>struct sockaddr</type>.
27974 * @destlen: the size of @dest. Must be at least as large as g_socket_address_get_native_size().
27975 * @error: #GError for error reporting, or %NULL to ignore.
27977 * Converts a #GSocketAddress to a native <type>struct
27978 * sockaddr</type>, which can be passed to low-level functions like
27979 * connect() or bind().
27981 * If not enough space is available, a %G_IO_ERROR_NO_SPACE error is
27982 * returned. If the address type is not known on the system
27983 * then a %G_IO_ERROR_NOT_SUPPORTED error is returned.
27985 * Returns: %TRUE if @dest was filled in, %FALSE on error
27992 * @socket: a #GSocket.
27993 * @address: a #GSocketAddress specifying the local address.
27994 * @allow_reuse: whether to allow reusing this address
27995 * @error: #GError for error reporting, or %NULL to ignore.
27997 * When a socket is created it is attached to an address family, but it
27998 * doesn't have an address in this family. g_socket_bind() assigns the
27999 * address (sometimes called name) of the socket.
28001 * It is generally required to bind to a local address before you can
28002 * receive connections. (See g_socket_listen() and g_socket_accept() ).
28003 * In certain situations, you may also want to bind a socket that will be
28004 * used to initiate connections, though this is not normally required.
28006 * @allow_reuse should be %TRUE for server sockets (sockets that you will
28007 * eventually call g_socket_accept() on), and %FALSE for client sockets.
28008 * (Specifically, if it is %TRUE, then g_socket_bind() will set the
28009 * %SO_REUSEADDR flag on the socket, allowing it to bind @address even if
28010 * that address was previously used by another socket that has not yet been
28011 * fully cleaned-up by the kernel. Failing to set this flag on a server
28012 * socket may cause the bind call to return %G_IO_ERROR_ADDRESS_IN_USE if
28013 * the server program is stopped and then immediately restarted.)
28015 * Returns: %TRUE on success, %FALSE on error.
28021 * g_socket_check_connect_result:
28022 * @socket: a #GSocket
28023 * @error: #GError for error reporting, or %NULL to ignore.
28025 * Checks and resets the pending connect error for the socket.
28026 * This is used to check for errors when g_socket_connect() is
28027 * used in non-blocking mode.
28029 * Returns: %TRUE if no error, %FALSE otherwise, setting @error to the error
28035 * g_socket_client_add_application_proxy:
28036 * @client: a #GSocketClient
28037 * @protocol: The proxy protocol
28039 * Enable proxy protocols to be handled by the application. When the
28040 * indicated proxy protocol is returned by the #GProxyResolver,
28041 * #GSocketClient will consider this protocol as supported but will
28042 * not try to find a #GProxy instance to handle handshaking. The
28043 * application must check for this case by calling
28044 * g_socket_connection_get_remote_address() on the returned
28045 * #GSocketConnection, and seeing if it's a #GProxyAddress of the
28046 * appropriate type, to determine whether or not it needs to handle
28047 * the proxy handshaking itself.
28049 * This should be used for proxy protocols that are dialects of
28050 * another protocol such as HTTP proxy. It also allows cohabitation of
28051 * proxy protocols that are reused between protocols. A good example
28052 * is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also
28053 * be use as generic socket proxy through the HTTP CONNECT method.
28055 * When the proxy is detected as being an application proxy, TLS handshake
28056 * will be skipped. This is required to let the application do the proxy
28057 * specific handshake.
28062 * g_socket_client_connect:
28063 * @client: a #GSocketClient.
28064 * @connectable: a #GSocketConnectable specifying the remote address.
28065 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28066 * @error: #GError for error reporting, or %NULL to ignore.
28068 * Tries to resolve the @connectable and make a network connection to it.
28070 * Upon a successful connection, a new #GSocketConnection is constructed
28071 * and returned. The caller owns this new object and must drop their
28072 * reference to it when finished with it.
28074 * The type of the #GSocketConnection object returned depends on the type of
28075 * the underlying socket that is used. For instance, for a TCP/IP connection
28076 * it will be a #GTcpConnection.
28078 * The socket created will be the same family as the address that the
28079 * @connectable resolves to, unless family is set with g_socket_client_set_family()
28080 * or indirectly via g_socket_client_set_local_address(). The socket type
28081 * defaults to %G_SOCKET_TYPE_STREAM but can be set with
28082 * g_socket_client_set_socket_type().
28084 * If a local address is specified with g_socket_client_set_local_address() the
28085 * socket will be bound to this address before connecting.
28087 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28093 * g_socket_client_connect_async:
28094 * @client: a #GSocketClient
28095 * @connectable: a #GSocketConnectable specifying the remote address.
28096 * @cancellable: (allow-none): a #GCancellable, or %NULL
28097 * @callback: (scope async): a #GAsyncReadyCallback
28098 * @user_data: (closure): user data for the callback
28100 * This is the asynchronous version of g_socket_client_connect().
28102 * When the operation is finished @callback will be
28103 * called. You can then call g_socket_client_connect_finish() to get
28104 * the result of the operation.
28111 * g_socket_client_connect_finish:
28112 * @client: a #GSocketClient.
28113 * @result: a #GAsyncResult.
28114 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28116 * Finishes an async connect operation. See g_socket_client_connect_async()
28118 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28124 * g_socket_client_connect_to_host:
28125 * @client: a #GSocketClient
28126 * @host_and_port: the name and optionally port of the host to connect to
28127 * @default_port: the default port to connect to
28128 * @cancellable: (allow-none): a #GCancellable, or %NULL
28129 * @error: a pointer to a #GError, or %NULL
28131 * This is a helper function for g_socket_client_connect().
28133 * Attempts to create a TCP connection to the named host.
28135 * @host_and_port may be in any of a number of recognized formats; an IPv6
28136 * address, an IPv4 address, or a domain name (in which case a DNS
28137 * lookup is performed). Quoting with [] is supported for all address
28138 * types. A port override may be specified in the usual way with a
28139 * colon. Ports may be given as decimal numbers or symbolic names (in
28140 * which case an /etc/services lookup is performed).
28142 * If no port override is given in @host_and_port then @default_port will be
28143 * used as the port number to connect to.
28145 * In general, @host_and_port is expected to be provided by the user (allowing
28146 * them to give the hostname, and a port override if necessary) and
28147 * @default_port is expected to be provided by the application.
28149 * In the case that an IP address is given, a single connection
28150 * attempt is made. In the case that a name is given, multiple
28151 * connection attempts may be made, in turn and according to the
28152 * number of address records in DNS, until a connection succeeds.
28154 * Upon a successful connection, a new #GSocketConnection is constructed
28155 * and returned. The caller owns this new object and must drop their
28156 * reference to it when finished with it.
28158 * In the event of any failure (DNS error, service not found, no hosts
28159 * connectable) %NULL is returned and @error (if non-%NULL) is set
28162 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28168 * g_socket_client_connect_to_host_async:
28169 * @client: a #GSocketClient
28170 * @host_and_port: the name and optionally the port of the host to connect to
28171 * @default_port: the default port to connect to
28172 * @cancellable: (allow-none): a #GCancellable, or %NULL
28173 * @callback: (scope async): a #GAsyncReadyCallback
28174 * @user_data: (closure): user data for the callback
28176 * This is the asynchronous version of g_socket_client_connect_to_host().
28178 * When the operation is finished @callback will be
28179 * called. You can then call g_socket_client_connect_to_host_finish() to get
28180 * the result of the operation.
28187 * g_socket_client_connect_to_host_finish:
28188 * @client: a #GSocketClient.
28189 * @result: a #GAsyncResult.
28190 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28192 * Finishes an async connect operation. See g_socket_client_connect_to_host_async()
28194 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28200 * g_socket_client_connect_to_service:
28201 * @client: a #GSocketConnection
28202 * @domain: a domain name
28203 * @service: the name of the service to connect to
28204 * @cancellable: (allow-none): a #GCancellable, or %NULL
28205 * @error: a pointer to a #GError, or %NULL
28207 * Attempts to create a TCP connection to a service.
28209 * This call looks up the SRV record for @service at @domain for the
28210 * "tcp" protocol. It then attempts to connect, in turn, to each of
28211 * the hosts providing the service until either a connection succeeds
28212 * or there are no hosts remaining.
28214 * Upon a successful connection, a new #GSocketConnection is constructed
28215 * and returned. The caller owns this new object and must drop their
28216 * reference to it when finished with it.
28218 * In the event of any failure (DNS error, service not found, no hosts
28219 * connectable) %NULL is returned and @error (if non-%NULL) is set
28222 * Returns: (transfer full): a #GSocketConnection if successful, or %NULL on error
28227 * g_socket_client_connect_to_service_async:
28228 * @client: a #GSocketClient
28229 * @domain: a domain name
28230 * @service: the name of the service to connect to
28231 * @cancellable: (allow-none): a #GCancellable, or %NULL
28232 * @callback: (scope async): a #GAsyncReadyCallback
28233 * @user_data: (closure): user data for the callback
28235 * This is the asynchronous version of
28236 * g_socket_client_connect_to_service().
28243 * g_socket_client_connect_to_service_finish:
28244 * @client: a #GSocketClient.
28245 * @result: a #GAsyncResult.
28246 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28248 * Finishes an async connect operation. See g_socket_client_connect_to_service_async()
28250 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28256 * g_socket_client_connect_to_uri:
28257 * @client: a #GSocketClient
28258 * @uri: A network URI
28259 * @default_port: the default port to connect to
28260 * @cancellable: (allow-none): a #GCancellable, or %NULL
28261 * @error: a pointer to a #GError, or %NULL
28263 * This is a helper function for g_socket_client_connect().
28265 * Attempts to create a TCP connection with a network URI.
28267 * @uri may be any valid URI containing an "authority" (hostname/port)
28268 * component. If a port is not specified in the URI, @default_port
28269 * will be used. TLS will be negotiated if #GSocketClient:tls is %TRUE.
28270 * (#GSocketClient does not know to automatically assume TLS for
28271 * certain URI schemes.)
28273 * Using this rather than g_socket_client_connect() or
28274 * g_socket_client_connect_to_host() allows #GSocketClient to
28275 * determine when to use application-specific proxy protocols.
28277 * Upon a successful connection, a new #GSocketConnection is constructed
28278 * and returned. The caller owns this new object and must drop their
28279 * reference to it when finished with it.
28281 * In the event of any failure (DNS error, service not found, no hosts
28282 * connectable) %NULL is returned and @error (if non-%NULL) is set
28285 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28291 * g_socket_client_connect_to_uri_async:
28292 * @client: a #GSocketClient
28293 * @uri: a network uri
28294 * @default_port: the default port to connect to
28295 * @cancellable: (allow-none): a #GCancellable, or %NULL
28296 * @callback: (scope async): a #GAsyncReadyCallback
28297 * @user_data: (closure): user data for the callback
28299 * This is the asynchronous version of g_socket_client_connect_to_uri().
28301 * When the operation is finished @callback will be
28302 * called. You can then call g_socket_client_connect_to_uri_finish() to get
28303 * the result of the operation.
28310 * g_socket_client_connect_to_uri_finish:
28311 * @client: a #GSocketClient.
28312 * @result: a #GAsyncResult.
28313 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28315 * Finishes an async connect operation. See g_socket_client_connect_to_uri_async()
28317 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28323 * g_socket_client_get_enable_proxy:
28324 * @client: a #GSocketClient.
28326 * Gets the proxy enable state; see g_socket_client_set_enable_proxy()
28328 * Returns: whether proxying is enabled
28334 * g_socket_client_get_family:
28335 * @client: a #GSocketClient.
28337 * Gets the socket family of the socket client.
28339 * See g_socket_client_set_family() for details.
28341 * Returns: a #GSocketFamily
28347 * g_socket_client_get_local_address:
28348 * @client: a #GSocketClient.
28350 * Gets the local address of the socket client.
28352 * See g_socket_client_set_local_address() for details.
28354 * Returns: (transfer none): a #GSocketAddress or %NULL. Do not free.
28360 * g_socket_client_get_protocol:
28361 * @client: a #GSocketClient
28363 * Gets the protocol name type of the socket client.
28365 * See g_socket_client_set_protocol() for details.
28367 * Returns: a #GSocketProtocol
28373 * g_socket_client_get_socket_type:
28374 * @client: a #GSocketClient.
28376 * Gets the socket type of the socket client.
28378 * See g_socket_client_set_socket_type() for details.
28380 * Returns: a #GSocketFamily
28386 * g_socket_client_get_timeout:
28387 * @client: a #GSocketClient
28389 * Gets the I/O timeout time for sockets created by @client.
28391 * See g_socket_client_set_timeout() for details.
28393 * Returns: the timeout in seconds
28399 * g_socket_client_get_tls:
28400 * @client: a #GSocketClient.
28402 * Gets whether @client creates TLS connections. See
28403 * g_socket_client_set_tls() for details.
28405 * Returns: whether @client uses TLS
28411 * g_socket_client_get_tls_validation_flags:
28412 * @client: a #GSocketClient.
28414 * Gets the TLS validation flags used creating TLS connections via
28417 * Returns: the TLS validation flags
28423 * g_socket_client_new:
28425 * Creates a new #GSocketClient with the default options.
28427 * Returns: a #GSocketClient. Free the returned object with g_object_unref().
28433 * g_socket_client_set_enable_proxy:
28434 * @client: a #GSocketClient.
28435 * @enable: whether to enable proxies
28437 * Sets whether or not @client attempts to make connections via a
28438 * proxy server. When enabled (the default), #GSocketClient will use a
28439 * #GProxyResolver to determine if a proxy protocol such as SOCKS is
28440 * needed, and automatically do the necessary proxy negotiation.
28447 * g_socket_client_set_family:
28448 * @client: a #GSocketClient.
28449 * @family: a #GSocketFamily
28451 * Sets the socket family of the socket client.
28452 * If this is set to something other than %G_SOCKET_FAMILY_INVALID
28453 * then the sockets created by this object will be of the specified
28456 * This might be useful for instance if you want to force the local
28457 * connection to be an ipv4 socket, even though the address might
28458 * be an ipv6 mapped to ipv4 address.
28465 * g_socket_client_set_local_address:
28466 * @client: a #GSocketClient.
28467 * @address: (allow-none): a #GSocketAddress, or %NULL
28469 * Sets the local address of the socket client.
28470 * The sockets created by this object will bound to the
28471 * specified address (if not %NULL) before connecting.
28473 * This is useful if you want to ensure that the local
28474 * side of the connection is on a specific port, or on
28475 * a specific interface.
28482 * g_socket_client_set_protocol:
28483 * @client: a #GSocketClient.
28484 * @protocol: a #GSocketProtocol
28486 * Sets the protocol of the socket client.
28487 * The sockets created by this object will use of the specified
28490 * If @protocol is %0 that means to use the default
28491 * protocol for the socket family and type.
28498 * g_socket_client_set_socket_type:
28499 * @client: a #GSocketClient.
28500 * @type: a #GSocketType
28502 * Sets the socket type of the socket client.
28503 * The sockets created by this object will be of the specified
28506 * It doesn't make sense to specify a type of %G_SOCKET_TYPE_DATAGRAM,
28507 * as GSocketClient is used for connection oriented services.
28514 * g_socket_client_set_timeout:
28515 * @client: a #GSocketClient.
28516 * @timeout: the timeout
28518 * Sets the I/O timeout for sockets created by @client. @timeout is a
28519 * time in seconds, or 0 for no timeout (the default).
28521 * The timeout value affects the initial connection attempt as well,
28522 * so setting this may cause calls to g_socket_client_connect(), etc,
28523 * to fail with %G_IO_ERROR_TIMED_OUT.
28530 * g_socket_client_set_tls:
28531 * @client: a #GSocketClient.
28532 * @tls: whether to use TLS
28534 * Sets whether @client creates TLS (aka SSL) connections. If @tls is
28535 * %TRUE, @client will wrap its connections in a #GTlsClientConnection
28536 * and perform a TLS handshake when connecting.
28538 * Note that since #GSocketClient must return a #GSocketConnection,
28539 * but #GTlsClientConnection is not a #GSocketConnection, this
28540 * actually wraps the resulting #GTlsClientConnection in a
28541 * #GTcpWrapperConnection when returning it. You can use
28542 * g_tcp_wrapper_connection_get_base_io_stream() on the return value
28543 * to extract the #GTlsClientConnection.
28545 * If you need to modify the behavior of the TLS handshake (eg, by
28546 * setting a client-side certificate to use, or connecting to the
28547 * #GTlsConnection::accept-certificate signal), you can connect to
28548 * @client's #GSocketClient::event signal and wait for it to be
28549 * emitted with %G_SOCKET_CLIENT_TLS_HANDSHAKING, which will give you
28550 * a chance to see the #GTlsClientConnection before the handshake
28558 * g_socket_client_set_tls_validation_flags:
28559 * @client: a #GSocketClient.
28560 * @flags: the validation flags
28562 * Sets the TLS validation flags used when creating TLS connections
28563 * via @client. The default value is %G_TLS_CERTIFICATE_VALIDATE_ALL.
28571 * @socket: a #GSocket
28572 * @error: #GError for error reporting, or %NULL to ignore.
28574 * Closes the socket, shutting down any active connection.
28576 * Closing a socket does not wait for all outstanding I/O operations
28577 * to finish, so the caller should not rely on them to be guaranteed
28578 * to complete even if the close returns with no error.
28580 * Once the socket is closed, all other operations will return
28581 * %G_IO_ERROR_CLOSED. Closing a socket multiple times will not
28584 * Sockets will be automatically closed when the last reference
28585 * is dropped, but you might want to call this function to make sure
28586 * resources are released as early as possible.
28588 * Beware that due to the way that TCP works, it is possible for
28589 * recently-sent data to be lost if either you close a socket while the
28590 * %G_IO_IN condition is set, or else if the remote connection tries to
28591 * send something to you after you close the socket but before it has
28592 * finished reading all of the data you sent. There is no easy generic
28593 * way to avoid this problem; the easiest fix is to design the network
28594 * protocol such that the client will never send data "out of turn".
28595 * Another solution is for the server to half-close the connection by
28596 * calling g_socket_shutdown() with only the @shutdown_write flag set,
28597 * and then wait for the client to notice this and close its side of the
28598 * connection, after which the server can safely call g_socket_close().
28599 * (This is what #GTcpConnection does if you call
28600 * g_tcp_connection_set_graceful_disconnect(). But of course, this
28601 * only works if the client will close its connection after the server
28604 * Returns: %TRUE on success, %FALSE on error
28610 * g_socket_condition_check:
28611 * @socket: a #GSocket
28612 * @condition: a #GIOCondition mask to check
28614 * Checks on the readiness of @socket to perform operations.
28615 * The operations specified in @condition are checked for and masked
28616 * against the currently-satisfied conditions on @socket. The result
28619 * Note that on Windows, it is possible for an operation to return
28620 * %G_IO_ERROR_WOULD_BLOCK even immediately after
28621 * g_socket_condition_check() has claimed that the socket is ready for
28622 * writing. Rather than calling g_socket_condition_check() and then
28623 * writing to the socket if it succeeds, it is generally better to
28624 * simply try writing to the socket right away, and try again later if
28625 * the initial attempt returns %G_IO_ERROR_WOULD_BLOCK.
28627 * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in condition;
28628 * these conditions will always be set in the output if they are true.
28630 * This call never blocks.
28632 * Returns: the @GIOCondition mask of the current state
28638 * g_socket_condition_timed_wait:
28639 * @socket: a #GSocket
28640 * @condition: a #GIOCondition mask to wait for
28641 * @timeout: the maximum time (in microseconds) to wait, or -1
28642 * @cancellable: (allow-none): a #GCancellable, or %NULL
28643 * @error: a #GError pointer, or %NULL
28645 * Waits for up to @timeout microseconds for @condition to become true
28646 * on @socket. If the condition is met, %TRUE is returned.
28648 * If @cancellable is cancelled before the condition is met, or if
28649 * @timeout (or the socket's #GSocket:timeout) is reached before the
28650 * condition is met, then %FALSE is returned and @error, if non-%NULL,
28651 * is set to the appropriate value (%G_IO_ERROR_CANCELLED or
28652 * %G_IO_ERROR_TIMED_OUT).
28654 * If you don't want a timeout, use g_socket_condition_wait().
28655 * (Alternatively, you can pass -1 for @timeout.)
28657 * Note that although @timeout is in microseconds for consistency with
28658 * other GLib APIs, this function actually only has millisecond
28659 * resolution, and the behavior is undefined if @timeout is not an
28660 * exact number of milliseconds.
28662 * Returns: %TRUE if the condition was met, %FALSE otherwise
28668 * g_socket_condition_wait:
28669 * @socket: a #GSocket
28670 * @condition: a #GIOCondition mask to wait for
28671 * @cancellable: (allow-none): a #GCancellable, or %NULL
28672 * @error: a #GError pointer, or %NULL
28674 * Waits for @condition to become true on @socket. When the condition
28675 * is met, %TRUE is returned.
28677 * If @cancellable is cancelled before the condition is met, or if the
28678 * socket has a timeout set and it is reached before the condition is
28679 * met, then %FALSE is returned and @error, if non-%NULL, is set to
28680 * the appropriate value (%G_IO_ERROR_CANCELLED or
28681 * %G_IO_ERROR_TIMED_OUT).
28683 * See also g_socket_condition_timed_wait().
28685 * Returns: %TRUE if the condition was met, %FALSE otherwise
28691 * g_socket_connect:
28692 * @socket: a #GSocket.
28693 * @address: a #GSocketAddress specifying the remote address.
28694 * @cancellable: (allow-none): a %GCancellable or %NULL
28695 * @error: #GError for error reporting, or %NULL to ignore.
28697 * Connect the socket to the specified remote address.
28699 * For connection oriented socket this generally means we attempt to make
28700 * a connection to the @address. For a connection-less socket it sets
28701 * the default address for g_socket_send() and discards all incoming datagrams
28702 * from other sources.
28704 * Generally connection oriented sockets can only connect once, but
28705 * connection-less sockets can connect multiple times to change the
28708 * If the connect call needs to do network I/O it will block, unless
28709 * non-blocking I/O is enabled. Then %G_IO_ERROR_PENDING is returned
28710 * and the user can be notified of the connection finishing by waiting
28711 * for the G_IO_OUT condition. The result of the connection must then be
28712 * checked with g_socket_check_connect_result().
28714 * Returns: %TRUE if connected, %FALSE on error.
28720 * g_socket_connectable_enumerate:
28721 * @connectable: a #GSocketConnectable
28723 * Creates a #GSocketAddressEnumerator for @connectable.
28725 * Returns: (transfer full): a new #GSocketAddressEnumerator.
28731 * g_socket_connectable_proxy_enumerate:
28732 * @connectable: a #GSocketConnectable
28734 * Creates a #GSocketAddressEnumerator for @connectable that will
28735 * return #GProxyAddress<!-- -->es for addresses that you must connect
28738 * If @connectable does not implement
28739 * g_socket_connectable_proxy_enumerate(), this will fall back to
28740 * calling g_socket_connectable_enumerate().
28742 * Returns: (transfer full): a new #GSocketAddressEnumerator.
28748 * g_socket_connection_connect:
28749 * @connection: a #GSocketConnection
28750 * @address: a #GSocketAddress specifying the remote address.
28751 * @cancellable: (allow-none): a %GCancellable or %NULL
28752 * @error: #GError for error reporting, or %NULL to ignore.
28754 * Connect @connection to the specified remote address.
28756 * Returns: %TRUE if the connection succeeded, %FALSE on error
28762 * g_socket_connection_connect_async:
28763 * @connection: a #GSocketConnection
28764 * @address: a #GSocketAddress specifying the remote address.
28765 * @cancellable: (allow-none): a %GCancellable or %NULL
28766 * @callback: (scope async): a #GAsyncReadyCallback
28767 * @user_data: (closure): user data for the callback
28769 * Asynchronously connect @connection to the specified remote address.
28771 * This clears the #GSocket:blocking flag on @connection's underlying
28772 * socket if it is currently set.
28774 * Use g_socket_connection_connect_finish() to retrieve the result.
28781 * g_socket_connection_connect_finish:
28782 * @connection: a #GSocketConnection
28783 * @result: the #GAsyncResult
28784 * @error: #GError for error reporting, or %NULL to ignore.
28786 * Gets the result of a g_socket_connection_connect_async() call.
28788 * Returns: %TRUE if the connection succeeded, %FALSE on error
28794 * g_socket_connection_factory_create_connection:
28795 * @socket: a #GSocket
28797 * Creates a #GSocketConnection subclass of the right type for
28800 * Returns: (transfer full): a #GSocketConnection
28806 * g_socket_connection_factory_lookup_type:
28807 * @family: a #GSocketFamily
28808 * @type: a #GSocketType
28809 * @protocol_id: a protocol id
28811 * Looks up the #GType to be used when creating socket connections on
28812 * sockets with the specified @family, @type and @protocol_id.
28814 * If no type is registered, the #GSocketConnection base type is returned.
28816 * Returns: a #GType
28822 * g_socket_connection_factory_register_type:
28823 * @g_type: a #GType, inheriting from %G_TYPE_SOCKET_CONNECTION
28824 * @family: a #GSocketFamily
28825 * @type: a #GSocketType
28826 * @protocol: a protocol id
28828 * Looks up the #GType to be used when creating socket connections on
28829 * sockets with the specified @family, @type and @protocol.
28831 * If no type is registered, the #GSocketConnection base type is returned.
28838 * g_socket_connection_get_local_address:
28839 * @connection: a #GSocketConnection
28840 * @error: #GError for error reporting, or %NULL to ignore.
28842 * Try to get the local address of a socket connection.
28844 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28850 * g_socket_connection_get_remote_address:
28851 * @connection: a #GSocketConnection
28852 * @error: #GError for error reporting, or %NULL to ignore.
28854 * Try to get the remote address of a socket connection.
28856 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28862 * g_socket_connection_get_socket:
28863 * @connection: a #GSocketConnection
28865 * Gets the underlying #GSocket object of the connection.
28866 * This can be useful if you want to do something unusual on it
28867 * not supported by the #GSocketConnection APIs.
28869 * Returns: (transfer none): a #GSocketAddress or %NULL on error.
28875 * g_socket_connection_is_connected:
28876 * @connection: a #GSocketConnection
28878 * Checks if @connection is connected. This is equivalent to calling
28879 * g_socket_is_connected() on @connection's underlying #GSocket.
28881 * Returns: whether @connection is connected
28887 * g_socket_control_message_deserialize:
28888 * @level: a socket level
28889 * @type: a socket control message type for the given @level
28890 * @size: the size of the data in bytes
28891 * @data: (array length=size) (element-type guint8): pointer to the message data
28893 * Tries to deserialize a socket control message of a given
28894 * @level and @type. This will ask all known (to GType) subclasses
28895 * of #GSocketControlMessage if they can understand this kind
28896 * of message and if so deserialize it into a #GSocketControlMessage.
28898 * If there is no implementation for this kind of control message, %NULL
28899 * will be returned.
28901 * Returns: (transfer full): the deserialized message or %NULL
28907 * g_socket_control_message_get_level:
28908 * @message: a #GSocketControlMessage
28910 * Returns the "level" (i.e. the originating protocol) of the control message.
28911 * This is often SOL_SOCKET.
28913 * Returns: an integer describing the level
28919 * g_socket_control_message_get_msg_type:
28920 * @message: a #GSocketControlMessage
28922 * Returns the protocol specific type of the control message.
28923 * For instance, for UNIX fd passing this would be SCM_RIGHTS.
28925 * Returns: an integer describing the type of control message
28931 * g_socket_control_message_get_size:
28932 * @message: a #GSocketControlMessage
28934 * Returns the space required for the control message, not including
28935 * headers or alignment.
28937 * Returns: The number of bytes required.
28943 * g_socket_control_message_serialize:
28944 * @message: a #GSocketControlMessage
28945 * @data: A buffer to write data to
28947 * Converts the data in the message to bytes placed in the
28950 * @data is guaranteed to have enough space to fit the size
28951 * returned by g_socket_control_message_get_size() on this
28959 * g_socket_create_source: (skip)
28960 * @socket: a #GSocket
28961 * @condition: a #GIOCondition mask to monitor
28962 * @cancellable: (allow-none): a %GCancellable or %NULL
28964 * Creates a %GSource that can be attached to a %GMainContext to monitor
28965 * for the availibility of the specified @condition on the socket.
28967 * The callback on the source is of the #GSocketSourceFunc type.
28969 * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in @condition;
28970 * these conditions will always be reported output if they are true.
28972 * @cancellable if not %NULL can be used to cancel the source, which will
28973 * cause the source to trigger, reporting the current condition (which
28974 * is likely 0 unless cancellation happened at the same time as a
28975 * condition change). You can check for this in the callback using
28976 * g_cancellable_is_cancelled().
28978 * If @socket has a timeout set, and it is reached before @condition
28979 * occurs, the source will then trigger anyway, reporting %G_IO_IN or
28980 * %G_IO_OUT depending on @condition. However, @socket will have been
28981 * marked as having had a timeout, and so the next #GSocket I/O method
28982 * you call will then fail with a %G_IO_ERROR_TIMED_OUT.
28984 * Returns: (transfer full): a newly allocated %GSource, free with g_source_unref().
28990 * g_socket_get_available_bytes:
28991 * @socket: a #GSocket
28993 * Get the amount of data pending in the OS input buffer.
28995 * Returns: the number of bytes that can be read from the socket without blocking or -1 on error.
29001 * g_socket_get_blocking:
29002 * @socket: a #GSocket.
29004 * Gets the blocking mode of the socket. For details on blocking I/O,
29005 * see g_socket_set_blocking().
29007 * Returns: %TRUE if blocking I/O is used, %FALSE otherwise.
29013 * g_socket_get_broadcast:
29014 * @socket: a #GSocket.
29016 * Gets the broadcast setting on @socket; if %TRUE,
29017 * it is possible to send packets to broadcast
29018 * addresses or receive from broadcast addresses.
29020 * Returns: the broadcast setting on @socket
29026 * g_socket_get_credentials:
29027 * @socket: a #GSocket.
29028 * @error: #GError for error reporting, or %NULL to ignore.
29030 * Returns the credentials of the foreign process connected to this
29031 * socket, if any (e.g. it is only supported for %G_SOCKET_FAMILY_UNIX
29034 * If this operation isn't supported on the OS, the method fails with
29035 * the %G_IO_ERROR_NOT_SUPPORTED error. On Linux this is implemented
29036 * by reading the %SO_PEERCRED option on the underlying socket.
29038 * Other ways to obtain credentials from a foreign peer includes the
29039 * #GUnixCredentialsMessage type and
29040 * g_unix_connection_send_credentials() /
29041 * g_unix_connection_receive_credentials() functions.
29043 * Returns: (transfer full): %NULL if @error is set, otherwise a #GCredentials object that must be freed with g_object_unref().
29049 * g_socket_get_family:
29050 * @socket: a #GSocket.
29052 * Gets the socket family of the socket.
29054 * Returns: a #GSocketFamily
29061 * @socket: a #GSocket.
29063 * Returns the underlying OS socket object. On unix this
29064 * is a socket file descriptor, and on Windows this is
29065 * a Winsock2 SOCKET handle. This may be useful for
29066 * doing platform specific or otherwise unusual operations
29069 * Returns: the file descriptor of the socket.
29075 * g_socket_get_keepalive:
29076 * @socket: a #GSocket.
29078 * Gets the keepalive mode of the socket. For details on this,
29079 * see g_socket_set_keepalive().
29081 * Returns: %TRUE if keepalive is active, %FALSE otherwise.
29087 * g_socket_get_listen_backlog:
29088 * @socket: a #GSocket.
29090 * Gets the listen backlog setting of the socket. For details on this,
29091 * see g_socket_set_listen_backlog().
29093 * Returns: the maximum number of pending connections.
29099 * g_socket_get_local_address:
29100 * @socket: a #GSocket.
29101 * @error: #GError for error reporting, or %NULL to ignore.
29103 * Try to get the local address of a bound socket. This is only
29104 * useful if the socket has been bound to a local address,
29105 * either explicitly or implicitly when connecting.
29107 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29113 * g_socket_get_multicast_loopback:
29114 * @socket: a #GSocket.
29116 * Gets the multicast loopback setting on @socket; if %TRUE (the
29117 * default), outgoing multicast packets will be looped back to
29118 * multicast listeners on the same host.
29120 * Returns: the multicast loopback setting on @socket
29126 * g_socket_get_multicast_ttl:
29127 * @socket: a #GSocket.
29129 * Gets the multicast time-to-live setting on @socket; see
29130 * g_socket_set_multicast_ttl() for more details.
29132 * Returns: the multicast time-to-live setting on @socket
29138 * g_socket_get_protocol:
29139 * @socket: a #GSocket.
29141 * Gets the socket protocol id the socket was created with.
29142 * In case the protocol is unknown, -1 is returned.
29144 * Returns: a protocol id, or -1 if unknown
29150 * g_socket_get_remote_address:
29151 * @socket: a #GSocket.
29152 * @error: #GError for error reporting, or %NULL to ignore.
29154 * Try to get the remove address of a connected socket. This is only
29155 * useful for connection oriented sockets that have been connected.
29157 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29163 * g_socket_get_socket_type:
29164 * @socket: a #GSocket.
29166 * Gets the socket type of the socket.
29168 * Returns: a #GSocketType
29174 * g_socket_get_timeout:
29175 * @socket: a #GSocket.
29177 * Gets the timeout setting of the socket. For details on this, see
29178 * g_socket_set_timeout().
29180 * Returns: the timeout in seconds
29186 * g_socket_get_ttl:
29187 * @socket: a #GSocket.
29189 * Gets the unicast time-to-live setting on @socket; see
29190 * g_socket_set_ttl() for more details.
29192 * Returns: the time-to-live setting on @socket
29198 * g_socket_is_closed:
29199 * @socket: a #GSocket
29201 * Checks whether a socket is closed.
29203 * Returns: %TRUE if socket is closed, %FALSE otherwise
29209 * g_socket_is_connected:
29210 * @socket: a #GSocket.
29212 * Check whether the socket is connected. This is only useful for
29213 * connection-oriented sockets.
29215 * Returns: %TRUE if socket is connected, %FALSE otherwise.
29221 * g_socket_join_multicast_group:
29222 * @socket: a #GSocket.
29223 * @group: a #GInetAddress specifying the group address to join.
29224 * @iface: (allow-none): Name of the interface to use, or %NULL
29225 * @source_specific: %TRUE if source-specific multicast should be used
29226 * @error: #GError for error reporting, or %NULL to ignore.
29228 * Registers @socket to receive multicast messages sent to @group.
29229 * @socket must be a %G_SOCKET_TYPE_DATAGRAM socket, and must have
29230 * been bound to an appropriate interface and port with
29233 * If @iface is %NULL, the system will automatically pick an interface
29234 * to bind to based on @group.
29236 * If @source_specific is %TRUE, source-specific multicast as defined
29237 * in RFC 4604 is used. Note that on older platforms this may fail
29238 * with a %G_IO_ERROR_NOT_SUPPORTED error.
29240 * Returns: %TRUE on success, %FALSE on error.
29246 * g_socket_leave_multicast_group:
29247 * @socket: a #GSocket.
29248 * @group: a #GInetAddress specifying the group address to leave.
29249 * @iface: (allow-none): Interface used
29250 * @source_specific: %TRUE if source-specific multicast was used
29251 * @error: #GError for error reporting, or %NULL to ignore.
29253 * Removes @socket from the multicast group defined by @group, @iface,
29254 * and @source_specific (which must all have the same values they had
29255 * when you joined the group).
29257 * @socket remains bound to its address and port, and can still receive
29258 * unicast messages after calling this.
29260 * Returns: %TRUE on success, %FALSE on error.
29267 * @socket: a #GSocket.
29268 * @error: #GError for error reporting, or %NULL to ignore.
29270 * Marks the socket as a server socket, i.e. a socket that is used
29271 * to accept incoming requests using g_socket_accept().
29273 * Before calling this the socket must be bound to a local address using
29276 * To set the maximum amount of outstanding clients, use
29277 * g_socket_set_listen_backlog().
29279 * Returns: %TRUE on success, %FALSE on error.
29285 * g_socket_listener_accept:
29286 * @listener: a #GSocketListener
29287 * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL
29288 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29289 * @error: #GError for error reporting, or %NULL to ignore.
29291 * Blocks waiting for a client to connect to any of the sockets added
29292 * to the listener. Returns a #GSocketConnection for the socket that was
29295 * If @source_object is not %NULL it will be filled out with the source
29296 * object specified when the corresponding socket or address was added
29299 * If @cancellable is not %NULL, then the operation can be cancelled by
29300 * triggering the cancellable object from another thread. If the operation
29301 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29303 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29309 * g_socket_listener_accept_async:
29310 * @listener: a #GSocketListener
29311 * @cancellable: (allow-none): a #GCancellable, or %NULL
29312 * @callback: (scope async): a #GAsyncReadyCallback
29313 * @user_data: (closure): user data for the callback
29315 * This is the asynchronous version of g_socket_listener_accept().
29317 * When the operation is finished @callback will be
29318 * called. You can then call g_socket_listener_accept_socket()
29319 * to get the result of the operation.
29326 * g_socket_listener_accept_finish:
29327 * @listener: a #GSocketListener
29328 * @result: a #GAsyncResult.
29329 * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29330 * @error: a #GError location to store the error occurring, or %NULL to ignore.
29332 * Finishes an async accept operation. See g_socket_listener_accept_async()
29334 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29340 * g_socket_listener_accept_socket:
29341 * @listener: a #GSocketListener
29342 * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL.
29343 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29344 * @error: #GError for error reporting, or %NULL to ignore.
29346 * Blocks waiting for a client to connect to any of the sockets added
29347 * to the listener. Returns the #GSocket that was accepted.
29349 * If you want to accept the high-level #GSocketConnection, not a #GSocket,
29350 * which is often the case, then you should use g_socket_listener_accept()
29353 * If @source_object is not %NULL it will be filled out with the source
29354 * object specified when the corresponding socket or address was added
29357 * If @cancellable is not %NULL, then the operation can be cancelled by
29358 * triggering the cancellable object from another thread. If the operation
29359 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29361 * Returns: (transfer full): a #GSocket on success, %NULL on error.
29367 * g_socket_listener_accept_socket_async:
29368 * @listener: a #GSocketListener
29369 * @cancellable: (allow-none): a #GCancellable, or %NULL
29370 * @callback: (scope async): a #GAsyncReadyCallback
29371 * @user_data: (closure): user data for the callback
29373 * This is the asynchronous version of g_socket_listener_accept_socket().
29375 * When the operation is finished @callback will be
29376 * called. You can then call g_socket_listener_accept_socket_finish()
29377 * to get the result of the operation.
29384 * g_socket_listener_accept_socket_finish:
29385 * @listener: a #GSocketListener
29386 * @result: a #GAsyncResult.
29387 * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29388 * @error: a #GError location to store the error occurring, or %NULL to ignore.
29390 * Finishes an async accept operation. See g_socket_listener_accept_socket_async()
29392 * Returns: (transfer full): a #GSocket on success, %NULL on error.
29398 * g_socket_listener_add_address:
29399 * @listener: a #GSocketListener
29400 * @address: a #GSocketAddress
29401 * @type: a #GSocketType
29402 * @protocol: a #GSocketProtocol
29403 * @source_object: (allow-none): Optional #GObject identifying this source
29404 * @effective_address: (out) (allow-none): location to store the address that was bound to, or %NULL.
29405 * @error: #GError for error reporting, or %NULL to ignore.
29407 * Creates a socket of type @type and protocol @protocol, binds
29408 * it to @address and adds it to the set of sockets we're accepting
29411 * Note that adding an IPv6 address, depending on the platform,
29412 * may or may not result in a listener that also accepts IPv4
29413 * connections. For more deterministic behavior, see
29414 * g_socket_listener_add_inet_port().
29416 * @source_object will be passed out in the various calls
29417 * to accept to identify this particular source, which is
29418 * useful if you're listening on multiple addresses and do
29419 * different things depending on what address is connected to.
29421 * If successful and @effective_address is non-%NULL then it will
29422 * be set to the address that the binding actually occurred at. This
29423 * is helpful for determining the port number that was used for when
29424 * requesting a binding to port 0 (ie: "any port"). This address, if
29425 * requested, belongs to the caller and must be freed.
29427 * Returns: %TRUE on success, %FALSE on error.
29433 * g_socket_listener_add_any_inet_port:
29434 * @listener: a #GSocketListener
29435 * @source_object: (allow-none): Optional #GObject identifying this source
29436 * @error: a #GError location to store the error occurring, or %NULL to ignore.
29438 * Listens for TCP connections on any available port number for both
29439 * IPv6 and IPv4 (if each is available).
29441 * This is useful if you need to have a socket for incoming connections
29442 * but don't care about the specific port number.
29444 * @source_object will be passed out in the various calls
29445 * to accept to identify this particular source, which is
29446 * useful if you're listening on multiple addresses and do
29447 * different things depending on what address is connected to.
29449 * Returns: the port number, or 0 in case of failure.
29455 * g_socket_listener_add_inet_port:
29456 * @listener: a #GSocketListener
29457 * @port: an IP port number (non-zero)
29458 * @source_object: (allow-none): Optional #GObject identifying this source
29459 * @error: #GError for error reporting, or %NULL to ignore.
29461 * Helper function for g_socket_listener_add_address() that
29462 * creates a TCP/IP socket listening on IPv4 and IPv6 (if
29463 * supported) on the specified port on all interfaces.
29465 * @source_object will be passed out in the various calls
29466 * to accept to identify this particular source, which is
29467 * useful if you're listening on multiple addresses and do
29468 * different things depending on what address is connected to.
29470 * Returns: %TRUE on success, %FALSE on error.
29476 * g_socket_listener_add_socket:
29477 * @listener: a #GSocketListener
29478 * @socket: a listening #GSocket
29479 * @source_object: (allow-none): Optional #GObject identifying this source
29480 * @error: #GError for error reporting, or %NULL to ignore.
29482 * Adds @socket to the set of sockets that we try to accept
29483 * new clients from. The socket must be bound to a local
29484 * address and listened to.
29486 * @source_object will be passed out in the various calls
29487 * to accept to identify this particular source, which is
29488 * useful if you're listening on multiple addresses and do
29489 * different things depending on what address is connected to.
29491 * Returns: %TRUE on success, %FALSE on error.
29497 * g_socket_listener_close:
29498 * @listener: a #GSocketListener
29500 * Closes all the sockets in the listener.
29507 * g_socket_listener_new:
29509 * Creates a new #GSocketListener with no sockets to listen for.
29510 * New listeners can be added with e.g. g_socket_listener_add_address()
29511 * or g_socket_listener_add_inet_port().
29513 * Returns: a new #GSocketListener.
29519 * g_socket_listener_set_backlog:
29520 * @listener: a #GSocketListener
29521 * @listen_backlog: an integer
29523 * Sets the listen backlog on the sockets in the listener.
29525 * See g_socket_set_listen_backlog() for details
29533 * @family: the socket family to use, e.g. %G_SOCKET_FAMILY_IPV4.
29534 * @type: the socket type to use.
29535 * @protocol: the id of the protocol to use, or 0 for default.
29536 * @error: #GError for error reporting, or %NULL to ignore.
29538 * Creates a new #GSocket with the defined family, type and protocol.
29539 * If @protocol is 0 (%G_SOCKET_PROTOCOL_DEFAULT) the default protocol type
29540 * for the family and type is used.
29542 * The @protocol is a family and type specific int that specifies what
29543 * kind of protocol to use. #GSocketProtocol lists several common ones.
29544 * Many families only support one protocol, and use 0 for this, others
29545 * support several and using 0 means to use the default protocol for
29546 * the family and type.
29548 * The protocol id is passed directly to the operating
29549 * system, so you can use protocols not listed in #GSocketProtocol if you
29550 * know the protocol number used for it.
29552 * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
29558 * g_socket_new_from_fd:
29559 * @fd: a native socket file descriptor.
29560 * @error: #GError for error reporting, or %NULL to ignore.
29562 * Creates a new #GSocket from a native file descriptor
29563 * or winsock SOCKET handle.
29565 * This reads all the settings from the file descriptor so that
29566 * all properties should work. Note that the file descriptor
29567 * will be set to non-blocking mode, independent on the blocking
29568 * mode of the #GSocket.
29570 * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
29576 * g_socket_receive:
29577 * @socket: a #GSocket
29578 * @buffer: a buffer to read data into (which should be at least @size bytes long).
29579 * @size: the number of bytes you want to read from the socket
29580 * @cancellable: (allow-none): a %GCancellable or %NULL
29581 * @error: #GError for error reporting, or %NULL to ignore.
29583 * Receive data (up to @size bytes) from a socket. This is mainly used by
29584 * connection-oriented sockets; it is identical to g_socket_receive_from()
29585 * with @address set to %NULL.
29587 * For %G_SOCKET_TYPE_DATAGRAM and %G_SOCKET_TYPE_SEQPACKET sockets,
29588 * g_socket_receive() will always read either 0 or 1 complete messages from
29589 * the socket. If the received message is too large to fit in @buffer, then
29590 * the data beyond @size bytes will be discarded, without any explicit
29591 * indication that this has occurred.
29593 * For %G_SOCKET_TYPE_STREAM sockets, g_socket_receive() can return any
29594 * number of bytes, up to @size. If more than @size bytes have been
29595 * received, the additional data will be returned in future calls to
29596 * g_socket_receive().
29598 * If the socket is in blocking mode the call will block until there
29599 * is some data to receive, the connection is closed, or there is an
29600 * error. If there is no data available and the socket is in
29601 * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
29602 * returned. To be notified when data is available, wait for the
29603 * %G_IO_IN condition.
29605 * On error -1 is returned and @error is set accordingly.
29607 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29613 * g_socket_receive_from:
29614 * @socket: a #GSocket
29615 * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
29616 * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
29617 * @size: the number of bytes you want to read from the socket
29618 * @cancellable: (allow-none): a %GCancellable or %NULL
29619 * @error: #GError for error reporting, or %NULL to ignore.
29621 * Receive data (up to @size bytes) from a socket.
29623 * If @address is non-%NULL then @address will be set equal to the
29624 * source address of the received packet.
29625 * @address is owned by the caller.
29627 * See g_socket_receive() for additional information.
29629 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29635 * g_socket_receive_message:
29636 * @socket: a #GSocket
29637 * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
29638 * @vectors: (array length=num_vectors): an array of #GInputVector structs
29639 * @num_vectors: the number of elements in @vectors, or -1
29640 * @messages: (array length=num_messages) (allow-none): a pointer which may be filled with an array of #GSocketControlMessages, or %NULL
29641 * @num_messages: a pointer which will be filled with the number of elements in @messages, or %NULL
29642 * @flags: a pointer to an int containing #GSocketMsgFlags flags
29643 * @cancellable: (allow-none): a %GCancellable or %NULL
29644 * @error: a #GError pointer, or %NULL
29646 * Receive data from a socket. This is the most complicated and
29647 * fully-featured version of this call. For easier use, see
29648 * g_socket_receive() and g_socket_receive_from().
29650 * If @address is non-%NULL then @address will be set equal to the
29651 * source address of the received packet.
29652 * @address is owned by the caller.
29654 * @vector must point to an array of #GInputVector structs and
29655 * @num_vectors must be the length of this array. These structs
29656 * describe the buffers that received data will be scattered into.
29657 * If @num_vectors is -1, then @vectors is assumed to be terminated
29658 * by a #GInputVector with a %NULL buffer pointer.
29660 * As a special case, if @num_vectors is 0 (in which case, @vectors
29661 * may of course be %NULL), then a single byte is received and
29662 * discarded. This is to facilitate the common practice of sending a
29663 * single '\0' byte for the purposes of transferring ancillary data.
29665 * @messages, if non-%NULL, will be set to point to a newly-allocated
29666 * array of #GSocketControlMessage instances or %NULL if no such
29667 * messages was received. These correspond to the control messages
29668 * received from the kernel, one #GSocketControlMessage per message
29669 * from the kernel. This array is %NULL-terminated and must be freed
29670 * by the caller using g_free() after calling g_object_unref() on each
29671 * element. If @messages is %NULL, any control messages received will
29674 * @num_messages, if non-%NULL, will be set to the number of control
29675 * messages received.
29677 * If both @messages and @num_messages are non-%NULL, then
29678 * @num_messages gives the number of #GSocketControlMessage instances
29679 * in @messages (ie: not including the %NULL terminator).
29681 * @flags is an in/out parameter. The commonly available arguments
29682 * for this are available in the #GSocketMsgFlags enum, but the
29683 * values there are the same as the system values, and the flags
29684 * are passed in as-is, so you can pass in system-specific flags too
29685 * (and g_socket_receive_message() may pass system-specific flags out).
29687 * As with g_socket_receive(), data may be discarded if @socket is
29688 * %G_SOCKET_TYPE_DATAGRAM or %G_SOCKET_TYPE_SEQPACKET and you do not
29689 * provide enough buffer space to read a complete message. You can pass
29690 * %G_SOCKET_MSG_PEEK in @flags to peek at the current message without
29691 * removing it from the receive queue, but there is no portable way to find
29692 * out the length of the message other than by reading it into a
29693 * sufficiently-large buffer.
29695 * If the socket is in blocking mode the call will block until there
29696 * is some data to receive, the connection is closed, or there is an
29697 * error. If there is no data available and the socket is in
29698 * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
29699 * returned. To be notified when data is available, wait for the
29700 * %G_IO_IN condition.
29702 * On error -1 is returned and @error is set accordingly.
29704 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29710 * g_socket_receive_with_blocking:
29711 * @socket: a #GSocket
29712 * @buffer: a buffer to read data into (which should be at least @size bytes long).
29713 * @size: the number of bytes you want to read from the socket
29714 * @blocking: whether to do blocking or non-blocking I/O
29715 * @cancellable: (allow-none): a %GCancellable or %NULL
29716 * @error: #GError for error reporting, or %NULL to ignore.
29718 * This behaves exactly the same as g_socket_receive(), except that
29719 * the choice of blocking or non-blocking behavior is determined by
29720 * the @blocking argument rather than by @socket's properties.
29722 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29729 * @socket: a #GSocket
29730 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29731 * @size: the number of bytes to send
29732 * @cancellable: (allow-none): a %GCancellable or %NULL
29733 * @error: #GError for error reporting, or %NULL to ignore.
29735 * Tries to send @size bytes from @buffer on the socket. This is
29736 * mainly used by connection-oriented sockets; it is identical to
29737 * g_socket_send_to() with @address set to %NULL.
29739 * If the socket is in blocking mode the call will block until there is
29740 * space for the data in the socket queue. If there is no space available
29741 * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
29742 * will be returned. To be notified when space is available, wait for the
29743 * %G_IO_OUT condition. Note though that you may still receive
29744 * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
29745 * notified of a %G_IO_OUT condition. (On Windows in particular, this is
29746 * very common due to the way the underlying APIs work.)
29748 * On error -1 is returned and @error is set accordingly.
29750 * Returns: Number of bytes written (which may be less than @size), or -1 on error
29756 * g_socket_send_message:
29757 * @socket: a #GSocket
29758 * @address: (allow-none): a #GSocketAddress, or %NULL
29759 * @vectors: (array length=num_vectors): an array of #GOutputVector structs
29760 * @num_vectors: the number of elements in @vectors, or -1
29761 * @messages: (array length=num_messages) (allow-none): a pointer to an array of #GSocketControlMessages, or %NULL.
29762 * @num_messages: number of elements in @messages, or -1.
29763 * @flags: an int containing #GSocketMsgFlags flags
29764 * @cancellable: (allow-none): a %GCancellable or %NULL
29765 * @error: #GError for error reporting, or %NULL to ignore.
29767 * Send data to @address on @socket. This is the most complicated and
29768 * fully-featured version of this call. For easier use, see
29769 * g_socket_send() and g_socket_send_to().
29771 * If @address is %NULL then the message is sent to the default receiver
29772 * (set by g_socket_connect()).
29774 * @vectors must point to an array of #GOutputVector structs and
29775 * @num_vectors must be the length of this array. (If @num_vectors is -1,
29776 * then @vectors is assumed to be terminated by a #GOutputVector with a
29777 * %NULL buffer pointer.) The #GOutputVector structs describe the buffers
29778 * that the sent data will be gathered from. Using multiple
29779 * #GOutputVector<!-- -->s is more memory-efficient than manually copying
29780 * data from multiple sources into a single buffer, and more
29781 * network-efficient than making multiple calls to g_socket_send().
29783 * @messages, if non-%NULL, is taken to point to an array of @num_messages
29784 * #GSocketControlMessage instances. These correspond to the control
29785 * messages to be sent on the socket.
29786 * If @num_messages is -1 then @messages is treated as a %NULL-terminated
29789 * @flags modify how the message is sent. The commonly available arguments
29790 * for this are available in the #GSocketMsgFlags enum, but the
29791 * values there are the same as the system values, and the flags
29792 * are passed in as-is, so you can pass in system-specific flags too.
29794 * If the socket is in blocking mode the call will block until there is
29795 * space for the data in the socket queue. If there is no space available
29796 * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
29797 * will be returned. To be notified when space is available, wait for the
29798 * %G_IO_OUT condition. Note though that you may still receive
29799 * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
29800 * notified of a %G_IO_OUT condition. (On Windows in particular, this is
29801 * very common due to the way the underlying APIs work.)
29803 * On error -1 is returned and @error is set accordingly.
29805 * Returns: Number of bytes written (which may be less than @size), or -1 on error
29811 * g_socket_send_to:
29812 * @socket: a #GSocket
29813 * @address: (allow-none): a #GSocketAddress, or %NULL
29814 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29815 * @size: the number of bytes to send
29816 * @cancellable: (allow-none): a %GCancellable or %NULL
29817 * @error: #GError for error reporting, or %NULL to ignore.
29819 * Tries to send @size bytes from @buffer to @address. If @address is
29820 * %NULL then the message is sent to the default receiver (set by
29821 * g_socket_connect()).
29823 * See g_socket_send() for additional information.
29825 * Returns: Number of bytes written (which may be less than @size), or -1 on error
29831 * g_socket_send_with_blocking:
29832 * @socket: a #GSocket
29833 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29834 * @size: the number of bytes to send
29835 * @blocking: whether to do blocking or non-blocking I/O
29836 * @cancellable: (allow-none): a %GCancellable or %NULL
29837 * @error: #GError for error reporting, or %NULL to ignore.
29839 * This behaves exactly the same as g_socket_send(), except that
29840 * the choice of blocking or non-blocking behavior is determined by
29841 * the @blocking argument rather than by @socket's properties.
29843 * Returns: Number of bytes written (which may be less than @size), or -1 on error
29849 * g_socket_service_is_active:
29850 * @service: a #GSocketService
29852 * Check whether the service is active or not. An active
29853 * service will accept new clients that connect, while
29854 * a non-active service will let connecting clients queue
29855 * up until the service is started.
29857 * Returns: %TRUE if the service is active, %FALSE otherwise
29863 * g_socket_service_new:
29865 * Creates a new #GSocketService with no sockets to listen for.
29866 * New listeners can be added with e.g. g_socket_listener_add_address()
29867 * or g_socket_listener_add_inet_port().
29869 * Returns: a new #GSocketService.
29875 * g_socket_service_start:
29876 * @service: a #GSocketService
29878 * Starts the service, i.e. start accepting connections
29879 * from the added sockets when the mainloop runs.
29881 * This call is thread-safe, so it may be called from a thread
29882 * handling an incoming client request.
29889 * g_socket_service_stop:
29890 * @service: a #GSocketService
29892 * Stops the service, i.e. stops 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_set_blocking:
29904 * @socket: a #GSocket.
29905 * @blocking: Whether to use blocking I/O or not.
29907 * Sets the blocking mode of the socket. In blocking mode
29908 * all operations block until they succeed or there is an error. In
29909 * non-blocking mode all functions return results immediately or
29910 * with a %G_IO_ERROR_WOULD_BLOCK error.
29912 * All sockets are created in blocking mode. However, note that the
29913 * platform level socket is always non-blocking, and blocking mode
29914 * is a GSocket level feature.
29921 * g_socket_set_broadcast:
29922 * @socket: a #GSocket.
29923 * @broadcast: whether @socket should allow sending to and receiving from broadcast addresses
29925 * Sets whether @socket should allow sending to and receiving from
29926 * broadcast addresses. This is %FALSE by default.
29933 * g_socket_set_keepalive:
29934 * @socket: a #GSocket.
29935 * @keepalive: Value for the keepalive flag
29937 * Sets or unsets the %SO_KEEPALIVE flag on the underlying socket. When
29938 * this flag is set on a socket, the system will attempt to verify that the
29939 * remote socket endpoint is still present if a sufficiently long period of
29940 * time passes with no data being exchanged. If the system is unable to
29941 * verify the presence of the remote endpoint, it will automatically close
29944 * This option is only functional on certain kinds of sockets. (Notably,
29945 * %G_SOCKET_PROTOCOL_TCP sockets.)
29947 * The exact time between pings is system- and protocol-dependent, but will
29948 * normally be at least two hours. Most commonly, you would set this flag
29949 * on a server socket if you want to allow clients to remain idle for long
29950 * periods of time, but also want to ensure that connections are eventually
29951 * garbage-collected if clients crash or become unreachable.
29958 * g_socket_set_listen_backlog:
29959 * @socket: a #GSocket.
29960 * @backlog: the maximum number of pending connections.
29962 * Sets the maximum number of outstanding connections allowed
29963 * when listening on this socket. If more clients than this are
29964 * connecting to the socket and the application is not handling them
29965 * on time then the new connections will be refused.
29967 * Note that this must be called before g_socket_listen() and has no
29968 * effect if called after that.
29975 * g_socket_set_multicast_loopback:
29976 * @socket: a #GSocket.
29977 * @loopback: whether @socket should receive messages sent to its multicast groups from the local host
29979 * Sets whether outgoing multicast packets will be received by sockets
29980 * listening on that multicast address on the same host. This is %TRUE
29988 * g_socket_set_multicast_ttl:
29989 * @socket: a #GSocket.
29990 * @ttl: the time-to-live value for all multicast datagrams on @socket
29992 * Sets the time-to-live for outgoing multicast datagrams on @socket.
29993 * By default, this is 1, meaning that multicast packets will not leave
29994 * the local network.
30001 * g_socket_set_timeout:
30002 * @socket: a #GSocket.
30003 * @timeout: the timeout for @socket, in seconds, or 0 for none
30005 * Sets the time in seconds after which I/O operations on @socket will
30006 * time out if they have not yet completed.
30008 * On a blocking socket, this means that any blocking #GSocket
30009 * operation will time out after @timeout seconds of inactivity,
30010 * returning %G_IO_ERROR_TIMED_OUT.
30012 * On a non-blocking socket, calls to g_socket_condition_wait() will
30013 * also fail with %G_IO_ERROR_TIMED_OUT after the given time. Sources
30014 * created with g_socket_create_source() will trigger after
30015 * @timeout seconds of inactivity, with the requested condition
30016 * set, at which point calling g_socket_receive(), g_socket_send(),
30017 * g_socket_check_connect_result(), etc, will fail with
30018 * %G_IO_ERROR_TIMED_OUT.
30020 * If @timeout is 0 (the default), operations will never time out
30023 * Note that if an I/O operation is interrupted by a signal, this may
30024 * cause the timeout to be reset.
30031 * g_socket_set_ttl:
30032 * @socket: a #GSocket.
30033 * @ttl: the time-to-live value for all unicast packets on @socket
30035 * Sets the time-to-live for outgoing unicast packets on @socket.
30036 * By default the platform-specific default value is used.
30043 * g_socket_shutdown:
30044 * @socket: a #GSocket
30045 * @shutdown_read: whether to shut down the read side
30046 * @shutdown_write: whether to shut down the write side
30047 * @error: #GError for error reporting, or %NULL to ignore.
30049 * Shut down part of a full-duplex connection.
30051 * If @shutdown_read is %TRUE then the receiving side of the connection
30052 * is shut down, and further reading is disallowed.
30054 * If @shutdown_write is %TRUE then the sending side of the connection
30055 * is shut down, and further writing is disallowed.
30057 * It is allowed for both @shutdown_read and @shutdown_write to be %TRUE.
30059 * One example where this is used is graceful disconnect for TCP connections
30060 * where you close the sending side, then wait for the other side to close
30061 * the connection, thus ensuring that the other side saw all sent data.
30063 * Returns: %TRUE on success, %FALSE on error
30069 * g_socket_speaks_ipv4:
30070 * @socket: a #GSocket
30072 * Checks if a socket is capable of speaking IPv4.
30074 * IPv4 sockets are capable of speaking IPv4. On some operating systems
30075 * and under some combinations of circumstances IPv6 sockets are also
30076 * capable of speaking IPv4. See RFC 3493 section 3.7 for more
30079 * No other types of sockets are currently considered as being capable
30080 * of speaking IPv4.
30082 * Returns: %TRUE if this socket can be used with IPv4.
30088 * g_srv_target_copy:
30089 * @target: a #GSrvTarget
30093 * Returns: a copy of @target
30099 * g_srv_target_free:
30100 * @target: a #GSrvTarget
30109 * g_srv_target_get_hostname:
30110 * @target: a #GSrvTarget
30112 * Gets @target's hostname (in ASCII form; if you are going to present
30113 * this to the user, you should use g_hostname_is_ascii_encoded() to
30114 * check if it contains encoded Unicode segments, and use
30115 * g_hostname_to_unicode() to convert it if it does.)
30117 * Returns: @target's hostname
30123 * g_srv_target_get_port:
30124 * @target: a #GSrvTarget
30126 * Gets @target's port
30128 * Returns: @target's port
30134 * g_srv_target_get_priority:
30135 * @target: a #GSrvTarget
30137 * Gets @target's priority. You should not need to look at this;
30138 * #GResolver already sorts the targets according to the algorithm in
30141 * Returns: @target's priority
30147 * g_srv_target_get_weight:
30148 * @target: a #GSrvTarget
30150 * Gets @target's weight. You should not need to look at this;
30151 * #GResolver already sorts the targets according to the algorithm in
30154 * Returns: @target's weight
30160 * g_srv_target_list_sort: (skip)
30161 * @targets: a #GList of #GSrvTarget
30163 * Sorts @targets in place according to the algorithm in RFC 2782.
30165 * Returns: (transfer full): the head of the sorted list.
30171 * g_srv_target_new:
30172 * @hostname: the host that the service is running on
30173 * @port: the port that the service is running on
30174 * @priority: the target's priority
30175 * @weight: the target's weight
30177 * Creates a new #GSrvTarget with the given parameters.
30179 * You should not need to use this; normally #GSrvTarget<!-- -->s are
30180 * created by #GResolver.
30182 * Returns: a new #GSrvTarget.
30188 * g_static_resource_fini:
30189 * @static_resource: pointer to a static #GStaticResource
30191 * Finalized a GResource initialized by g_static_resource_init().
30193 * This is normally used by code generated by
30194 * <link linkend="glib-compile-resources">glib-compile-resources</link>
30195 * and is not typically used by other code.
30202 * g_static_resource_get_resource:
30203 * @static_resource: pointer to a static #GStaticResource
30205 * Gets the GResource that was registered by a call to 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.
30211 * Returns: (transfer none): a #GResource
30217 * g_static_resource_init:
30218 * @static_resource: pointer to a static #GStaticResource
30220 * Initializes a GResource from static data using a
30223 * This is normally used by code generated by
30224 * <link linkend="glib-compile-resources">glib-compile-resources</link>
30225 * and is not typically used by other code.
30232 * g_tcp_connection_get_graceful_disconnect:
30233 * @connection: a #GTcpConnection
30235 * Checks if graceful disconnects are used. See
30236 * g_tcp_connection_set_graceful_disconnect().
30238 * Returns: %TRUE if graceful disconnect is used on close, %FALSE otherwise
30244 * g_tcp_connection_set_graceful_disconnect:
30245 * @connection: a #GTcpConnection
30246 * @graceful_disconnect: Whether to do graceful disconnects or not
30248 * This enabled graceful disconnects on close. A graceful disconnect
30249 * means that we signal the receiving end that the connection is terminated
30250 * and wait for it to close the connection before closing the connection.
30252 * A graceful disconnect means that we can be sure that we successfully sent
30253 * all the outstanding data to the other end, or get an error reported.
30254 * However, it also means we have to wait for all the data to reach the
30255 * other side and for it to acknowledge this by closing the socket, which may
30256 * take a while. For this reason it is disabled by default.
30263 * g_tcp_wrapper_connection_get_base_io_stream:
30264 * @conn: a #GTcpWrapperConnection
30266 * Get's @conn's base #GIOStream
30268 * Returns: (transfer none): @conn's base #GIOStream
30273 * g_tcp_wrapper_connection_new:
30274 * @base_io_stream: the #GIOStream to wrap
30275 * @socket: the #GSocket associated with @base_io_stream
30277 * Wraps @base_io_stream and @socket together as a #GSocketConnection.
30279 * Returns: the new #GSocketConnection.
30285 * g_test_dbus_add_service_dir:
30286 * @self: a #GTestDBus
30287 * @path: path to a directory containing .service files
30289 * Add a path where dbus-daemon will lookup for .services files. This can't be
30290 * called after g_test_dbus_up().
30295 * g_test_dbus_down:
30296 * @self: a #GTestDBus
30298 * Stop the session bus started by g_test_dbus_up().
30300 * This will wait for the singleton returned by g_bus_get() or g_bus_get_sync()
30301 * is destroyed. This is done to ensure that the next unit test won't get a
30302 * leaked singleton from this test.
30307 * g_test_dbus_get_bus_address:
30308 * @self: a #GTestDBus
30310 * Get the address on which dbus-daemon is running. if g_test_dbus_up() has not
30311 * been called yet, %NULL is returned. This can be used with
30312 * g_dbus_connection_new_for_address()
30314 * Returns: the address of the bus, or %NULL.
30319 * g_test_dbus_get_flags:
30320 * @self: a #GTestDBus
30324 * Returns: the value of #GTestDBus:flags property
30330 * @flags: a #GTestDBusFlags
30332 * Create a new #GTestDBus object.
30334 * Returns: (transfer full): a new #GTestDBus.
30339 * g_test_dbus_stop:
30340 * @self: a #GTestDBus
30342 * Stop the session bus started by g_test_dbus_up().
30344 * Unlike g_test_dbus_down(), this won't verify the #GDBusConnection
30345 * singleton returned by g_bus_get() or g_bus_get_sync() is destroyed. Unit
30346 * tests wanting to verify behaviour after the session bus has been stopped
30347 * can use this function but should still call g_test_dbus_down() when done.
30352 * g_test_dbus_unset:
30354 * Unset DISPLAY and DBUS_SESSION_BUS_ADDRESS env variables to ensure the test
30355 * won't use user's session bus.
30357 * This is useful for unit tests that want to verify behaviour when no session
30358 * bus is running. It is not necessary to call this if unit test already calls
30359 * g_test_dbus_up() before acquiring the session bus.
30365 * @self: a #GTestDBus
30367 * Start a dbus-daemon instance and set DBUS_SESSION_BUS_ADDRESS. After this
30368 * call, it is safe for unit tests to start sending messages on the session bug.
30370 * If this function is called from setup callback of g_test_add(),
30371 * g_test_dbus_down() must be called in its teardown callback.
30373 * If this function is called from unit test's main(), then g_test_dbus_down()
30374 * must be called after g_test_run().
30379 * g_themed_icon_append_name:
30380 * @icon: a #GThemedIcon
30381 * @iconname: name of icon to append to list of icons from within @icon.
30383 * Append a name to the list of icons from within @icon.
30386 * Note that doing so invalidates the hash computed by prior calls
30387 * to g_icon_hash().
30393 * g_themed_icon_get_names:
30394 * @icon: a #GThemedIcon.
30396 * Gets the names of icons from within @icon.
30398 * Returns: (transfer none): a list of icon names.
30403 * g_themed_icon_new:
30404 * @iconname: a string containing an icon name.
30406 * Creates a new themed icon for @iconname.
30408 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
30413 * g_themed_icon_new_from_names:
30414 * @iconnames: (array length=len): an array of strings containing icon names.
30415 * @len: the length of the @iconnames array, or -1 if @iconnames is %NULL-terminated
30417 * Creates a new themed icon for @iconnames.
30419 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon
30424 * g_themed_icon_new_with_default_fallbacks:
30425 * @iconname: a string containing an icon name
30427 * Creates a new themed icon for @iconname, and all the names
30428 * that can be created by shortening @iconname at '-' characters.
30430 * In the following example, @icon1 and @icon2 are equivalent:
30432 * const char *names[] = {
30433 * "gnome-dev-cdrom-audio",
30434 * "gnome-dev-cdrom",
30439 * icon1 = g_themed_icon_new_from_names (names, 4);
30440 * icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
30443 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
30448 * g_themed_icon_prepend_name:
30449 * @icon: a #GThemedIcon
30450 * @iconname: name of icon to prepend to list of icons from within @icon.
30452 * Prepend a name to the list of icons from within @icon.
30455 * Note that doing so invalidates the hash computed by prior calls
30456 * to g_icon_hash().
30464 * g_threaded_socket_service_new:
30465 * @max_threads: the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit
30467 * Creates a new #GThreadedSocketService with no listeners. Listeners
30468 * must be added with one of the #GSocketListener "add" methods.
30470 * Returns: a new #GSocketService.
30476 * g_tls_backend_get_certificate_type:
30477 * @backend: the #GTlsBackend
30479 * Gets the #GType of @backend's #GTlsCertificate implementation.
30481 * Returns: the #GType of @backend's #GTlsCertificate implementation.
30487 * g_tls_backend_get_client_connection_type:
30488 * @backend: the #GTlsBackend
30490 * Gets the #GType of @backend's #GTlsClientConnection implementation.
30492 * Returns: the #GType of @backend's #GTlsClientConnection implementation.
30498 * g_tls_backend_get_default:
30500 * Gets the default #GTlsBackend for the system.
30502 * Returns: (transfer none): a #GTlsBackend
30508 * g_tls_backend_get_default_database:
30509 * @backend: the #GTlsBackend
30511 * Gets the default #GTlsDatabase used to verify TLS connections.
30513 * Returns: (transfer full): the default database, which should be unreffed when done.
30519 * g_tls_backend_get_file_database_type:
30520 * @backend: the #GTlsBackend
30522 * Gets the #GType of @backend's #GTlsFileDatabase implementation.
30524 * Returns: the #GType of backend's #GTlsFileDatabase implementation.
30530 * g_tls_backend_get_server_connection_type:
30531 * @backend: the #GTlsBackend
30533 * Gets the #GType of @backend's #GTlsServerConnection implementation.
30535 * Returns: the #GType of @backend's #GTlsServerConnection implementation.
30541 * g_tls_backend_supports_tls:
30542 * @backend: the #GTlsBackend
30544 * Checks if TLS is supported; if this returns %FALSE for the default
30545 * #GTlsBackend, it means no "real" TLS backend is available.
30547 * Returns: whether or not TLS is supported
30553 * g_tls_certificate_get_issuer:
30554 * @cert: a #GTlsCertificate
30556 * Gets the #GTlsCertificate representing @cert's issuer, if known
30558 * Returns: (transfer none): The certificate of @cert's issuer, or %NULL if @cert is self-signed or signed with an unknown certificate.
30564 * g_tls_certificate_is_same:
30565 * @cert_one: first certificate to compare
30566 * @cert_two: second certificate to compare
30568 * Check if two #GTlsCertificate objects represent the same certificate.
30569 * The raw DER byte data of the two certificates are checked for equality.
30570 * This has the effect that two certificates may compare equal even if
30571 * their #GTlsCertificate:issuer, #GTlsCertificate:private-key, or
30572 * #GTlsCertificate:private-key-pem properties differ.
30574 * Returns: whether the same or not
30580 * g_tls_certificate_list_new_from_file:
30581 * @file: file containing PEM-encoded certificates to import
30582 * @error: #GError for error reporting, or %NULL to ignore.
30584 * Creates one or more #GTlsCertificate<!-- -->s from the PEM-encoded
30585 * data in @file. If @file cannot be read or parsed, the function will
30586 * return %NULL and set @error. If @file does not contain any
30587 * PEM-encoded certificates, this will return an empty list and not
30590 * 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.
30596 * g_tls_certificate_new_from_file:
30597 * @file: file containing a PEM-encoded certificate to import
30598 * @error: #GError for error reporting, or %NULL to ignore.
30600 * Creates a #GTlsCertificate from the PEM-encoded data in @file. If
30601 * @file cannot be read or parsed, the function will return %NULL and
30602 * set @error. Otherwise, this behaves like
30603 * g_tls_certificate_new_from_pem().
30605 * Returns: the new certificate, or %NULL on error
30611 * g_tls_certificate_new_from_files:
30612 * @cert_file: file containing a PEM-encoded certificate to import
30613 * @key_file: file containing a PEM-encoded private key to import
30614 * @error: #GError for error reporting, or %NULL to ignore.
30616 * Creates a #GTlsCertificate from the PEM-encoded data in @cert_file
30617 * and @key_file. If either file cannot be read or parsed, the
30618 * function will return %NULL and set @error. Otherwise, this behaves
30619 * like g_tls_certificate_new_from_pem().
30621 * Returns: the new certificate, or %NULL on error
30627 * g_tls_certificate_new_from_pem:
30628 * @data: PEM-encoded certificate data
30629 * @length: the length of @data, or -1 if it's 0-terminated.
30630 * @error: #GError for error reporting, or %NULL to ignore.
30632 * Creates a new #GTlsCertificate from the PEM-encoded data in @data.
30633 * If @data includes both a certificate and a private key, then the
30634 * returned certificate will include the private key data as well. (See
30635 * the #GTlsCertificate:private-key-pem property for information about
30636 * supported formats.)
30638 * If @data includes multiple certificates, only the first one will be
30641 * Returns: the new certificate, or %NULL if @data is invalid
30647 * g_tls_certificate_verify:
30648 * @cert: a #GTlsCertificate
30649 * @identity: (allow-none): the expected peer identity
30650 * @trusted_ca: (allow-none): the certificate of a trusted authority
30652 * This verifies @cert and returns a set of #GTlsCertificateFlags
30653 * indicating any problems found with it. This can be used to verify a
30654 * certificate outside the context of making a connection, or to
30655 * check a certificate against a CA that is not part of the system
30658 * If @identity is not %NULL, @cert's name(s) will be compared against
30659 * it, and %G_TLS_CERTIFICATE_BAD_IDENTITY will be set in the return
30660 * value if it does not match. If @identity is %NULL, that bit will
30661 * never be set in the return value.
30663 * If @trusted_ca is not %NULL, then @cert (or one of the certificates
30664 * in its chain) must be signed by it, or else
30665 * %G_TLS_CERTIFICATE_UNKNOWN_CA will be set in the return value. If
30666 * @trusted_ca is %NULL, that bit will never be set in the return
30669 * (All other #GTlsCertificateFlags values will always be set or unset
30672 * Returns: the appropriate #GTlsCertificateFlags
30678 * g_tls_client_connection_get_accepted_cas:
30679 * @conn: the #GTlsClientConnection
30681 * Gets the list of distinguished names of the Certificate Authorities
30682 * that the server will accept certificates from. This will be set
30683 * during the TLS handshake if the server requests a certificate.
30684 * Otherwise, it will be %NULL.
30686 * Each item in the list is a #GByteArray which contains the complete
30687 * subject DN of the certificate authority.
30689 * 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().
30695 * g_tls_client_connection_get_server_identity:
30696 * @conn: the #GTlsClientConnection
30698 * Gets @conn's expected server identity
30700 * Returns: (transfer none): a #GSocketConnectable describing the expected server identity, or %NULL if the expected identity is not known.
30706 * g_tls_client_connection_get_use_ssl3:
30707 * @conn: the #GTlsClientConnection
30709 * Gets whether @conn will use SSL 3.0 rather than the
30710 * highest-supported version of TLS; see
30711 * g_tls_client_connection_set_use_ssl3().
30713 * Returns: whether @conn will use SSL 3.0
30719 * g_tls_client_connection_get_validation_flags:
30720 * @conn: the #GTlsClientConnection
30722 * Gets @conn's validation flags
30724 * Returns: the validation flags
30730 * g_tls_client_connection_new:
30731 * @base_io_stream: the #GIOStream to wrap
30732 * @server_identity: (allow-none): the expected identity of the server
30733 * @error: #GError for error reporting, or %NULL to ignore.
30735 * Creates a new #GTlsClientConnection wrapping @base_io_stream (which
30736 * must have pollable input and output streams) which is assumed to
30737 * communicate with the server identified by @server_identity.
30739 * Returns: (transfer full) (type GTlsClientConnection): the new #GTlsClientConnection, or %NULL on error
30745 * g_tls_client_connection_set_server_identity:
30746 * @conn: the #GTlsClientConnection
30747 * @identity: a #GSocketConnectable describing the expected server identity
30749 * Sets @conn's expected server identity, which is used both to tell
30750 * servers on virtual hosts which certificate to present, and also
30751 * to let @conn know what name to look for in the certificate when
30752 * performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
30759 * g_tls_client_connection_set_use_ssl3:
30760 * @conn: the #GTlsClientConnection
30761 * @use_ssl3: whether to use SSL 3.0
30763 * If @use_ssl3 is %TRUE, this forces @conn to use SSL 3.0 rather than
30764 * trying to properly negotiate the right version of TLS or SSL to use.
30765 * This can be used when talking to servers that do not implement the
30766 * fallbacks correctly and which will therefore fail to handshake with
30767 * a "modern" TLS handshake attempt.
30774 * g_tls_client_connection_set_validation_flags:
30775 * @conn: the #GTlsClientConnection
30776 * @flags: the #GTlsCertificateFlags to use
30778 * Sets @conn's validation flags, to override the default set of
30779 * checks performed when validating a server certificate. By default,
30780 * %G_TLS_CERTIFICATE_VALIDATE_ALL is used.
30787 * g_tls_connection_emit_accept_certificate:
30788 * @conn: a #GTlsConnection
30789 * @peer_cert: the peer's #GTlsCertificate
30790 * @errors: the problems with @peer_cert
30792 * Used by #GTlsConnection implementations to emit the
30793 * #GTlsConnection::accept-certificate signal.
30795 * Returns: %TRUE if one of the signal handlers has returned %TRUE to accept @peer_cert
30801 * g_tls_connection_get_certificate:
30802 * @conn: a #GTlsConnection
30804 * Gets @conn's certificate, as set by
30805 * g_tls_connection_set_certificate().
30807 * Returns: (transfer none): @conn's certificate, or %NULL
30813 * g_tls_connection_get_database:
30814 * @conn: a #GTlsConnection
30816 * Gets the certificate database that @conn uses to verify
30817 * peer certificates. See g_tls_connection_set_database().
30819 * Returns: (transfer none): the certificate database that @conn uses or %NULL
30825 * g_tls_connection_get_interaction:
30826 * @conn: a connection
30828 * Get the object that will be used to interact with the user. It will be used
30829 * for things like prompting the user for passwords. If %NULL is returned, then
30830 * no user interaction will occur for this connection.
30832 * Returns: (transfer none): The interaction object.
30838 * g_tls_connection_get_peer_certificate:
30839 * @conn: a #GTlsConnection
30841 * Gets @conn's peer's certificate after the handshake has completed.
30842 * (It is not set during the emission of
30843 * #GTlsConnection::accept-certificate.)
30845 * Returns: (transfer none): @conn's peer's certificate, or %NULL
30851 * g_tls_connection_get_peer_certificate_errors:
30852 * @conn: a #GTlsConnection
30854 * Gets the errors associated with validating @conn's peer's
30855 * certificate, after the handshake has completed. (It is not set
30856 * during the emission of #GTlsConnection::accept-certificate.)
30858 * Returns: @conn's peer's certificate errors
30864 * g_tls_connection_get_rehandshake_mode:
30865 * @conn: a #GTlsConnection
30867 * Gets @conn rehandshaking mode. See
30868 * g_tls_connection_set_rehandshake_mode() for details.
30870 * Returns: @conn's rehandshaking mode
30876 * g_tls_connection_get_require_close_notify:
30877 * @conn: a #GTlsConnection
30879 * Tests whether or not @conn expects a proper TLS close notification
30880 * when the connection is closed. See
30881 * g_tls_connection_set_require_close_notify() for details.
30883 * Returns: %TRUE if @conn requires a proper TLS close notification.
30889 * g_tls_connection_get_use_system_certdb:
30890 * @conn: a #GTlsConnection
30892 * Gets whether @conn uses the system certificate database to verify
30893 * peer certificates. See g_tls_connection_set_use_system_certdb().
30895 * Returns: whether @conn uses the system certificate database
30896 * Deprecated: 2.30: Use g_tls_connection_get_database() instead
30901 * g_tls_connection_handshake:
30902 * @conn: a #GTlsConnection
30903 * @cancellable: (allow-none): a #GCancellable, or %NULL
30904 * @error: a #GError, or %NULL
30906 * Attempts a TLS handshake on @conn.
30908 * On the client side, it is never necessary to call this method;
30909 * although the connection needs to perform a handshake after
30910 * connecting (or after sending a "STARTTLS"-type command) and may
30911 * need to rehandshake later if the server requests it,
30912 * #GTlsConnection will handle this for you automatically when you try
30913 * to send or receive data on the connection. However, you can call
30914 * g_tls_connection_handshake() manually if you want to know for sure
30915 * whether the initial handshake succeeded or failed (as opposed to
30916 * just immediately trying to write to @conn's output stream, in which
30917 * case if it fails, it may not be possible to tell if it failed
30918 * before or after completing the handshake).
30920 * Likewise, on the server side, although a handshake is necessary at
30921 * the beginning of the communication, you do not need to call this
30922 * function explicitly unless you want clearer error reporting.
30923 * However, you may call g_tls_connection_handshake() later on to
30924 * renegotiate parameters (encryption methods, etc) with the client.
30926 * #GTlsConnection::accept_certificate may be emitted during the
30929 * Returns: success or failure
30935 * g_tls_connection_handshake_async:
30936 * @conn: a #GTlsConnection
30937 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
30938 * @cancellable: (allow-none): a #GCancellable, or %NULL
30939 * @callback: callback to call when the handshake is complete
30940 * @user_data: the data to pass to the callback function
30942 * Asynchronously performs a TLS handshake on @conn. See
30943 * g_tls_connection_handshake() for more information.
30950 * g_tls_connection_handshake_finish:
30951 * @conn: a #GTlsConnection
30952 * @result: a #GAsyncResult.
30953 * @error: a #GError pointer, or %NULL
30955 * Finish an asynchronous TLS handshake operation. See
30956 * g_tls_connection_handshake() for more information.
30958 * Returns: %TRUE on success, %FALSE on failure, in which case @error will be set.
30964 * g_tls_connection_set_certificate:
30965 * @conn: a #GTlsConnection
30966 * @certificate: the certificate to use for @conn
30968 * This sets the certificate that @conn will present to its peer
30969 * during the TLS handshake. For a #GTlsServerConnection, it is
30970 * mandatory to set this, and that will normally be done at construct
30973 * For a #GTlsClientConnection, this is optional. If a handshake fails
30974 * with %G_TLS_ERROR_CERTIFICATE_REQUIRED, that means that the server
30975 * requires a certificate, and if you try connecting again, you should
30976 * call this method first. You can call
30977 * g_tls_client_connection_get_accepted_cas() on the failed connection
30978 * to get a list of Certificate Authorities that the server will
30979 * accept certificates from.
30981 * (It is also possible that a server will allow the connection with
30982 * or without a certificate; in that case, if you don't provide a
30983 * certificate, you can tell that the server requested one by the fact
30984 * that g_tls_client_connection_get_accepted_cas() will return
30992 * g_tls_connection_set_database:
30993 * @conn: a #GTlsConnection
30994 * @database: a #GTlsDatabase
30996 * Sets the certificate database that is used to verify peer certificates.
30997 * This is set to the default database by default. See
30998 * g_tls_backend_get_default_database(). If set to %NULL, then
30999 * peer certificate validation will always set the
31000 * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
31001 * #GTlsConnection::accept-certificate will always be emitted on
31002 * client-side connections, unless that bit is not set in
31003 * #GTlsClientConnection:validation-flags).
31010 * g_tls_connection_set_interaction:
31011 * @conn: a connection
31012 * @interaction: (allow-none): an interaction object, or %NULL
31014 * Set the object that will be used to interact with the user. It will be used
31015 * for things like prompting the user for passwords.
31017 * The @interaction argument will normally be a derived subclass of
31018 * #GTlsInteraction. %NULL can also be provided if no user interaction
31019 * should occur for this connection.
31026 * g_tls_connection_set_rehandshake_mode:
31027 * @conn: a #GTlsConnection
31028 * @mode: the rehandshaking mode
31030 * Sets how @conn behaves with respect to rehandshaking requests.
31032 * %G_TLS_REHANDSHAKE_NEVER means that it will never agree to
31033 * rehandshake after the initial handshake is complete. (For a client,
31034 * this means it will refuse rehandshake requests from the server, and
31035 * for a server, this means it will close the connection with an error
31036 * if the client attempts to rehandshake.)
31038 * %G_TLS_REHANDSHAKE_SAFELY means that the connection will allow a
31039 * rehandshake only if the other end of the connection supports the
31040 * TLS <literal>renegotiation_info</literal> extension. This is the
31041 * default behavior, but means that rehandshaking will not work
31042 * against older implementations that do not support that extension.
31044 * %G_TLS_REHANDSHAKE_UNSAFELY means that the connection will allow
31045 * rehandshaking even without the
31046 * <literal>renegotiation_info</literal> extension. On the server side
31047 * in particular, this is not recommended, since it leaves the server
31048 * open to certain attacks. However, this mode is necessary if you
31049 * need to allow renegotiation with older client software.
31056 * g_tls_connection_set_require_close_notify:
31057 * @conn: a #GTlsConnection
31058 * @require_close_notify: whether or not to require close notification
31060 * Sets whether or not @conn expects a proper TLS close notification
31061 * before the connection is closed. If this is %TRUE (the default),
31062 * then @conn will expect to receive a TLS close notification from its
31063 * peer before the connection is closed, and will return a
31064 * %G_TLS_ERROR_EOF error if the connection is closed without proper
31065 * notification (since this may indicate a network error, or
31066 * man-in-the-middle attack).
31068 * In some protocols, the application will know whether or not the
31069 * connection was closed cleanly based on application-level data
31070 * (because the application-level data includes a length field, or is
31071 * somehow self-delimiting); in this case, the close notify is
31072 * redundant and sometimes omitted. (TLS 1.1 explicitly allows this;
31073 * in TLS 1.0 it is technically an error, but often done anyway.) You
31074 * can use g_tls_connection_set_require_close_notify() to tell @conn
31075 * to allow an "unannounced" connection close, in which case the close
31076 * will show up as a 0-length read, as in a non-TLS
31077 * #GSocketConnection, and it is up to the application to check that
31078 * the data has been fully received.
31080 * Note that this only affects the behavior when the peer closes the
31081 * connection; when the application calls g_io_stream_close() itself
31082 * on @conn, this will send a close notification regardless of the
31083 * setting of this property. If you explicitly want to do an unclean
31084 * close, you can close @conn's #GTlsConnection:base-io-stream rather
31085 * than closing @conn itself.
31092 * g_tls_connection_set_use_system_certdb:
31093 * @conn: a #GTlsConnection
31094 * @use_system_certdb: whether to use the system certificate database
31096 * Sets whether @conn uses the system certificate database to verify
31097 * peer certificates. This is %TRUE by default. If set to %FALSE, then
31098 * peer certificate validation will always set the
31099 * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
31100 * #GTlsConnection::accept-certificate will always be emitted on
31101 * client-side connections, unless that bit is not set in
31102 * #GTlsClientConnection:validation-flags).
31104 * Deprecated: 2.30: Use g_tls_connection_set_database() instead
31109 * g_tls_database_create_certificate_handle:
31110 * @self: a #GTlsDatabase
31111 * @certificate: certificate for which to create a handle.
31113 * Create a handle string for the certificate. The database will only be able
31114 * to create a handle for certificates that originate from the database. In
31115 * cases where the database cannot create a handle for a certificate, %NULL
31116 * will be returned.
31118 * This handle should be stable across various instances of the application,
31119 * and between applications. If a certificate is modified in the database,
31120 * then it is not guaranteed that this handle will continue to point to it.
31122 * Returns: (allow-none): a newly allocated string containing the handle.
31128 * g_tls_database_lookup_certificate_for_handle:
31129 * @self: a #GTlsDatabase
31130 * @handle: a certificate handle
31131 * @interaction: (allow-none): used to interact with the user if necessary
31132 * @flags: Flags which affect the lookup.
31133 * @cancellable: (allow-none): a #GCancellable, or %NULL
31134 * @error: (allow-none): a #GError, or %NULL
31136 * Lookup a certificate by its handle.
31138 * The handle should have been created by calling
31139 * g_tls_database_create_certificate_handle() on a #GTlsDatabase object of
31140 * the same TLS backend. The handle is designed to remain valid across
31141 * instantiations of the database.
31143 * If the handle is no longer valid, or does not point to a certificate in
31144 * this database, then %NULL will be returned.
31146 * This function can block, use g_tls_database_lookup_certificate_for_handle_async() to perform
31147 * the lookup operation asynchronously.
31149 * Returns: (transfer full) (allow-none): a newly allocated #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
31155 * g_tls_database_lookup_certificate_for_handle_async:
31156 * @self: a #GTlsDatabase
31157 * @handle: a certificate handle
31158 * @interaction: (allow-none): used to interact with the user if necessary
31159 * @flags: Flags which affect the lookup.
31160 * @cancellable: (allow-none): a #GCancellable, or %NULL
31161 * @callback: callback to call when the operation completes
31162 * @user_data: the data to pass to the callback function
31164 * Asynchronously lookup a certificate by its handle in the database. See
31165 * g_tls_database_lookup_certificate_for_handle() for more information.
31172 * g_tls_database_lookup_certificate_for_handle_finish:
31173 * @self: a #GTlsDatabase
31174 * @result: a #GAsyncResult.
31175 * @error: a #GError pointer, or %NULL
31177 * Finish an asynchronous lookup of a certificate by its handle. See
31178 * g_tls_database_lookup_certificate_handle() for more information.
31180 * If the handle is no longer valid, or does not point to a certificate in
31181 * this database, then %NULL will be returned.
31183 * Returns: (transfer full): a newly allocated #GTlsCertificate object. Use g_object_unref() to release the certificate.
31189 * g_tls_database_lookup_certificate_issuer:
31190 * @self: a #GTlsDatabase
31191 * @certificate: a #GTlsCertificate
31192 * @interaction: (allow-none): used to interact with the user if necessary
31193 * @flags: flags which affect the lookup operation
31194 * @cancellable: (allow-none): a #GCancellable, or %NULL
31195 * @error: (allow-none): a #GError, or %NULL
31197 * Lookup the issuer of @certificate in the database.
31199 * The %issuer property
31200 * of @certificate is not modified, and the two certificates are not hooked
31203 * This function can block, use g_tls_database_lookup_certificate_issuer_async() to perform
31204 * the lookup operation asynchronously.
31206 * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
31212 * g_tls_database_lookup_certificate_issuer_async:
31213 * @self: a #GTlsDatabase
31214 * @certificate: a #GTlsCertificate
31215 * @interaction: (allow-none): used to interact with the user if necessary
31216 * @flags: flags which affect the lookup operation
31217 * @cancellable: (allow-none): a #GCancellable, or %NULL
31218 * @callback: callback to call when the operation completes
31219 * @user_data: the data to pass to the callback function
31221 * Asynchronously lookup the issuer of @certificate in the database. See
31222 * g_tls_database_lookup_certificate_issuer() for more information.
31229 * g_tls_database_lookup_certificate_issuer_finish:
31230 * @self: a #GTlsDatabase
31231 * @result: a #GAsyncResult.
31232 * @error: a #GError pointer, or %NULL
31234 * Finish an asynchronous lookup issuer operation. See
31235 * g_tls_database_lookup_certificate_issuer() for more information.
31237 * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
31243 * g_tls_database_lookup_certificates_issued_by:
31244 * @self: a #GTlsDatabase
31245 * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
31246 * @interaction: (allow-none): used to interact with the user if necessary
31247 * @flags: Flags which affect the lookup operation.
31248 * @cancellable: (allow-none): a #GCancellable, or %NULL
31249 * @error: (allow-none): a #GError, or %NULL
31251 * Lookup certificates issued by this issuer in the database.
31253 * This function can block, use g_tls_database_lookup_certificates_issued_by_async() to perform
31254 * the lookup operation asynchronously.
31256 * 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.
31262 * g_tls_database_lookup_certificates_issued_by_async:
31263 * @self: a #GTlsDatabase
31264 * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
31265 * @interaction: (allow-none): used to interact with the user if necessary
31266 * @flags: Flags which affect the lookup operation.
31267 * @cancellable: (allow-none): a #GCancellable, or %NULL
31268 * @callback: callback to call when the operation completes
31269 * @user_data: the data to pass to the callback function
31271 * Asynchronously lookup certificates issued by this issuer in the database. See
31272 * g_tls_database_lookup_certificates_issued_by() for more information.
31274 * The database may choose to hold a reference to the issuer byte array for the duration
31275 * of of this asynchronous operation. The byte array should not be modified during
31283 * g_tls_database_lookup_certificates_issued_by_finish:
31284 * @self: a #GTlsDatabase
31285 * @result: a #GAsyncResult.
31286 * @error: a #GError pointer, or %NULL
31288 * Finish an asynchronous lookup of certificates. See
31289 * g_tls_database_lookup_certificates_issued_by() for more information.
31291 * 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.
31297 * g_tls_database_verify_chain:
31298 * @self: a #GTlsDatabase
31299 * @chain: a #GTlsCertificate chain
31300 * @purpose: the purpose that this certificate chain will be used for.
31301 * @identity: (allow-none): the expected peer identity
31302 * @interaction: (allow-none): used to interact with the user if necessary
31303 * @flags: additional verify flags
31304 * @cancellable: (allow-none): a #GCancellable, or %NULL
31305 * @error: (allow-none): a #GError, or %NULL
31307 * Verify's a certificate chain after looking up and adding any missing
31308 * certificates to the chain.
31310 * @chain is a chain of #GTlsCertificate objects each pointing to the next
31311 * certificate in the chain by its %issuer property. The chain may initially
31312 * consist of one or more certificates. After the verification process is
31313 * complete, @chain may be modified by adding missing certificates, or removing
31314 * extra certificates. If a certificate anchor was found, then it is added to
31317 * @purpose describes the purpose (or usage) for which the certificate
31318 * is being used. Typically @purpose will be set to #G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER
31319 * which means that the certificate is being used to authenticate a server
31320 * (and we are acting as the client).
31322 * The @identity is used to check for pinned certificates (trust exceptions)
31323 * in the database. These will override the normal verification process on a
31324 * host by host basis.
31326 * Currently there are no @flags, and %G_TLS_DATABASE_VERIFY_NONE should be
31329 * This function can block, use g_tls_database_verify_chain_async() to perform
31330 * the verification operation asynchronously.
31332 * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
31338 * g_tls_database_verify_chain_async:
31339 * @self: a #GTlsDatabase
31340 * @chain: a #GTlsCertificate chain
31341 * @purpose: the purpose that this certificate chain will be used for.
31342 * @identity: (allow-none): the expected peer identity
31343 * @interaction: (allow-none): used to interact with the user if necessary
31344 * @flags: additional verify flags
31345 * @cancellable: (allow-none): a #GCancellable, or %NULL
31346 * @callback: callback to call when the operation completes
31347 * @user_data: the data to pass to the callback function
31349 * Asynchronously verify's a certificate chain after looking up and adding
31350 * any missing certificates to the chain. See g_tls_database_verify_chain()
31351 * for more information.
31358 * g_tls_database_verify_chain_finish:
31359 * @self: a #GTlsDatabase
31360 * @result: a #GAsyncResult.
31361 * @error: a #GError pointer, or %NULL
31363 * Finish an asynchronous verify chain operation. See
31364 * g_tls_database_verify_chain() for more information. *
31366 * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
31372 * g_tls_error_quark:
31374 * Gets the TLS error quark.
31376 * Returns: a #GQuark.
31382 * g_tls_file_database_new:
31383 * @anchors: filename of anchor certificate authorities.
31384 * @error: #GError for error reporting, or %NULL to ignore.
31386 * Creates a new #GTlsFileDatabase which uses anchor certificate authorities
31387 * in @anchors to verify certificate chains.
31389 * The certificates in @anchors must be PEM encoded.
31391 * Returns: (transfer full) (type GTlsFileDatabase): the new #GTlsFileDatabase, or %NULL on error
31397 * g_tls_interaction_ask_password:
31398 * @interaction: a #GTlsInteraction object
31399 * @password: a #GTlsPassword object
31400 * @cancellable: an optional #GCancellable cancellation object
31401 * @error: an optional location to place an error on failure
31403 * Run synchronous interaction to ask the user for a password. In general,
31404 * g_tls_interaction_invoke_ask_password() should be used instead of this
31407 * Derived subclasses usually implement a password prompt, although they may
31408 * also choose to provide a password from elsewhere. The @password value will
31409 * be filled in and then @callback will be called. Alternatively the user may
31410 * abort this password request, which will usually abort the TLS connection.
31412 * If the interaction is cancelled by the cancellation object, or by the
31413 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31414 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31415 * not support immediate cancellation.
31417 * Returns: The status of the ask password interaction.
31423 * g_tls_interaction_ask_password_async:
31424 * @interaction: a #GTlsInteraction object
31425 * @password: a #GTlsPassword object
31426 * @cancellable: an optional #GCancellable cancellation object
31427 * @callback: (allow-none): will be called when the interaction completes
31428 * @user_data: (allow-none): data to pass to the @callback
31430 * Run asynchronous interaction to ask the user for a password. In general,
31431 * g_tls_interaction_invoke_ask_password() should be used instead of this
31434 * Derived subclasses usually implement a password prompt, although they may
31435 * also choose to provide a password from elsewhere. The @password value will
31436 * be filled in and then @callback will be called. Alternatively the user may
31437 * abort this password request, which will usually abort the TLS connection.
31439 * If the interaction is cancelled by the cancellation object, or by the
31440 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31441 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31442 * not support immediate cancellation.
31444 * Certain implementations may not support immediate cancellation.
31451 * g_tls_interaction_ask_password_finish:
31452 * @interaction: a #GTlsInteraction object
31453 * @result: the result passed to the callback
31454 * @error: an optional location to place an error on failure
31456 * Complete an ask password user interaction request. This should be once
31457 * the g_tls_interaction_ask_password_async() completion callback is called.
31459 * If %G_TLS_INTERACTION_HANDLED is returned, then the #GTlsPassword passed
31460 * to g_tls_interaction_ask_password() will have its password filled in.
31462 * If the interaction is cancelled by the cancellation object, or by the
31463 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31464 * contains a %G_IO_ERROR_CANCELLED error code.
31466 * Returns: The status of the ask password interaction.
31472 * g_tls_interaction_invoke_ask_password:
31473 * @interaction: a #GTlsInteraction object
31474 * @password: a #GTlsPassword object
31475 * @cancellable: an optional #GCancellable cancellation object
31476 * @error: an optional location to place an error on failure
31478 * Invoke the interaction to ask the user for a password. It invokes this
31479 * interaction in the main loop, specifically the #GMainContext returned by
31480 * g_main_context_get_thread_default() when the interaction is created. This
31481 * is called by called by #GTlsConnection or #GTlsDatabase to ask the user
31484 * Derived subclasses usually implement a password prompt, although they may
31485 * also choose to provide a password from elsewhere. The @password value will
31486 * be filled in and then @callback will be called. Alternatively the user may
31487 * abort this password request, which will usually abort the TLS connection.
31489 * The implementation can either be a synchronous (eg: modal dialog) or an
31490 * asynchronous one (eg: modeless dialog). This function will take care of
31491 * calling which ever one correctly.
31493 * If the interaction is cancelled by the cancellation object, or by the
31494 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31495 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31496 * not support immediate cancellation.
31498 * Returns: The status of the ask password interaction.
31504 * g_tls_password_get_description:
31505 * @password: a #GTlsPassword object
31507 * Get a description string about what the password will be used for.
31509 * Returns: The description of the password.
31515 * g_tls_password_get_flags:
31516 * @password: a #GTlsPassword object
31518 * Get flags about the password.
31520 * Returns: The flags about the password.
31526 * g_tls_password_get_value:
31527 * @password: a #GTlsPassword object
31528 * @length: (allow-none): location to place the length of the password.
31530 * Get the password value. If @length is not %NULL then it will be
31531 * filled in with the length of the password value. (Note that the
31532 * password value is not nul-terminated, so you can only pass %NULL
31533 * for @length in contexts where you know the password will have a
31534 * certain fixed length.)
31536 * Returns: The password value (owned by the password object).
31542 * g_tls_password_get_warning:
31543 * @password: a #GTlsPassword object
31545 * Get a user readable translated warning. Usually this warning is a
31546 * representation of the password flags returned from
31547 * g_tls_password_get_flags().
31549 * Returns: The warning.
31555 * g_tls_password_new:
31556 * @flags: the password flags
31557 * @description: description of what the password is for
31559 * Create a new #GTlsPassword object.
31561 * Returns: (transfer full): The newly allocated password object
31566 * g_tls_password_set_description:
31567 * @password: a #GTlsPassword object
31568 * @description: The description of the password
31570 * Set a description string about what the password will be used for.
31577 * g_tls_password_set_flags:
31578 * @password: a #GTlsPassword object
31579 * @flags: The flags about the password
31581 * Set flags about the password.
31588 * g_tls_password_set_value:
31589 * @password: a #GTlsPassword object
31590 * @value: the new password value
31591 * @length: the length of the password, or -1
31593 * Set the value for this password. The @value will be copied by the password
31596 * Specify the @length, for a non-nul-terminated password. Pass -1 as
31597 * @length if using a nul-terminated password, and @length will be
31598 * calculated automatically. (Note that the terminating nul is not
31599 * considered part of the password in this case.)
31606 * g_tls_password_set_value_full:
31607 * @password: a #GTlsPassword object
31608 * @value: the value for the password
31609 * @length: the length of the password, or -1
31610 * @destroy: (allow-none): a function to use to free the password.
31612 * Provide the value for this password.
31614 * The @value will be owned by the password object, and later freed using
31615 * the @destroy function callback.
31617 * Specify the @length, for a non-nul-terminated password. Pass -1 as
31618 * @length if using a nul-terminated password, and @length will be
31619 * calculated automatically. (Note that the terminating nul is not
31620 * considered part of the password in this case.)
31622 * Virtual: set_value
31628 * g_tls_password_set_warning:
31629 * @password: a #GTlsPassword object
31630 * @warning: The user readable warning
31632 * Set a user readable translated warning. Usually this warning is a
31633 * representation of the password flags returned from
31634 * g_tls_password_get_flags().
31641 * g_tls_server_connection_new:
31642 * @base_io_stream: the #GIOStream to wrap
31643 * @certificate: (allow-none): the default server certificate, or %NULL
31644 * @error: #GError for error reporting, or %NULL to ignore.
31646 * Creates a new #GTlsServerConnection wrapping @base_io_stream (which
31647 * must have pollable input and output streams).
31649 * Returns: (transfer full) (type GTlsServerConnection): the new #GTlsServerConnection, or %NULL on error
31655 * g_unix_connection_receive_credentials:
31656 * @connection: A #GUnixConnection.
31657 * @cancellable: (allow-none): A #GCancellable or %NULL.
31658 * @error: Return location for error or %NULL.
31660 * Receives credentials from the sending end of the connection. The
31661 * sending end has to call g_unix_connection_send_credentials() (or
31662 * similar) for this to work.
31664 * As well as reading the credentials this also reads (and discards) a
31665 * single byte from the stream, as this is required for credentials
31666 * passing to work on some implementations.
31668 * Other ways to exchange credentials with a foreign peer includes the
31669 * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
31671 * Returns: (transfer full): Received credentials on success (free with g_object_unref()), %NULL if @error is set.
31677 * g_unix_connection_receive_credentials_async:
31678 * @connection: A #GUnixConnection.
31679 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31680 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
31681 * @user_data: (closure): the data to pass to callback function
31683 * Asynchronously receive credentials.
31685 * For more details, see g_unix_connection_receive_credentials() which is
31686 * the synchronous version of this call.
31688 * When the operation is finished, @callback will be called. You can then call
31689 * g_unix_connection_receive_credentials_finish() to get the result of the operation.
31696 * g_unix_connection_receive_credentials_finish:
31697 * @connection: A #GUnixConnection.
31698 * @result: a #GAsyncResult.
31699 * @error: a #GError, or %NULL
31701 * Finishes an asynchronous receive credentials operation started with
31702 * g_unix_connection_receive_credentials_async().
31704 * Returns: (transfer full): a #GCredentials, or %NULL on error. Free the returned object with g_object_unref().
31710 * g_unix_connection_receive_fd:
31711 * @connection: a #GUnixConnection
31712 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
31713 * @error: (allow-none): #GError for error reporting, or %NULL to ignore
31715 * Receives a file descriptor from the sending end of the connection.
31716 * The sending end has to call g_unix_connection_send_fd() for this
31719 * As well as reading the fd this also reads a single byte from the
31720 * stream, as this is required for fd passing to work on some
31723 * Returns: a file descriptor on success, -1 on error.
31729 * g_unix_connection_send_credentials:
31730 * @connection: A #GUnixConnection.
31731 * @cancellable: (allow-none): A #GCancellable or %NULL.
31732 * @error: Return location for error or %NULL.
31734 * Passes the credentials of the current user the receiving side
31735 * of the connection. The receiving end has to call
31736 * g_unix_connection_receive_credentials() (or similar) to accept the
31739 * As well as sending the credentials this also writes a single NUL
31740 * byte to the stream, as this is required for credentials passing to
31741 * work on some implementations.
31743 * Other ways to exchange credentials with a foreign peer includes the
31744 * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
31746 * Returns: %TRUE on success, %FALSE if @error is set.
31752 * g_unix_connection_send_credentials_async:
31753 * @connection: A #GUnixConnection.
31754 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31755 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
31756 * @user_data: (closure): the data to pass to callback function
31758 * Asynchronously send credentials.
31760 * For more details, see g_unix_connection_send_credentials() which is
31761 * the synchronous version of this call.
31763 * When the operation is finished, @callback will be called. You can then call
31764 * g_unix_connection_send_credentials_finish() to get the result of the operation.
31771 * g_unix_connection_send_credentials_finish:
31772 * @connection: A #GUnixConnection.
31773 * @result: a #GAsyncResult.
31774 * @error: a #GError, or %NULL
31776 * Finishes an asynchronous send credentials operation started with
31777 * g_unix_connection_send_credentials_async().
31779 * Returns: %TRUE if the operation was successful, otherwise %FALSE.
31785 * g_unix_connection_send_fd:
31786 * @connection: a #GUnixConnection
31787 * @fd: a file descriptor
31788 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31789 * @error: (allow-none): #GError for error reporting, or %NULL to ignore.
31791 * Passes a file descriptor to the receiving side of the
31792 * connection. The receiving end has to call g_unix_connection_receive_fd()
31793 * to accept the file descriptor.
31795 * As well as sending the fd this also writes a single byte to the
31796 * stream, as this is required for fd passing to work on some
31799 * Returns: a %TRUE on success, %NULL on error.
31805 * g_unix_credentials_message_get_credentials:
31806 * @message: A #GUnixCredentialsMessage.
31808 * Gets the credentials stored in @message.
31810 * Returns: (transfer none): A #GCredentials instance. Do not free, it is owned by @message.
31816 * g_unix_credentials_message_is_supported:
31818 * Checks if passing #GCredentials on a #GSocket is supported on this platform.
31820 * Returns: %TRUE if supported, %FALSE otherwise
31826 * g_unix_credentials_message_new:
31828 * Creates a new #GUnixCredentialsMessage with credentials matching the current processes.
31830 * Returns: a new #GUnixCredentialsMessage
31836 * g_unix_credentials_message_new_with_credentials:
31837 * @credentials: A #GCredentials object.
31839 * Creates a new #GUnixCredentialsMessage holding @credentials.
31841 * Returns: a new #GUnixCredentialsMessage
31847 * g_unix_fd_list_append:
31848 * @list: a #GUnixFDList
31849 * @fd: a valid open file descriptor
31850 * @error: a #GError pointer
31852 * Adds a file descriptor to @list.
31854 * The file descriptor is duplicated using dup(). You keep your copy
31855 * of the descriptor and the copy contained in @list will be closed
31856 * when @list is finalized.
31858 * A possible cause of failure is exceeding the per-process or
31859 * system-wide file descriptor limit.
31861 * The index of the file descriptor in the list is returned. If you use
31862 * this index with g_unix_fd_list_get() then you will receive back a
31863 * duplicated copy of the same file descriptor.
31865 * Returns: the index of the appended fd in case of success, else -1 (and @error is set)
31871 * g_unix_fd_list_get:
31872 * @list: a #GUnixFDList
31873 * @index_: the index into the list
31874 * @error: a #GError pointer
31876 * Gets a file descriptor out of @list.
31878 * @index_ specifies the index of the file descriptor to get. It is a
31879 * programmer error for @index_ to be out of range; see
31880 * g_unix_fd_list_get_length().
31882 * The file descriptor is duplicated using dup() and set as
31883 * close-on-exec before being returned. You must call close() on it
31884 * when you are done.
31886 * A possible cause of failure is exceeding the per-process or
31887 * system-wide file descriptor limit.
31889 * Returns: the file descriptor, or -1 in case of error
31895 * g_unix_fd_list_get_length:
31896 * @list: a #GUnixFDList
31898 * Gets the length of @list (ie: the number of file descriptors
31899 * contained within).
31901 * Returns: the length of @list
31907 * g_unix_fd_list_new:
31909 * Creates a new #GUnixFDList containing no file descriptors.
31911 * Returns: a new #GUnixFDList
31917 * g_unix_fd_list_new_from_array:
31918 * @fds: (array length=n_fds): the initial list of file descriptors
31919 * @n_fds: the length of #fds, or -1
31921 * Creates a new #GUnixFDList containing the file descriptors given in
31922 * @fds. The file descriptors become the property of the new list and
31923 * may no longer be used by the caller. The array itself is owned by
31926 * Each file descriptor in the array should be set to close-on-exec.
31928 * If @n_fds is -1 then @fds must be terminated with -1.
31930 * Returns: a new #GUnixFDList
31936 * g_unix_fd_list_peek_fds:
31937 * @list: a #GUnixFDList
31938 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
31940 * Returns the array of file descriptors that is contained in this
31943 * After this call, the descriptors remain the property of @list. The
31944 * caller must not close them and must not free the array. The array is
31945 * valid only until @list is changed in any way.
31947 * If @length is non-%NULL then it is set to the number of file
31948 * descriptors in the returned array. The returned array is also
31949 * terminated with -1.
31951 * This function never returns %NULL. In case there are no file
31952 * descriptors contained in @list, an empty array is returned.
31954 * Returns: (array length=length) (transfer none): an array of file descriptors
31960 * g_unix_fd_list_steal_fds:
31961 * @list: a #GUnixFDList
31962 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
31964 * Returns the array of file descriptors that is contained in this
31967 * After this call, the descriptors are no longer contained in
31968 * @list. Further calls will return an empty list (unless more
31969 * descriptors have been added).
31971 * The return result of this function must be freed with g_free().
31972 * The caller is also responsible for closing all of the file
31973 * descriptors. The file descriptors in the array are set to
31976 * If @length is non-%NULL then it is set to the number of file
31977 * descriptors in the returned array. The returned array is also
31978 * terminated with -1.
31980 * This function never returns %NULL. In case there are no file
31981 * descriptors contained in @list, an empty array is returned.
31983 * Returns: (array length=length) (transfer full): an array of file descriptors
31989 * g_unix_fd_message_append_fd:
31990 * @message: a #GUnixFDMessage
31991 * @fd: a valid open file descriptor
31992 * @error: a #GError pointer
31994 * Adds a file descriptor to @message.
31996 * The file descriptor is duplicated using dup(). You keep your copy
31997 * of the descriptor and the copy contained in @message will be closed
31998 * when @message is finalized.
32000 * A possible cause of failure is exceeding the per-process or
32001 * system-wide file descriptor limit.
32003 * Returns: %TRUE in case of success, else %FALSE (and @error is set)
32009 * g_unix_fd_message_get_fd_list:
32010 * @message: a #GUnixFDMessage
32012 * Gets the #GUnixFDList contained in @message. This function does not
32013 * return a reference to the caller, but the returned list is valid for
32014 * the lifetime of @message.
32016 * Returns: (transfer none): the #GUnixFDList from @message
32022 * g_unix_fd_message_new:
32024 * Creates a new #GUnixFDMessage containing an empty file descriptor
32027 * Returns: a new #GUnixFDMessage
32033 * g_unix_fd_message_new_with_fd_list:
32034 * @fd_list: a #GUnixFDList
32036 * Creates a new #GUnixFDMessage containing @list.
32038 * Returns: a new #GUnixFDMessage
32044 * g_unix_fd_message_steal_fds:
32045 * @message: a #GUnixFDMessage
32046 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
32048 * Returns the array of file descriptors that is contained in this
32051 * After this call, the descriptors are no longer contained in
32052 * @message. Further calls will return an empty list (unless more
32053 * descriptors have been added).
32055 * The return result of this function must be freed with g_free().
32056 * The caller is also responsible for closing all of the file
32059 * If @length is non-%NULL then it is set to the number of file
32060 * descriptors in the returned array. The returned array is also
32061 * terminated with -1.
32063 * This function never returns %NULL. In case there are no file
32064 * descriptors contained in @message, an empty array is returned.
32066 * Returns: (array length=length) (transfer full): an array of file descriptors
32072 * g_unix_input_stream_get_close_fd:
32073 * @stream: a #GUnixInputStream
32075 * Returns whether the file descriptor of @stream will be
32076 * closed when the stream is closed.
32078 * Returns: %TRUE if the file descriptor is closed when done
32084 * g_unix_input_stream_get_fd:
32085 * @stream: a #GUnixInputStream
32087 * Return the UNIX file descriptor that the stream reads from.
32089 * Returns: The file descriptor of @stream
32095 * g_unix_input_stream_new:
32096 * @fd: a UNIX file descriptor
32097 * @close_fd: %TRUE to close the file descriptor when done
32099 * Creates a new #GUnixInputStream for the given @fd.
32101 * If @close_fd is %TRUE, the file descriptor will be closed
32102 * when the stream is closed.
32104 * Returns: a new #GUnixInputStream
32109 * g_unix_input_stream_set_close_fd:
32110 * @stream: a #GUnixInputStream
32111 * @close_fd: %TRUE to close the file descriptor when done
32113 * Sets whether the file descriptor of @stream shall be closed
32114 * when the stream is closed.
32121 * g_unix_is_mount_path_system_internal:
32122 * @mount_path: a mount path, e.g. <filename>/media/disk</filename> or <filename>/usr</filename>
32124 * Determines if @mount_path is considered an implementation of the
32125 * OS. This is primarily used for hiding mountable and mounted volumes
32126 * that only are used in the OS and has little to no relevance to the
32129 * Returns: %TRUE if @mount_path is considered an implementation detail of the OS.
32134 * g_unix_mount_at: (skip)
32135 * @mount_path: path for a possible unix mount.
32136 * @time_read: (out) (allow-none): guint64 to contain a timestamp.
32138 * Gets a #GUnixMountEntry for a given mount path. If @time_read
32139 * is set, it will be filled with a unix timestamp for checking
32140 * if the mounts have changed since with g_unix_mounts_changed_since().
32142 * Returns: (transfer full): a #GUnixMountEntry.
32147 * g_unix_mount_compare:
32148 * @mount1: first #GUnixMountEntry to compare.
32149 * @mount2: second #GUnixMountEntry to compare.
32151 * Compares two unix mounts.
32153 * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
32158 * g_unix_mount_free:
32159 * @mount_entry: a #GUnixMountEntry.
32161 * Frees a unix mount.
32166 * g_unix_mount_get_device_path:
32167 * @mount_entry: a #GUnixMount.
32169 * Gets the device path for a unix mount.
32171 * Returns: a string containing the device path.
32176 * g_unix_mount_get_fs_type:
32177 * @mount_entry: a #GUnixMount.
32179 * Gets the filesystem type for the unix mount.
32181 * Returns: a string containing the file system type.
32186 * g_unix_mount_get_mount_path:
32187 * @mount_entry: input #GUnixMountEntry to get the mount path for.
32189 * Gets the mount path for a unix mount.
32191 * Returns: the mount path for @mount_entry.
32196 * g_unix_mount_guess_can_eject:
32197 * @mount_entry: a #GUnixMountEntry
32199 * Guesses whether a Unix mount can be ejected.
32201 * Returns: %TRUE if @mount_entry is deemed to be ejectable.
32206 * g_unix_mount_guess_icon:
32207 * @mount_entry: a #GUnixMountEntry
32209 * Guesses the icon of a Unix mount.
32211 * Returns: (transfer full): a #GIcon
32216 * g_unix_mount_guess_name:
32217 * @mount_entry: a #GUnixMountEntry
32219 * Guesses the name of a Unix mount.
32220 * The result is a translated string.
32222 * Returns: A newly allocated string that must be freed with g_free()
32227 * g_unix_mount_guess_should_display:
32228 * @mount_entry: a #GUnixMountEntry
32230 * Guesses whether a Unix mount should be displayed in the UI.
32232 * Returns: %TRUE if @mount_entry is deemed to be displayable.
32237 * g_unix_mount_guess_symbolic_icon:
32238 * @mount_entry: a #GUnixMountEntry
32240 * Guesses the symbolic icon of a Unix mount.
32242 * Returns: (transfer full): a #GIcon
32248 * g_unix_mount_is_readonly:
32249 * @mount_entry: a #GUnixMount.
32251 * Checks if a unix mount is mounted read only.
32253 * Returns: %TRUE if @mount_entry is read only.
32258 * g_unix_mount_is_system_internal:
32259 * @mount_entry: a #GUnixMount.
32261 * Checks if a unix mount is a system path.
32263 * Returns: %TRUE if the unix mount is for a system path.
32268 * g_unix_mount_monitor_new:
32270 * Gets a new #GUnixMountMonitor. The default rate limit for which the
32271 * monitor will report consecutive changes for the mount and mount
32272 * point entry files is the default for a #GFileMonitor. Use
32273 * g_unix_mount_monitor_set_rate_limit() to change this.
32275 * Returns: a #GUnixMountMonitor.
32280 * g_unix_mount_monitor_set_rate_limit:
32281 * @mount_monitor: a #GUnixMountMonitor
32282 * @limit_msec: a integer with the limit in milliseconds to poll for changes.
32284 * Sets the rate limit to which the @mount_monitor will report
32285 * consecutive change events to the mount and mount point entry files.
32292 * g_unix_mount_point_compare:
32293 * @mount1: a #GUnixMount.
32294 * @mount2: a #GUnixMount.
32296 * Compares two unix mount points.
32298 * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
32303 * g_unix_mount_point_free:
32304 * @mount_point: unix mount point to free.
32306 * Frees a unix mount point.
32311 * g_unix_mount_point_get_device_path:
32312 * @mount_point: a #GUnixMountPoint.
32314 * Gets the device path for a unix mount point.
32316 * Returns: a string containing the device path.
32321 * g_unix_mount_point_get_fs_type:
32322 * @mount_point: a #GUnixMountPoint.
32324 * Gets the file system type for the mount point.
32326 * Returns: a string containing the file system type.
32331 * g_unix_mount_point_get_mount_path:
32332 * @mount_point: a #GUnixMountPoint.
32334 * Gets the mount path for a unix mount point.
32336 * Returns: a string containing the mount path.
32341 * g_unix_mount_point_get_options:
32342 * @mount_point: a #GUnixMountPoint.
32344 * Gets the options for the mount point.
32346 * Returns: a string containing the options.
32352 * g_unix_mount_point_guess_can_eject:
32353 * @mount_point: a #GUnixMountPoint
32355 * Guesses whether a Unix mount point can be ejected.
32357 * Returns: %TRUE if @mount_point is deemed to be ejectable.
32362 * g_unix_mount_point_guess_icon:
32363 * @mount_point: a #GUnixMountPoint
32365 * Guesses the icon of a Unix mount point.
32367 * Returns: (transfer full): a #GIcon
32372 * g_unix_mount_point_guess_name:
32373 * @mount_point: a #GUnixMountPoint
32375 * Guesses the name of a Unix mount point.
32376 * The result is a translated string.
32378 * Returns: A newly allocated string that must be freed with g_free()
32383 * g_unix_mount_point_guess_symbolic_icon:
32385 * Guesses the symbolic icon of a Unix mount point.
32387 * Returns: (transfer full): a #GIcon
32393 * g_unix_mount_point_is_loopback:
32394 * @mount_point: a #GUnixMountPoint.
32396 * Checks if a unix mount point is a loopback device.
32398 * Returns: %TRUE if the mount point is a loopback. %FALSE otherwise.
32403 * g_unix_mount_point_is_readonly:
32404 * @mount_point: a #GUnixMountPoint.
32406 * Checks if a unix mount point is read only.
32408 * Returns: %TRUE if a mount point is read only.
32413 * g_unix_mount_point_is_user_mountable:
32414 * @mount_point: a #GUnixMountPoint.
32416 * Checks if a unix mount point is mountable by the user.
32418 * Returns: %TRUE if the mount point is user mountable.
32423 * g_unix_mount_points_changed_since:
32424 * @time: guint64 to contain a timestamp.
32426 * Checks if the unix mount points have changed since a given unix time.
32428 * Returns: %TRUE if the mount points have changed since @time.
32433 * g_unix_mount_points_get: (skip)
32434 * @time_read: (out) (allow-none): guint64 to contain a timestamp.
32436 * Gets a #GList of #GUnixMountPoint containing the unix mount points.
32437 * If @time_read is set, it will be filled with the mount timestamp,
32438 * allowing for checking if the mounts have changed with
32439 * g_unix_mount_points_changed_since().
32441 * Returns: (element-type GUnixMountPoint) (transfer full): a #GList of the UNIX mountpoints.
32446 * g_unix_mounts_changed_since:
32447 * @time: guint64 to contain a timestamp.
32449 * Checks if the unix mounts have changed since a given unix time.
32451 * Returns: %TRUE if the mounts have changed since @time.
32456 * g_unix_mounts_get: (skip)
32457 * @time_read: (out) (allow-none): guint64 to contain a timestamp, or %NULL
32459 * Gets a #GList of #GUnixMountEntry containing the unix mounts.
32460 * If @time_read is set, it will be filled with the mount
32461 * timestamp, allowing for checking if the mounts have changed
32462 * with g_unix_mounts_changed_since().
32464 * Returns: (element-type GUnixMountEntry) (transfer full): a #GList of the UNIX mounts.
32469 * g_unix_output_stream_get_close_fd:
32470 * @stream: a #GUnixOutputStream
32472 * Returns whether the file descriptor of @stream will be
32473 * closed when the stream is closed.
32475 * Returns: %TRUE if the file descriptor is closed when done
32481 * g_unix_output_stream_get_fd:
32482 * @stream: a #GUnixOutputStream
32484 * Return the UNIX file descriptor that the stream writes to.
32486 * Returns: The file descriptor of @stream
32492 * g_unix_output_stream_new:
32493 * @fd: a UNIX file descriptor
32494 * @close_fd: %TRUE to close the file descriptor when done
32496 * Creates a new #GUnixOutputStream for the given @fd.
32498 * If @close_fd, is %TRUE, the file descriptor will be closed when
32499 * the output stream is destroyed.
32501 * Returns: a new #GOutputStream
32506 * g_unix_output_stream_set_close_fd:
32507 * @stream: a #GUnixOutputStream
32508 * @close_fd: %TRUE to close the file descriptor when done
32510 * Sets whether the file descriptor of @stream shall be closed
32511 * when the stream is closed.
32518 * g_unix_socket_address_abstract_names_supported:
32520 * Checks if abstract UNIX domain socket names are supported.
32522 * Returns: %TRUE if supported, %FALSE otherwise
32528 * g_unix_socket_address_get_address_type:
32529 * @address: a #GInetSocketAddress
32531 * Gets @address's type.
32533 * Returns: a #GUnixSocketAddressType
32539 * g_unix_socket_address_get_is_abstract:
32540 * @address: a #GInetSocketAddress
32542 * Tests if @address is abstract.
32544 * Returns: %TRUE if the address is abstract, %FALSE otherwise
32546 * Deprecated: Use g_unix_socket_address_get_address_type()
32551 * g_unix_socket_address_get_path:
32552 * @address: a #GInetSocketAddress
32554 * Gets @address's path, or for abstract sockets the "name".
32556 * Guaranteed to be zero-terminated, but an abstract socket
32557 * may contain embedded zeros, and thus you should use
32558 * g_unix_socket_address_get_path_len() to get the true length
32561 * Returns: the path for @address
32567 * g_unix_socket_address_get_path_len:
32568 * @address: a #GInetSocketAddress
32570 * Gets the length of @address's path.
32572 * For details, see g_unix_socket_address_get_path().
32574 * Returns: the length of the path
32580 * g_unix_socket_address_new:
32581 * @path: the socket path
32583 * Creates a new #GUnixSocketAddress for @path.
32585 * To create abstract socket addresses, on systems that support that,
32586 * use g_unix_socket_address_new_abstract().
32588 * Returns: a new #GUnixSocketAddress
32594 * g_unix_socket_address_new_abstract:
32595 * @path: (array length=path_len) (element-type gchar): the abstract name
32596 * @path_len: the length of @path, or -1
32598 * Creates a new %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED
32599 * #GUnixSocketAddress for @path.
32601 * Returns: a new #GUnixSocketAddress
32602 * Deprecated: Use g_unix_socket_address_new_with_type().
32607 * g_unix_socket_address_new_with_type:
32608 * @path: (array length=path_len) (element-type gchar): the name
32609 * @path_len: the length of @path, or -1
32610 * @type: a #GUnixSocketAddressType
32612 * Creates a new #GUnixSocketAddress of type @type with name @path.
32614 * If @type is %G_UNIX_SOCKET_ADDRESS_PATH, this is equivalent to
32615 * calling g_unix_socket_address_new().
32617 * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT, then @path_len
32618 * bytes of @path will be copied to the socket's path, and only those
32619 * bytes will be considered part of the name. (If @path_len is -1,
32620 * then @path is assumed to be NUL-terminated.) For example, if @path
32621 * was "test", then calling g_socket_address_get_native_size() on the
32622 * returned socket would return 7 (2 bytes of overhead, 1 byte for the
32623 * abstract-socket indicator byte, and 4 bytes for the name "test").
32625 * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, then
32626 * @path_len bytes of @path will be copied to the socket's path, the
32627 * rest of the path will be padded with 0 bytes, and the entire
32628 * zero-padded buffer will be considered the name. (As above, if
32629 * @path_len is -1, then @path is assumed to be NUL-terminated.) In
32630 * this case, g_socket_address_get_native_size() will always return
32631 * the full size of a <literal>struct sockaddr_un</literal>, although
32632 * g_unix_socket_address_get_path_len() will still return just the
32635 * %G_UNIX_SOCKET_ADDRESS_ABSTRACT is preferred over
32636 * %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED for new programs. Of course,
32637 * when connecting to a server created by another process, you must
32638 * use the appropriate type corresponding to how that process created
32639 * its listening socket.
32641 * Returns: a new #GUnixSocketAddress
32647 * g_vfs_get_default:
32649 * Gets the default #GVfs for the system.
32651 * Returns: (transfer none): a #GVfs.
32656 * g_vfs_get_file_for_path:
32658 * @path: a string containing a VFS path.
32660 * Gets a #GFile for @path.
32662 * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
32667 * g_vfs_get_file_for_uri:
32669 * @uri: a string containing a URI
32671 * Gets a #GFile for @uri.
32673 * This operation never fails, but the returned object
32674 * might not support any I/O operation if the URI
32675 * is malformed or if the URI scheme is not supported.
32677 * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
32684 * Gets the local #GVfs for the system.
32686 * Returns: (transfer none): a #GVfs.
32691 * g_vfs_get_supported_uri_schemes:
32694 * Gets a list of URI schemes supported by @vfs.
32696 * Returns: (transfer none): a %NULL-terminated array of strings. The returned array belongs to GIO and must not be freed or modified.
32704 * Checks if the VFS is active.
32706 * Returns: %TRUE if construction of the @vfs was successful and it is now active.
32711 * g_vfs_parse_name:
32713 * @parse_name: a string to be parsed by the VFS module.
32715 * This operation never fails, but the returned object might
32716 * not support any I/O operations if the @parse_name cannot
32717 * be parsed by the #GVfs module.
32719 * Returns: (transfer full): a #GFile for the given @parse_name. Free the returned object with g_object_unref().
32724 * g_volume_can_eject:
32725 * @volume: a #GVolume.
32727 * Checks if a volume can be ejected.
32729 * Returns: %TRUE if the @volume can be ejected. %FALSE otherwise.
32734 * g_volume_can_mount:
32735 * @volume: a #GVolume.
32737 * Checks if a volume can be mounted.
32739 * Returns: %TRUE if the @volume can be mounted. %FALSE otherwise.
32745 * @volume: a #GVolume.
32746 * @flags: flags affecting the unmount if required for eject
32747 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32748 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
32749 * @user_data: user data that gets passed to @callback
32751 * Ejects a volume. This is an asynchronous operation, and is
32752 * finished by calling g_volume_eject_finish() with the @volume
32753 * and #GAsyncResult returned in the @callback.
32755 * Deprecated: 2.22: Use g_volume_eject_with_operation() instead.
32760 * g_volume_eject_finish:
32761 * @volume: pointer to a #GVolume.
32762 * @result: a #GAsyncResult.
32763 * @error: a #GError location to store an error, or %NULL to ignore
32765 * Finishes ejecting a volume. If any errors occurred during the operation,
32766 * @error will be set to contain the errors and %FALSE will be returned.
32768 * Returns: %TRUE, %FALSE if operation failed.
32769 * Deprecated: 2.22: Use g_volume_eject_with_operation_finish() instead.
32774 * g_volume_eject_with_operation:
32775 * @volume: a #GVolume.
32776 * @flags: flags affecting the unmount if required for eject
32777 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
32778 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32779 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
32780 * @user_data: user data passed to @callback.
32782 * Ejects a volume. This is an asynchronous operation, and is
32783 * finished by calling g_volume_eject_with_operation_finish() with the @volume
32784 * and #GAsyncResult data returned in the @callback.
32791 * g_volume_eject_with_operation_finish:
32792 * @volume: a #GVolume.
32793 * @result: a #GAsyncResult.
32794 * @error: a #GError location to store the error occurring, or %NULL to ignore.
32796 * Finishes ejecting a volume. If any errors occurred during the operation,
32797 * @error will be set to contain the errors and %FALSE will be returned.
32799 * Returns: %TRUE if the volume was successfully ejected. %FALSE otherwise.
32805 * g_volume_enumerate_identifiers:
32806 * @volume: a #GVolume
32808 * Gets the kinds of <link linkend="volume-identifier">identifiers</link>
32809 * that @volume has. Use g_volume_get_identifier() to obtain
32810 * the identifiers themselves.
32812 * Returns: (array zero-terminated=1) (transfer full): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
32817 * g_volume_get_activation_root:
32818 * @volume: a #GVolume
32820 * Gets the activation root for a #GVolume if it is known ahead of
32821 * mount time. Returns %NULL otherwise. If not %NULL and if @volume
32822 * is mounted, then the result of g_mount_get_root() on the
32823 * #GMount object obtained from g_volume_get_mount() will always
32824 * either be equal or a prefix of what this function returns. In
32825 * other words, in code
32829 * GFile *mount_root
32830 * GFile *volume_activation_root;
32832 * mount = g_volume_get_mount (volume); /* mounted, so never NULL */
32833 * mount_root = g_mount_get_root (mount);
32834 * volume_activation_root = g_volume_get_activation_root(volume); /* assume not NULL */
32835 * </programlisting>
32837 * then the expression
32840 * (g_file_has_prefix (volume_activation_root, mount_root) ||
32841 * g_file_equal (volume_activation_root, mount_root))
32842 * </programlisting>
32844 * will always be %TRUE.
32846 * Activation roots are typically used in #GVolumeMonitor
32847 * implementations to find the underlying mount to shadow, see
32848 * g_mount_is_shadowed() for more details.
32850 * Returns: (transfer full): the activation root of @volume or %NULL. Use g_object_unref() to free.
32856 * g_volume_get_drive:
32857 * @volume: a #GVolume.
32859 * Gets the drive for the @volume.
32861 * 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.
32866 * g_volume_get_icon:
32867 * @volume: a #GVolume.
32869 * Gets the icon for @volume.
32871 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
32876 * g_volume_get_identifier:
32877 * @volume: a #GVolume
32878 * @kind: the kind of identifier to return
32880 * Gets the identifier of the given kind for @volume.
32881 * See the <link linkend="volume-identifier">introduction</link>
32882 * for more information about volume identifiers.
32884 * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GVolume doesn't have this kind of identifier
32889 * g_volume_get_mount:
32890 * @volume: a #GVolume.
32892 * Gets the mount for the @volume.
32894 * 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.
32899 * g_volume_get_name:
32900 * @volume: a #GVolume.
32902 * Gets the name of @volume.
32904 * Returns: the name for the given @volume. The returned string should be freed with g_free() when no longer needed.
32909 * g_volume_get_sort_key:
32910 * @volume: A #GVolume.
32912 * Gets the sort key for @volume, if any.
32914 * Returns: Sorting key for @volume or %NULL if no such key is available.
32920 * g_volume_get_symbolic_icon:
32921 * @volume: a #GVolume.
32923 * Gets the symbolic icon for @volume.
32925 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
32931 * g_volume_get_uuid:
32932 * @volume: a #GVolume.
32934 * Gets the UUID for the @volume. The reference is typically based on
32935 * the file system UUID for the volume in question and should be
32936 * considered an opaque string. Returns %NULL if there is no UUID
32939 * 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.
32944 * g_volume_monitor_adopt_orphan_mount:
32945 * @mount: a #GMount object to find a parent for
32947 * This function should be called by any #GVolumeMonitor
32948 * implementation when a new #GMount object is created that is not
32949 * associated with a #GVolume object. It must be called just before
32950 * emitting the @mount_added signal.
32952 * If the return value is not %NULL, the caller must associate the
32953 * returned #GVolume object with the #GMount. This involves returning
32954 * it in its g_mount_get_volume() implementation. The caller must
32955 * also listen for the "removed" signal on the returned object
32956 * and give up its reference when handling that signal
32958 * Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
32959 * the implementor must take a reference to @mount and return it in
32960 * its g_volume_get_mount() implemented. Also, the implementor must
32961 * listen for the "unmounted" signal on @mount and give up its
32962 * reference upon handling that signal.
32964 * There are two main use cases for this function.
32966 * One is when implementing a user space file system driver that reads
32967 * blocks of a block device that is already represented by the native
32968 * volume monitor (for example a CD Audio file system driver). Such
32969 * a driver will generate its own #GMount object that needs to be
32970 * associated with the #GVolume object that represents the volume.
32972 * The other is for implementing a #GVolumeMonitor whose sole purpose
32973 * is to return #GVolume objects representing entries in the users
32974 * "favorite servers" list or similar.
32976 * Returns: (transfer full): the #GVolume object that is the parent for @mount or %NULL if no wants to adopt the #GMount.
32977 * 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.
32982 * g_volume_monitor_get:
32984 * Gets the volume monitor used by gio.
32986 * Returns: (transfer full): a reference to the #GVolumeMonitor used by gio. Call g_object_unref() when done with it.
32991 * g_volume_monitor_get_connected_drives:
32992 * @volume_monitor: a #GVolumeMonitor.
32994 * Gets a list of drives connected to the system.
32996 * The returned list should be freed with g_list_free(), after
32997 * its elements have been unreffed with g_object_unref().
32999 * Returns: (element-type GDrive) (transfer full): a #GList of connected #GDrive objects.
33004 * g_volume_monitor_get_mount_for_uuid:
33005 * @volume_monitor: a #GVolumeMonitor.
33006 * @uuid: the UUID to look for
33008 * Finds a #GMount object by its UUID (see g_mount_get_uuid())
33010 * Returns: (transfer full): a #GMount or %NULL if no such mount is available. Free the returned object with g_object_unref().
33015 * g_volume_monitor_get_mounts:
33016 * @volume_monitor: a #GVolumeMonitor.
33018 * Gets a list of the mounts on the system.
33020 * The returned list should be freed with g_list_free(), after
33021 * its elements have been unreffed with g_object_unref().
33023 * Returns: (element-type GMount) (transfer full): a #GList of #GMount objects.
33028 * g_volume_monitor_get_volume_for_uuid:
33029 * @volume_monitor: a #GVolumeMonitor.
33030 * @uuid: the UUID to look for
33032 * Finds a #GVolume object by its UUID (see g_volume_get_uuid())
33034 * Returns: (transfer full): a #GVolume or %NULL if no such volume is available. Free the returned object with g_object_unref().
33039 * g_volume_monitor_get_volumes:
33040 * @volume_monitor: a #GVolumeMonitor.
33042 * Gets a list of the volumes on the system.
33044 * The returned list should be freed with g_list_free(), after
33045 * its elements have been unreffed with g_object_unref().
33047 * Returns: (element-type GVolume) (transfer full): a #GList of #GVolume objects.
33053 * @volume: a #GVolume.
33054 * @flags: flags affecting the operation
33055 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
33056 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
33057 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
33058 * @user_data: user data that gets passed to @callback
33060 * Mounts a volume. This is an asynchronous operation, and is
33061 * finished by calling g_volume_mount_finish() with the @volume
33062 * and #GAsyncResult returned in the @callback.
33064 * Virtual: mount_fn
33069 * g_volume_mount_finish:
33070 * @volume: a #GVolume
33071 * @result: a #GAsyncResult
33072 * @error: a #GError location to store an error, or %NULL to ignore
33074 * Finishes mounting a volume. If any errors occurred during the operation,
33075 * @error will be set to contain the errors and %FALSE will be returned.
33077 * If the mount operation succeeded, g_volume_get_mount() on @volume
33078 * is guaranteed to return the mount right after calling this
33079 * function; there's no need to listen for the 'mount-added' signal on
33082 * Returns: %TRUE, %FALSE if operation failed.
33087 * g_volume_should_automount:
33088 * @volume: a #GVolume
33090 * Returns whether the volume should be automatically mounted.
33092 * Returns: %TRUE if the volume should be automatically mounted.
33097 * g_win32_input_stream_get_close_handle:
33098 * @stream: a #GWin32InputStream
33100 * Returns whether the handle of @stream will be
33101 * closed when the stream is closed.
33103 * Returns: %TRUE if the handle is closed when done
33109 * g_win32_input_stream_get_handle:
33110 * @stream: a #GWin32InputStream
33112 * Return the Windows file handle that the stream reads from.
33114 * Returns: The file handle of @stream
33120 * g_win32_input_stream_new:
33121 * @handle: a Win32 file handle
33122 * @close_handle: %TRUE to close the handle when done
33124 * Creates a new #GWin32InputStream for the given @handle.
33126 * If @close_handle is %TRUE, the handle will be closed
33127 * when the stream is closed.
33129 * Note that "handle" here means a Win32 HANDLE, not a "file descriptor"
33130 * as used in the Windows C libraries.
33132 * Returns: a new #GWin32InputStream
33137 * g_win32_input_stream_set_close_handle:
33138 * @stream: a #GWin32InputStream
33139 * @close_handle: %TRUE to close the handle when done
33141 * Sets whether the handle of @stream shall be closed
33142 * when the stream is closed.
33149 * g_win32_output_stream_get_close_handle:
33150 * @stream: a #GWin32OutputStream
33152 * Returns whether the handle of @stream will be closed when the
33153 * stream is closed.
33155 * Returns: %TRUE if the handle is closed when done
33161 * g_win32_output_stream_get_handle:
33162 * @stream: a #GWin32OutputStream
33164 * Return the Windows handle that the stream writes to.
33166 * Returns: The handle descriptor of @stream
33172 * g_win32_output_stream_new:
33173 * @handle: a Win32 file handle
33174 * @close_handle: %TRUE to close the handle when done
33176 * Creates a new #GWin32OutputStream for the given @handle.
33178 * If @close_handle, is %TRUE, the handle will be closed when the
33179 * output stream is destroyed.
33181 * Returns: a new #GOutputStream
33187 * g_win32_output_stream_set_close_handle:
33188 * @stream: a #GWin32OutputStream
33189 * @close_handle: %TRUE to close the handle when done
33191 * Sets whether the handle of @stream shall be closed when the stream
33199 * g_zlib_compressor_get_file_info:
33200 * @compressor: a #GZlibCompressor
33202 * Returns the #GZlibCompressor:file-info property.
33204 * Returns: (transfer none): a #GFileInfo, or %NULL
33210 * g_zlib_compressor_new:
33211 * @format: The format to use for the compressed data
33212 * @level: compression level (0-9), -1 for default
33214 * Creates a new #GZlibCompressor.
33216 * Returns: a new #GZlibCompressor
33222 * g_zlib_compressor_set_file_info:
33223 * @compressor: a #GZlibCompressor
33224 * @file_info: (allow-none): a #GFileInfo
33226 * Sets @file_info in @compressor. If non-%NULL, and @compressor's
33227 * #GZlibCompressor:format property is %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
33228 * it will be used to set the file name and modification time in
33229 * the GZIP header of the compressed data.
33231 * Note: it is an error to call this function while a compression is in
33232 * progress; it may only be called immediately after creation of @compressor,
33233 * or after resetting it with g_converter_reset().
33240 * g_zlib_decompressor_get_file_info:
33241 * @decompressor: a #GZlibDecompressor
33243 * Retrieves the #GFileInfo constructed from the GZIP header data
33244 * of compressed data processed by @compressor, or %NULL if @decompressor's
33245 * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
33246 * or the header data was not fully processed yet, or it not present in the
33247 * data stream at all.
33249 * Returns: (transfer none): a #GFileInfo, or %NULL
33255 * g_zlib_decompressor_new:
33256 * @format: The format to use for the compressed data
33258 * Creates a new #GZlibDecompressor.
33260 * Returns: a new #GZlibDecompressor
33266 * get_all_desktop_entries_for_mime_type:
33267 * @mime_type: a mime type.
33268 * @except: NULL or a strv list
33270 * Returns all the desktop ids for @mime_type. The desktop files
33271 * are listed in an order so that default applications are listed before
33272 * non-default ones, and handlers for inherited mimetypes are listed
33273 * after the base ones.
33275 * Optionally doesn't list the desktop ids given in the @except
33277 * Returns: a #GList containing the desktop ids which claim to handle @mime_type.
33282 * mime_info_cache_reload:
33283 * @dir: directory path which needs reloading.
33285 * Reload the mime information for the @dir.
33290 /************************************************************/
33291 /* THIS FILE IS GENERATED DO NOT EDIT */
33292 /************************************************************/