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: 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:anonymous:
1701 * Whether to use an anonymous user when authenticating.
1706 * GMountOperation:choice:
1708 * The index of the user's choice when a question is asked during the
1709 * mount operation. See the #GMountOperation::ask-question signal.
1714 * GMountOperation:domain:
1716 * The domain to use for the mount operation.
1721 * GMountOperation:password:
1723 * The password that is used for authentication when carrying out
1724 * the mount operation.
1729 * GMountOperation:password-save:
1731 * Determines if and how the password information should be saved.
1736 * GMountOperation:username:
1738 * The user name that is used for authentication when carrying out
1739 * the mount operation.
1746 * A #GSocketConnectable for resolving a hostname and connecting to
1754 * #GNetworkMonitor monitors the status of network connections and
1755 * indicates when a possibly-user-visible change has occurred.
1762 * GNetworkMonitor::network-changed:
1763 * @monitor: a #GNetworkMonitor
1764 * @available: the current value of #GNetworkMonitor:network-available
1766 * Emitted when the network configuration changes. If @available is
1767 * %TRUE, then some hosts may be reachable that were not reachable
1768 * before, while others that were reachable before may no longer be
1769 * reachable. If @available is %FALSE, then no remote hosts are
1777 * GNetworkMonitor:network-available:
1779 * Whether the network is considered available. That is, whether the
1780 * system has a default route for at least one of IPv4 or IPv6.
1782 * Real-world networks are of course much more complicated than
1783 * this; the machine may be connected to a wifi hotspot that
1784 * requires payment before allowing traffic through, or may be
1785 * connected to a functioning router that has lost its own upstream
1786 * connectivity. Some hosts might only be accessible when a VPN is
1787 * active. Other hosts might only be accessible when the VPN is
1788 * <emphasis>not</emphasis> active. Thus, it is best to use
1789 * g_network_monitor_can_reach() or
1790 * g_network_monitor_can_reach_async() to test for reachability on a
1791 * host-by-host basis. (On the other hand, when the property is
1792 * %FALSE, the application can reasonably expect that no remote
1793 * hosts at all are reachable, and should indicate this to the user
1796 * See also #GNetworkMonitor::network-changed.
1805 * A #GSocketConnectable for resolving a SRV record and connecting to
1813 * #GPermission is an opaque data structure and can only be accessed
1814 * using the following functions.
1819 * GPermission:allowed:
1821 * %TRUE if the caller currently has permission to perform the action that
1822 * @permission represents the permission to perform.
1827 * GPermission:can-acquire:
1829 * %TRUE if it is generally possible to acquire the permission by calling
1830 * g_permission_acquire().
1835 * GPermission:can-release:
1837 * %TRUE if it is generally possible to release the permission by calling
1838 * g_permission_release().
1845 * A #GInetSocketAddress representing a connection via a proxy server
1852 * GProxyAddress:destination-protocol:
1854 * The protocol being spoke to the destination host, or %NULL if
1855 * the #GProxyAddress doesn't know.
1862 * GProxyAddress:uri:
1864 * The URI string that the proxy was constructed from (or %NULL
1865 * if the creator didn't specify this).
1872 * GRemoteActionGroupInterface:
1873 * @activate_action_full: the virtual function pointer for g_remote_action_group_activate_action_full()
1874 * @change_action_state_full: the virtual function pointer for g_remote_action_group_change_action_state_full()
1876 * The virtual function table for #GRemoteActionGroup.
1885 * The object that handles DNS resolution. Use g_resolver_get_default()
1886 * to get the default resolver.
1891 * GResolver::reload:
1892 * @resolver: a #GResolver
1894 * Emitted when the resolver notices that the system resolver
1895 * configuration has changed.
1900 * GSettings::change-event:
1901 * @settings: the object on which the signal was emitted
1902 * @keys: (array length=n_keys) (element-type GQuark) (allow-none): an array of #GQuark<!-- -->s for the changed keys, or %NULL
1903 * @n_keys: the length of the @keys array, or 0
1905 * The "change-event" signal is emitted once per change event that
1906 * affects this settings object. You should connect to this signal
1907 * only if you are interested in viewing groups of changes before they
1908 * are split out into multiple emissions of the "changed" signal.
1909 * For most use cases it is more appropriate to use the "changed" signal.
1911 * In the event that the change event applies to one or more specified
1912 * keys, @keys will be an array of #GQuark of length @n_keys. In the
1913 * event that the change event applies to the #GSettings object as a
1914 * whole (ie: potentially every key has been changed) then @keys will
1915 * be %NULL and @n_keys will be 0.
1917 * The default handler for this signal invokes the "changed" signal
1918 * for each affected key. If any other connected handler returns
1919 * %TRUE then this default functionality will be suppressed.
1921 * Returns: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
1926 * GSettings::changed:
1927 * @settings: the object on which the signal was emitted
1928 * @key: the name of the key that changed
1930 * The "changed" signal is emitted when a key has potentially changed.
1931 * You should call one of the g_settings_get() calls to check the new
1934 * This signal supports detailed connections. You can connect to the
1935 * detailed signal "changed::x" in order to only receive callbacks
1936 * when key "x" changes.
1941 * GSettings::writable-change-event:
1942 * @settings: the object on which the signal was emitted
1943 * @key: the quark of the key, or 0
1945 * The "writable-change-event" signal is emitted once per writability
1946 * change event that affects this settings object. You should connect
1947 * to this signal if you are interested in viewing groups of changes
1948 * before they are split out into multiple emissions of the
1949 * "writable-changed" signal. For most use cases it is more
1950 * appropriate to use the "writable-changed" signal.
1952 * In the event that the writability change applies only to a single
1953 * key, @key will be set to the #GQuark for that key. In the event
1954 * that the writability change affects the entire settings object,
1957 * The default handler for this signal invokes the "writable-changed"
1958 * and "changed" signals for each affected key. This is done because
1959 * changes in writability might also imply changes in value (if for
1960 * example, a new mandatory setting is introduced). If any other
1961 * connected handler returns %TRUE then this default functionality
1962 * will be suppressed.
1964 * Returns: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
1969 * GSettings::writable-changed:
1970 * @settings: the object on which the signal was emitted
1973 * The "writable-changed" signal is emitted when the writability of a
1974 * key has potentially changed. You should call
1975 * g_settings_is_writable() in order to determine the new status.
1977 * This signal supports detailed connections. You can connect to the
1978 * detailed signal "writable-changed::x" in order to only receive
1979 * callbacks when the writability of "x" changes.
1984 * GSettings:context:
1986 * The name of the context that the settings are stored in.
1991 * GSettings:delay-apply:
1993 * Whether the #GSettings object is in 'delay-apply' mode. See
1994 * g_settings_delay() for details.
2001 * GSettings:has-unapplied:
2003 * If this property is %TRUE, the #GSettings object has outstanding
2004 * changes that will be applied when g_settings_apply() is called.
2011 * The path within the backend where the settings are stored.
2018 * The name of the schema that describes the types of keys
2019 * for this #GSettings object.
2021 * The type of this property is *not* #GSettingsSchema.
2022 * #GSettingsSchema has only existed since version 2.32 and
2023 * unfortunately this name was used in previous versions to refer to
2024 * the schema ID rather than the schema itself. Take care to use the
2025 * 'settings-schema' property if you wish to pass in a
2028 * Deprecated: 2.32:Use the 'schema-id' property instead. In a future version, this property may instead refer to a #GSettingsSchema.
2033 * GSettings:schema-id:
2035 * The name of the schema that describes the types of keys
2036 * for this #GSettings object.
2041 * GSettings:settings-schema:
2043 * The #GSettingsSchema describing the types of keys for this
2044 * #GSettings object.
2046 * Ideally, this property would be called 'schema'. #GSettingsSchema
2047 * has only existed since version 2.32, however, and before then the
2048 * 'schema' property was used to refer to the ID of the schema rather
2049 * than the schema itself. Take care.
2056 * This is an opaque structure type. You may not access it directly.
2063 * GSettingsSchemaSource:
2065 * This is an opaque structure type. You may not access it directly.
2072 * GSimpleAction::activate:
2073 * @simple: the #GSimpleAction
2074 * @parameter: (allow-none): the parameter to the activation
2076 * Indicates that the action was just activated.
2078 * @parameter will always be of the expected type. In the event that
2079 * an incorrect type was given, no signal will be emitted.
2086 * GSimpleAction::change-state:
2087 * @simple: the #GSimpleAction
2088 * @value: (allow-none): the requested value for the state
2090 * Indicates that the action just received a request to change its
2093 * @value will always be of the correct state type. In the event that
2094 * an incorrect type was given, no signal will be emitted.
2096 * If no handler is connected to this signal then the default
2097 * behaviour is to call g_simple_action_set_state() to set the state
2098 * to the requested value. If you connect a signal handler then no
2099 * default action is taken. If the state should change then you must
2100 * call g_simple_action_set_state() from the handler.
2103 * <title>Example 'change-state' handler</title>
2106 * change_volume_state (GSimpleAction *action,
2108 * gpointer user_data)
2112 * requested = g_variant_get_int32 (value);
2114 * // Volume only goes from 0 to 10
2115 * if (0 <= requested && requested <= 10)
2116 * g_simple_action_set_state (action, value);
2121 * The handler need not set the state to the requested value. It
2122 * could set it to any value at all, or take some other action.
2129 * GSimpleAction:enabled:
2131 * If @action is currently enabled.
2133 * If the action is disabled then calls to g_action_activate() and
2134 * g_action_change_state() have no effect.
2141 * GSimpleAction:name:
2143 * The name of the action. This is mostly meaningful for identifying
2144 * the action once it has been added to a #GSimpleActionGroup.
2151 * GSimpleAction:parameter-type:
2153 * The type of the parameter that must be given when activating the
2161 * GSimpleAction:state:
2163 * The state of the action, or %NULL if the action is stateless.
2170 * GSimpleAction:state-type:
2172 * The #GVariantType of the state that the action has, or %NULL if the
2173 * action is stateless.
2180 * GSimplePermission:
2182 * #GSimplePermission is an opaque data structure. There are no methods
2183 * except for those defined by #GPermission.
2188 * GSocket:broadcast:
2190 * Whether the socket should allow sending to and receiving from broadcast addresses.
2197 * GSocket:multicast-loopback:
2199 * Whether outgoing multicast packets loop back to the local host.
2206 * GSocket:multicast-ttl:
2208 * Time-to-live out outgoing multicast packets
2217 * The timeout in seconds on socket I/O
2226 * Time-to-live for outgoing unicast packets
2235 * A socket endpoint address, corresponding to <type>struct sockaddr</type>
2236 * or one of its subtypes.
2241 * GSocketClient::event:
2242 * @client: the #GSocketClient
2243 * @event: the event that is occurring
2244 * @connectable: the #GSocketConnectable that @event is occurring on
2245 * @connection: the current representation of the connection
2247 * Emitted when @client's activity on @connectable changes state.
2248 * Among other things, this can be used to provide progress
2249 * information about a network connection in the UI. The meanings of
2250 * the different @event values are as follows:
2254 * <term>%G_SOCKET_CLIENT_RESOLVING:</term>
2256 * @client is about to look up @connectable in DNS.
2257 * @connection will be %NULL.
2258 * </para></listitem>
2261 * <term>%G_SOCKET_CLIENT_RESOLVED:</term>
2263 * @client has successfully resolved @connectable in DNS.
2264 * @connection will be %NULL.
2265 * </para></listitem>
2268 * <term>%G_SOCKET_CLIENT_CONNECTING:</term>
2270 * @client is about to make a connection to a remote host;
2271 * either a proxy server or the destination server itself.
2272 * @connection is the #GSocketConnection, which is not yet
2274 * </para></listitem>
2277 * <term>%G_SOCKET_CLIENT_CONNECTED:</term>
2279 * @client has successfully connected to a remote host.
2280 * @connection is the connected #GSocketConnection.
2281 * </para></listitem>
2284 * <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATING:</term>
2286 * @client is about to negotiate with a proxy to get it to
2287 * connect to @connectable. @connection is the
2288 * #GSocketConnection to the proxy server.
2289 * </para></listitem>
2292 * <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATED:</term>
2294 * @client has negotiated a connection to @connectable through
2295 * a proxy server. @connection is the stream returned from
2296 * g_proxy_connect(), which may or may not be a
2297 * #GSocketConnection.
2298 * </para></listitem>
2301 * <term>%G_SOCKET_CLIENT_TLS_HANDSHAKING:</term>
2303 * @client is about to begin a TLS handshake. @connection is a
2304 * #GTlsClientConnection.
2305 * </para></listitem>
2308 * <term>%G_SOCKET_CLIENT_TLS_HANDSHAKED:</term>
2310 * @client has successfully completed the TLS handshake.
2311 * @connection is a #GTlsClientConnection.
2312 * </para></listitem>
2315 * <term>%G_SOCKET_CLIENT_COMPLETE:</term>
2317 * @client has either successfully connected to @connectable
2318 * (in which case @connection is the #GSocketConnection that
2319 * it will be returning to the caller) or has failed (in which
2320 * case @connection is %NULL and the client is about to return
2322 * </para></listitem>
2326 * Each event except %G_SOCKET_CLIENT_COMPLETE may be emitted
2327 * multiple times (or not at all) for a given connectable (in
2328 * particular, if @client ends up attempting to connect to more than
2329 * one address). However, if @client emits the #GSocketClient::event
2330 * signal at all for a given connectable, that it will always emit
2331 * it with %G_SOCKET_CLIENT_COMPLETE when it is done.
2333 * Note that there may be additional #GSocketClientEvent values in
2334 * the future; unrecognized @event values should be ignored.
2341 * GSocketService::incoming:
2342 * @service: the #GSocketService
2343 * @connection: a new #GSocketConnection object
2344 * @source_object: (allow-none): the source_object passed to g_socket_listener_add_address()
2346 * The ::incoming signal is emitted when a new incoming connection
2347 * to @service needs to be handled. The handler must initiate the
2348 * handling of @connection, but may not block; in essence,
2349 * asynchronous operations must be used.
2351 * @connection will be unreffed once the signal handler returns,
2352 * so you need to ref it yourself if you are planning to use it.
2354 * Returns: %TRUE to stop other handlers from being called
2362 * A single target host/port that a network service is running on.
2369 * The #GTestDBus structure contains only private data and
2370 * should only be accessed using the provided API.
2379 * #GTestDBusFlags specifying the behaviour of the dbus session
2393 * GThemedIcon:names:
2395 * A %NULL-terminated array of icon names.
2400 * GThemedIcon:use-default-fallbacks:
2402 * Whether to use the default fallbacks found by shortening the icon name
2403 * at '-' characters. If the "names" array has more than one element,
2404 * ignores any past the first.
2406 * For example, if the icon name was "gnome-dev-cdrom-audio", the array
2410 * "gnome-dev-cdrom-audio",
2411 * "gnome-dev-cdrom",
2421 * GThreadedSocketService::run:
2422 * @service: the #GThreadedSocketService.
2423 * @connection: a new #GSocketConnection object.
2424 * @source_object: the source_object passed to g_socket_listener_add_address().
2426 * The ::run signal is emitted in a worker thread in response to an
2427 * incoming connection. This thread is dedicated to handling
2428 * @connection and may perform blocking IO. The signal handler need
2429 * not return until the connection is closed.
2431 * Returns: %TRUE to stop further signal handlers from being called
2438 * TLS (Transport Layer Security, aka SSL) backend. This is an
2439 * internal type used to coordinate the different classes implemented
2449 * Abstract base class for TLS certificate types.
2456 * GTlsCertificate:certificate:
2458 * The DER (binary) encoded representation of the certificate's
2459 * public key. This property and the
2460 * #GTlsCertificate:certificate-pem property represent the same
2461 * data, just in different forms.
2468 * GTlsCertificate:certificate-pem:
2470 * The PEM (ASCII) encoded representation of the certificate's
2471 * public key. This property and the #GTlsCertificate:certificate
2472 * property represent the same data, just in different forms.
2479 * GTlsCertificate:issuer:
2481 * A #GTlsCertificate representing the entity that issued this
2482 * certificate. If %NULL, this means that the certificate is either
2483 * self-signed, or else the certificate of the issuer is not
2491 * GTlsCertificate:private-key:
2493 * The DER (binary) encoded representation of the certificate's
2494 * private key, in either PKCS#1 format or unencrypted PKCS#8
2495 * format. This property (or the #GTlsCertificate:private-key-pem
2496 * property) can be set when constructing a key (eg, from a file),
2497 * but cannot be read.
2499 * PKCS#8 format is supported since 2.32; earlier releases only
2500 * support PKCS#1. You can use the <literal>openssl rsa</literal>
2501 * tool to convert PKCS#8 keys to PKCS#1.
2508 * GTlsCertificate:private-key-pem:
2510 * The PEM (ASCII) encoded representation of the certificate's
2511 * private key in either PKCS#1 format ("<literal>BEGIN RSA PRIVATE
2512 * KEY</literal>") or unencrypted PKCS#8 format ("<literal>BEGIN
2513 * PRIVATE KEY</literal>"). This property (or the
2514 * #GTlsCertificate:private-key property) can be set when
2515 * constructing a key (eg, from a file), but cannot be read.
2517 * PKCS#8 format is supported since 2.32; earlier releases only
2518 * support PKCS#1. You can use the <literal>openssl rsa</literal>
2519 * tool to convert PKCS#8 keys to PKCS#1.
2526 * GTlsClientConnection:
2528 * Abstract base class for the backend-specific client connection
2536 * GTlsClientConnection:accepted-cas:
2538 * A list of the distinguished names of the Certificate Authorities
2539 * that the server will accept client certificates signed by. If the
2540 * server requests a client certificate during the handshake, then
2541 * this property will be set after the handshake completes.
2543 * Each item in the list is a #GByteArray which contains the complete
2544 * subject DN of the certificate authority.
2551 * GTlsClientConnection:server-identity:
2553 * A #GSocketConnectable describing the identity of the server that
2554 * is expected on the other end of the connection.
2556 * If the %G_TLS_CERTIFICATE_BAD_IDENTITY flag is set in
2557 * #GTlsClientConnection:validation-flags, this object will be used
2558 * to determine the expected identify of the remote end of the
2559 * connection; if #GTlsClientConnection:server-identity is not set,
2560 * or does not match the identity presented by the server, then the
2561 * %G_TLS_CERTIFICATE_BAD_IDENTITY validation will fail.
2563 * In addition to its use in verifying the server certificate,
2564 * this is also used to give a hint to the server about what
2565 * certificate we expect, which is useful for servers that serve
2573 * GTlsClientConnection:use-ssl3:
2575 * If %TRUE, tells the connection to use SSL 3.0 rather than trying
2576 * to negotiate the best version of TLS or SSL to use. This can be
2577 * used when talking to servers that don't implement version
2578 * negotiation correctly and therefore refuse to handshake at all with
2579 * a "modern" TLS handshake.
2586 * GTlsClientConnection:validation-flags:
2588 * What steps to perform when validating a certificate received from
2589 * a server. Server certificates that fail to validate in all of the
2590 * ways indicated here will be rejected unless the application
2591 * overrides the default via #GTlsConnection::accept-certificate.
2600 * Abstract base class for the backend-specific #GTlsClientConnection
2601 * and #GTlsServerConnection types.
2608 * GTlsConnection::accept-certificate:
2609 * @conn: a #GTlsConnection
2610 * @peer_cert: the peer's #GTlsCertificate
2611 * @errors: the problems with @peer_cert.
2613 * Emitted during the TLS handshake after the peer certificate has
2614 * been received. You can examine @peer_cert's certification path by
2615 * calling g_tls_certificate_get_issuer() on it.
2617 * For a client-side connection, @peer_cert is the server's
2618 * certificate, and the signal will only be emitted if the
2619 * certificate was not acceptable according to @conn's
2620 * #GTlsClientConnection:validation_flags. If you would like the
2621 * certificate to be accepted despite @errors, return %TRUE from the
2622 * signal handler. Otherwise, if no handler accepts the certificate,
2623 * the handshake will fail with %G_TLS_ERROR_BAD_CERTIFICATE.
2625 * For a server-side connection, @peer_cert is the certificate
2626 * presented by the client, if this was requested via the server's
2627 * #GTlsServerConnection:authentication_mode. On the server side,
2628 * the signal is always emitted when the client presents a
2629 * certificate, and the certificate will only be accepted if a
2630 * handler returns %TRUE.
2632 * Note that if this signal is emitted as part of asynchronous I/O
2633 * in the main thread, then you should not attempt to interact with
2634 * the user before returning from the signal handler. If you want to
2635 * let the user decide whether or not to accept the certificate, you
2636 * would have to return %FALSE from the signal handler on the first
2637 * attempt, and then after the connection attempt returns a
2638 * %G_TLS_ERROR_HANDSHAKE, you can interact with the user, and if
2639 * the user decides to accept the certificate, remember that fact,
2640 * create a new connection, and return %TRUE from the signal handler
2643 * If you are doing I/O in another thread, you do not
2644 * need to worry about this, and can simply block in the signal
2645 * handler until the UI thread returns an answer.
2647 * 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.
2653 * GTlsConnection:base-io-stream:
2655 * The #GIOStream that the connection wraps
2662 * GTlsConnection:certificate:
2664 * The connection's certificate; see
2665 * g_tls_connection_set_certificate().
2672 * GTlsConnection:database:
2674 * The certificate database to use when verifying this TLS connection.
2675 * If no cerificate database is set, then the default database will be
2676 * used. See g_tls_backend_get_default_database().
2683 * GTlsConnection:interaction:
2685 * A #GTlsInteraction object to be used when the connection or certificate
2686 * database need to interact with the user. This will be used to prompt the
2687 * user for passwords where necessary.
2694 * GTlsConnection:peer-certificate:
2696 * The connection's peer's certificate, after the TLS handshake has
2697 * completed and the certificate has been accepted. Note in
2698 * particular that this is not yet set during the emission of
2699 * #GTlsConnection::accept-certificate.
2701 * (You can watch for a #GObject::notify signal on this property to
2702 * detect when a handshake has occurred.)
2709 * GTlsConnection:peer-certificate-errors:
2711 * The errors noticed-and-ignored while verifying
2712 * #GTlsConnection:peer-certificate. Normally this should be 0, but
2713 * it may not be if #GTlsClientConnection:validation-flags is not
2714 * %G_TLS_CERTIFICATE_VALIDATE_ALL, or if
2715 * #GTlsConnection::accept-certificate overrode the default
2723 * GTlsConnection:rehandshake-mode:
2725 * The rehandshaking mode. See
2726 * g_tls_connection_set_rehandshake_mode().
2733 * GTlsConnection:require-close-notify:
2735 * Whether or not proper TLS close notification is required.
2736 * See g_tls_connection_set_require_close_notify().
2743 * GTlsConnection:use-system-certdb:
2745 * Whether or not the system certificate database will be used to
2746 * verify peer certificates. See
2747 * g_tls_connection_set_use_system_certdb().
2749 * Deprecated: 2.30: Use GTlsConnection:database instead
2756 * Abstract base class for the backend-specific database types.
2765 * Implemented by a #GTlsDatabase which allows you to load certificates
2773 * GTlsFileDatabase:anchors:
2775 * The path to a file containing PEM encoded certificate authority
2776 * root anchors. The certificates in this file will be treated as
2777 * root authorities for the purpose of verifying other certificates
2778 * via the g_tls_database_verify_chain() operation.
2787 * An object representing interaction that the TLS connection and database
2788 * might have with the user.
2795 * GTlsInteractionClass:
2796 * @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.
2797 * @ask_password_async: ask for a password asynchronously.
2798 * @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.
2800 * The class for #GTlsInteraction. Derived classes implement the various
2801 * virtual interaction methods to handle TLS interactions.
2803 * Derived classes can choose to implement whichever interactions methods they'd
2804 * like to support by overriding those virtual methods in their class
2805 * initialization function. If a derived class implements an async method,
2806 * it must also implement the corresponding finish method.
2808 * The synchronous interaction methods should implement to display modal dialogs,
2809 * and the asynchronous methods to display modeless dialogs.
2811 * If the user cancels an interaction, then the result should be
2812 * %G_TLS_INTERACTION_FAILED and the error should be set with a domain of
2813 * %G_IO_ERROR and code of %G_IO_ERROR_CANCELLED.
2822 * An abstract interface representing a password used in TLS. Often used in
2823 * user interaction such as unlocking a key storage token.
2830 * GTlsServerConnection:authentication-mode:
2832 * The #GTlsAuthenticationMode for the server. This can be changed
2833 * before calling g_tls_connection_handshake() if you want to
2834 * rehandshake with a different mode from the initial handshake.
2841 * GUnixCredentialsMessage:credentials:
2843 * The credentials stored in the message.
2850 * GUnixInputStream:close-fd:
2852 * Whether to close the file descriptor when the stream is closed.
2859 * GUnixInputStream:fd:
2861 * The file descriptor that the stream reads from.
2868 * GUnixMountMonitor::mountpoints-changed:
2869 * @monitor: the object on which the signal is emitted
2871 * Emitted when the unix mount points have changed.
2876 * GUnixMountMonitor::mounts-changed:
2877 * @monitor: the object on which the signal is emitted
2879 * Emitted when the unix mounts have changed.
2884 * GUnixOutputStream:close-fd:
2886 * Whether to close the file descriptor when the stream is closed.
2893 * GUnixOutputStream:fd:
2895 * The file descriptor that the stream writes to.
2902 * GUnixSocketAddress:
2904 * A UNIX-domain (local) socket address, corresponding to a
2905 * <type>struct sockaddr_un</type>.
2910 * GUnixSocketAddress:abstract:
2912 * Whether or not this is an abstract address
2914 * Deprecated: Use #GUnixSocketAddress:address-type, which distinguishes between zero-padded and non-zero-padded abstract addresses.
2921 * Emitted when the volume has been changed.
2928 * This signal is emitted when the #GVolume have been removed. If
2929 * the recipient is holding references to the object they should
2930 * release them so the object can be finalized.
2935 * GVolumeMonitor::drive-changed:
2936 * @volume_monitor: The volume monitor emitting the signal.
2937 * @drive: the drive that changed
2939 * Emitted when a drive changes.
2944 * GVolumeMonitor::drive-connected:
2945 * @volume_monitor: The volume monitor emitting the signal.
2946 * @drive: a #GDrive that was connected.
2948 * Emitted when a drive is connected to the system.
2953 * GVolumeMonitor::drive-disconnected:
2954 * @volume_monitor: The volume monitor emitting the signal.
2955 * @drive: a #GDrive that was disconnected.
2957 * Emitted when a drive is disconnected from the system.
2962 * GVolumeMonitor::drive-eject-button:
2963 * @volume_monitor: The volume monitor emitting the signal.
2964 * @drive: the drive where the eject button was pressed
2966 * Emitted when the eject button is pressed on @drive.
2973 * GVolumeMonitor::drive-stop-button:
2974 * @volume_monitor: The volume monitor emitting the signal.
2975 * @drive: the drive where the stop button was pressed
2977 * Emitted when the stop button is pressed on @drive.
2984 * GVolumeMonitor::mount-added:
2985 * @volume_monitor: The volume monitor emitting the signal.
2986 * @mount: a #GMount that was added.
2988 * Emitted when a mount is added.
2993 * GVolumeMonitor::mount-changed:
2994 * @volume_monitor: The volume monitor emitting the signal.
2995 * @mount: a #GMount that changed.
2997 * Emitted when a mount changes.
3002 * GVolumeMonitor::mount-pre-unmount:
3003 * @volume_monitor: The volume monitor emitting the signal.
3004 * @mount: a #GMount that is being unmounted.
3006 * Emitted when a mount is about to be removed.
3011 * GVolumeMonitor::mount-removed:
3012 * @volume_monitor: The volume monitor emitting the signal.
3013 * @mount: a #GMount that was removed.
3015 * Emitted when a mount is removed.
3020 * GVolumeMonitor::volume-added:
3021 * @volume_monitor: The volume monitor emitting the signal.
3022 * @volume: a #GVolume that was added.
3024 * Emitted when a mountable volume is added to the system.
3029 * GVolumeMonitor::volume-changed:
3030 * @volume_monitor: The volume monitor emitting the signal.
3031 * @volume: a #GVolume that changed.
3033 * Emitted when mountable volume is changed.
3038 * GVolumeMonitor::volume-removed:
3039 * @volume_monitor: The volume monitor emitting the signal.
3040 * @volume: a #GVolume that was removed.
3042 * Emitted when a mountable volume is removed from the system.
3047 * GWin32InputStream:close-handle:
3049 * Whether to close the file handle when the stream is closed.
3056 * GWin32InputStream:handle:
3058 * The handle that the stream reads from.
3065 * GWin32OutputStream:close-handle:
3067 * Whether to close the file handle when the stream is closed.
3074 * GWin32OutputStream:handle:
3076 * The file handle that the stream writes to.
3085 * Zlib decompression
3090 * GZlibCompressor:file-info:
3092 * If set to a non-%NULL #GFileInfo object, and #GZlibCompressor:format is
3093 * %G_ZLIB_COMPRESSOR_FORMAT_GZIP, the compressor will write the file name
3094 * and modification time from the file info to the the GZIP header.
3101 * GZlibDecompressor:
3103 * Zlib decompression
3108 * GZlibDecompressor:file-info:
3110 * A #GFileInfo containing the information found in the GZIP header
3111 * of the data stream processed, or %NULL if the header was not yet
3112 * fully processed, is not present at all, or the compressor's
3113 * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP.
3120 * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_CLIENT:
3122 * The purpose used to verify the client certificate in a TLS connection.
3123 * Used by TLS servers.
3128 * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER:
3130 * The purpose used to verify the server certificate in a TLS connection. This
3131 * is the most common purpose in use. Used by TLS clients.
3136 * G_TYPE_SETTINGS_SCHEMA:
3138 * A boxed #GType corresponding to #GSettingsSchema.
3145 * G_TYPE_SETTINGS_SCHEMA_SOURCE:
3147 * A boxed #GType corresponding to #GSettingsSchemaSource.
3154 * SECTION:_GFreedesktopDBus
3155 * @title: _GFreedesktopDBus
3156 * @short_description: Generated C code for the org.freedesktop.DBus D-Bus interface
3158 * 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.
3163 * SECTION:extensionpoints
3164 * @short_description: Extension Points
3166 * @see_also: <link linkend="extending-gio">Extending GIO</link>
3168 * #GIOExtensionPoint provides a mechanism for modules to extend the
3169 * functionality of the library or application that loaded it in an
3170 * organized fashion.
3172 * An extension point is identified by a name, and it may optionally
3173 * require that any implementation must by of a certain type (or derived
3174 * thereof). Use g_io_extension_point_register() to register an
3175 * extension point, and g_io_extension_point_set_required_type() to
3176 * set a required type.
3178 * A module can implement an extension point by specifying the #GType
3179 * that implements the functionality. Additionally, each implementation
3180 * of an extension point has a name, and a priority. Use
3181 * g_io_extension_point_implement() to implement an extension point.
3184 * GIOExtensionPoint *ep;
3186 * /* Register an extension point */
3187 * ep = g_io_extension_point_register ("my-extension-point");
3188 * g_io_extension_point_set_required_type (ep, MY_TYPE_EXAMPLE);
3192 * /* Implement an extension point */
3193 * G_DEFINE_TYPE (MyExampleImpl, my_example_impl, MY_TYPE_EXAMPLE);
3194 * g_io_extension_point_implement ("my-extension-point",
3195 * my_example_impl_get_type (),
3200 * It is up to the code that registered the extension point how
3201 * it uses the implementations that have been associated with it.
3202 * Depending on the use case, it may use all implementations, or
3203 * only the one with the highest priority, or pick a specific
3206 * To avoid opening all modules just to find out what extension
3207 * points they implement, GIO makes use of a caching mechanism,
3208 * see <link linkend="gio-querymodules">gio-querymodules</link>.
3209 * You are expected to run this command after installing a
3212 * The <envar>GIO_EXTRA_MODULES</envar> environment variable can be
3213 * used to specify additional directories to automatically load modules
3214 * from. This environment variable has the same syntax as the
3215 * <envar>PATH</envar>. If two modules have the same base name in different
3216 * directories, then the latter one will be ignored. If additional
3217 * directories are specified GIO will load modules from the built-in
3225 * @short_description: An action interface
3227 * #GAction represents a single named action.
3229 * The main interface to an action is that it can be activated with
3230 * g_action_activate(). This results in the 'activate' signal being
3231 * emitted. An activation has a #GVariant parameter (which may be
3232 * %NULL). The correct type for the parameter is determined by a static
3233 * parameter type (which is given at construction time).
3235 * An action may optionally have a state, in which case the state may be
3236 * set with g_action_change_state(). This call takes a #GVariant. The
3237 * correct type for the state is determined by a static state type
3238 * (which is given at construction time).
3240 * The state may have a hint associated with it, specifying its valid
3243 * #GAction is merely the interface to the concept of an action, as
3244 * described above. Various implementations of actions exist, including
3245 * #GSimpleAction and #GtkAction.
3247 * In all cases, the implementing class is responsible for storing the
3248 * name of the action, the parameter type, the enabled state, the
3249 * optional state type and the state and emitting the appropriate
3250 * signals when these change. The implementor responsible for filtering
3251 * calls to g_action_activate() and g_action_change_state() for type
3252 * safety and for the state being enabled.
3254 * Probably the only useful thing to do with a #GAction is to put it
3255 * inside of a #GSimpleActionGroup.
3260 * SECTION:gactiongroup
3261 * @title: GActionGroup
3262 * @short_description: A group of actions
3263 * @see_also: #GAction
3265 * #GActionGroup represents a group of actions. Actions can be used to
3266 * expose functionality in a structured way, either from one part of a
3267 * program to another, or to the outside world. Action groups are often
3268 * used together with a #GMenuModel that provides additional
3269 * representation data for displaying the actions to the user, e.g. in
3272 * The main way to interact with the actions in a GActionGroup is to
3273 * activate them with g_action_group_activate_action(). Activating an
3274 * action may require a #GVariant parameter. The required type of the
3275 * parameter can be inquired with g_action_group_get_action_parameter_type().
3276 * Actions may be disabled, see g_action_group_get_action_enabled().
3277 * Activating a disabled action has no effect.
3279 * Actions may optionally have a state in the form of a #GVariant. The
3280 * current state of an action can be inquired with
3281 * g_action_group_get_action_state(). Activating a stateful action may
3282 * change its state, but it is also possible to set the state by calling
3283 * g_action_group_change_action_state().
3285 * As typical example, consider a text editing application which has an
3286 * option to change the current font to 'bold'. A good way to represent
3287 * this would be a stateful action, with a boolean state. Activating the
3288 * action would toggle the state.
3290 * Each action in the group has a unique name (which is a string). All
3291 * method calls, except g_action_group_list_actions() take the name of
3292 * an action as an argument.
3294 * The #GActionGroup API is meant to be the 'public' API to the action
3295 * group. The calls here are exactly the interaction that 'external
3296 * forces' (eg: UI, incoming D-Bus messages, etc.) are supposed to have
3297 * with actions. 'Internal' APIs (ie: ones meant only to be accessed by
3298 * the action group implementation) are found on subclasses. This is
3299 * why you will find - for example - g_action_group_get_action_enabled()
3300 * but not an equivalent <function>set()</function> call.
3302 * Signals are emitted on the action group in response to state changes
3303 * on individual actions.
3305 * Implementations of #GActionGroup should provide implementations for
3306 * the virtual functions g_action_group_list_actions() and
3307 * g_action_group_query_action(). The other virtual functions should
3308 * not be implemented - their "wrappers" are actually implemented with
3309 * calls to g_action_group_query_action().
3314 * SECTION:gactiongroupexporter
3315 * @title: GActionGroup exporter
3316 * @short_description: Export GActionGroups on D-Bus
3317 * @see_also: #GActionGroup, #GDBusActionGroup
3319 * These functions support exporting a #GActionGroup on D-Bus.
3320 * The D-Bus interface that is used is a private implementation
3323 * To access an exported #GActionGroup remotely, use
3324 * g_dbus_action_group_get() to obtain a #GDBusActionGroup.
3329 * SECTION:gactionmap
3330 * @title: GActionMap
3331 * @short_description: Interface for action containers
3333 * The GActionMap interface is implemented by #GActionGroup
3334 * implementations that operate by containing a number of
3335 * named #GAction instances, such as #GSimpleActionGroup.
3337 * One useful application of this interface is to map the
3338 * names of actions from various action groups to unique,
3339 * prefixed names (e.g. by prepending "app." or "win.").
3340 * This is the motivation for the 'Map' part of the interface
3349 * @short_description: Application information and launch contexts
3350 * @include: gio/gio.h
3352 * #GAppInfo and #GAppLaunchContext are used for describing and launching
3353 * applications installed on the system.
3355 * As of GLib 2.20, URIs will always be converted to POSIX paths
3356 * (using g_file_get_path()) when using g_app_info_launch() even if
3357 * the application requested an URI and not a POSIX path. For example
3358 * for an desktop-file based application with Exec key <literal>totem
3359 * %U</literal> and a single URI,
3360 * <literal>sftp://foo/file.avi</literal>, then
3361 * <literal>/home/user/.gvfs/sftp on foo/file.avi</literal> will be
3362 * passed. This will only work if a set of suitable GIO extensions
3363 * (such as gvfs 2.26 compiled with FUSE support), is available and
3364 * operational; if this is not the case, the URI will be passed
3365 * unmodified to the application. Some URIs, such as
3366 * <literal>mailto:</literal>, of course cannot be mapped to a POSIX
3367 * path (in gvfs there's no FUSE mount for it); such URIs will be
3368 * passed unmodified to the application.
3370 * Specifically for gvfs 2.26 and later, the POSIX URI will be mapped
3371 * back to the GIO URI in the #GFile constructors (since gvfs
3372 * implements the #GVfs extension point). As such, if the application
3373 * needs to examine the URI, it needs to use g_file_get_uri() or
3374 * similar on #GFile. In other words, an application cannot assume
3375 * that the URI passed to e.g. g_file_new_for_commandline_arg() is
3376 * equal to the result of g_file_get_uri(). The following snippet
3383 * file = g_file_new_for_commandline_arg (uri_from_commandline);
3385 * uri = g_file_get_uri (file);
3386 * strcmp (uri, uri_from_commandline) == 0; // FALSE
3389 * if (g_file_has_uri_scheme (file, "cdda"))
3391 * // do something special with uri
3393 * g_object_unref (file);
3396 * This code will work when both <literal>cdda://sr0/Track
3397 * 1.wav</literal> and <literal>/home/user/.gvfs/cdda on sr0/Track
3398 * 1.wav</literal> is passed to the application. It should be noted
3399 * that it's generally not safe for applications to rely on the format
3400 * of a particular URIs. Different launcher applications (e.g. file
3401 * managers) may have different ideas of what a given URI means.
3406 * SECTION:gapplication
3407 * @title: GApplication
3408 * @short_description: Core application class
3410 * A #GApplication is the foundation of an application. It wraps some
3411 * low-level platform-specific services and is intended to act as the
3412 * foundation for higher-level application classes such as
3413 * #GtkApplication or #MxApplication. In general, you should not use
3414 * this class outside of a higher level framework.
3416 * GApplication provides convenient life cycle management by maintaining
3417 * a <firstterm>use count</firstterm> for the primary application instance.
3418 * The use count can be changed using g_application_hold() and
3419 * g_application_release(). If it drops to zero, the application exits.
3420 * Higher-level classes such as #GtkApplication employ the use count to
3421 * ensure that the application stays alive as long as it has any opened
3424 * Another feature that GApplication (optionally) provides is process
3425 * uniqueness. Applications can make use of this functionality by
3426 * providing a unique application ID. If given, only one application
3427 * with this ID can be running at a time per session. The session
3428 * concept is platform-dependent, but corresponds roughly to a graphical
3429 * desktop login. When your application is launched again, its
3430 * arguments are passed through platform communication to the already
3431 * running program. The already running instance of the program is
3432 * called the <firstterm>primary instance</firstterm>; for non-unique
3433 * applications this is the always the current instance.
3434 * On Linux, the D-Bus session bus is used for communication.
3436 * If used, the expected form of an application identifier is very close
3438 * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-interface">DBus bus name</ulink>.
3439 * Examples include: "com.example.MyApp", "org.example.internal-apps.Calculator".
3440 * For details on valid application identifiers, see g_application_id_is_valid().
3442 * On Linux, the application identifier is claimed as a well-known bus name
3443 * on the user's session bus. This means that the uniqueness of your
3444 * application is scoped to the current session. It also means that your
3445 * application may provide additional services (through registration of other
3446 * object paths) at that bus name. The registration of these object paths
3447 * should be done with the shared GDBus session bus. Note that due to the
3448 * internal architecture of GDBus, method calls can be dispatched at any time
3449 * (even if a main loop is not running). For this reason, you must ensure that
3450 * any object paths that you wish to register are registered before #GApplication
3451 * attempts to acquire the bus name of your application (which happens in
3452 * g_application_register()). Unfortunately, this means that you cannot use
3453 * g_application_get_is_remote() to decide if you want to register object paths.
3455 * GApplication also implements the #GActionGroup and #GActionMap
3456 * interfaces and lets you easily export actions by adding them with
3457 * g_action_map_add_action(). When invoking an action by calling
3458 * g_action_group_activate_action() on the application, it is always
3459 * invoked in the primary instance. The actions are also exported on
3460 * the session bus, and GIO provides the #GDBusActionGroup wrapper to
3461 * conveniently access them remotely. GIO provides a #GDBusMenuModel wrapper
3462 * for remote access to exported #GMenuModels.
3464 * There is a number of different entry points into a GApplication:
3466 * <listitem>via 'Activate' (i.e. just starting the application)</listitem>
3467 * <listitem>via 'Open' (i.e. opening some files)</listitem>
3468 * <listitem>by handling a command-line</listitem>
3469 * <listitem>via activating an action</listitem>
3471 * The #GApplication::startup signal lets you handle the application
3472 * initialization for all of these in a single place.
3474 * Regardless of which of these entry points is used to start the application,
3475 * GApplication passes some <firstterm id="platform-data">platform
3476 * data</firstterm> from the launching instance to the primary instance,
3477 * in the form of a #GVariant dictionary mapping strings to variants.
3478 * To use platform data, override the @before_emit or @after_emit virtual
3479 * functions in your #GApplication subclass. When dealing with
3480 * #GApplicationCommandLine objects, the platform data is directly
3481 * available via g_application_command_line_get_cwd(),
3482 * g_application_command_line_get_environ() and
3483 * g_application_command_line_get_platform_data().
3485 * As the name indicates, the platform data may vary depending on the
3486 * operating system, but it always includes the current directory (key
3487 * "cwd"), and optionally the environment (ie the set of environment
3488 * variables and their values) of the calling process (key "environ").
3489 * The environment is only added to the platform data if the
3490 * %G_APPLICATION_SEND_ENVIRONMENT flag is set. #GApplication subclasses
3491 * can add their own platform data by overriding the @add_platform_data
3492 * virtual function. For instance, #GtkApplication adds startup notification
3495 * To parse commandline arguments you may handle the
3496 * #GApplication::command-line signal or override the local_command_line()
3497 * vfunc, to parse them in either the primary instance or the local instance,
3500 * <example id="gapplication-example-open"><title>Opening files with a GApplication</title>
3502 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-open.c">
3503 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3508 * <example id="gapplication-example-actions"><title>A GApplication with actions</title>
3510 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-actions.c">
3511 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3516 * <example id="gapplication-example-menu"><title>A GApplication with menus</title>
3518 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-menu.c">
3519 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3524 * <example id="gapplication-example-dbushooks"><title>Using extra D-Bus hooks with a GApplication</title>
3526 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-dbushooks.c">
3527 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3535 * SECTION:gapplicationcommandline
3536 * @title: GApplicationCommandLine
3537 * @short_description: A command-line invocation of an application
3538 * @see_also: #GApplication
3540 * #GApplicationCommandLine represents a command-line invocation of
3541 * an application. It is created by #GApplication and emitted
3542 * in the #GApplication::command-line signal and virtual function.
3544 * The class contains the list of arguments that the program was invoked
3545 * with. It is also possible to query if the commandline invocation was
3546 * local (ie: the current process is running in direct response to the
3547 * invocation) or remote (ie: some other process forwarded the
3548 * commandline to this process).
3550 * The GApplicationCommandLine object can provide the @argc and @argv
3551 * parameters for use with the #GOptionContext command-line parsing API,
3552 * with the g_application_command_line_get_arguments() function. See
3553 * <xref linkend="gapplication-example-cmdline3"/> for an example.
3555 * The exit status of the originally-invoked process may be set and
3556 * messages can be printed to stdout or stderr of that process. The
3557 * lifecycle of the originally-invoked process is tied to the lifecycle
3558 * of this object (ie: the process exits when the last reference is
3561 * The main use for #GApplicationCommandLine (and the
3562 * #GApplication::command-line signal) is 'Emacs server' like use cases:
3563 * You can set the <envar>EDITOR</envar> environment variable to have
3564 * e.g. git use your favourite editor to edit commit messages, and if you
3565 * already have an instance of the editor running, the editing will happen
3566 * in the running instance, instead of opening a new one. An important
3567 * aspect of this use case is that the process that gets started by git
3568 * does not return until the editing is done.
3570 * <example id="gapplication-example-cmdline"><title>Handling commandline arguments with GApplication</title>
3572 * A simple example where the commandline is completely handled
3573 * in the #GApplication::command-line handler. The launching instance exits
3574 * once the signal handler in the primary instance has returned, and the
3575 * return value of the signal handler becomes the exit status of the launching
3579 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline.c">
3580 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3585 * <example id="gapplication-example-cmdline2"><title>Split commandline handling</title>
3587 * An example of split commandline handling. Options that start with
3588 * <literal>--local-</literal> are handled locally, all other options are
3589 * passed to the #GApplication::command-line handler which runs in the primary
3593 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline2.c">
3594 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3599 * <example id="gapplication-example-cmdline3"><title>Deferred commandline handling</title>
3601 * An example of deferred commandline handling. Here, the commandline is
3602 * not completely handled before the #GApplication::command-line handler
3603 * returns. Instead, we keep a reference to the GApplicationCommandLine
3604 * object and handle it later(in this example, in an idle). Note that it
3605 * is necessary to hold the application until you are done with the
3609 * This example also shows how to use #GOptionContext for parsing the
3610 * commandline arguments. Note that it is necessary to disable the
3611 * built-in help-handling of #GOptionContext, since it calls exit()
3612 * after printing help, which is not what you want to happen in
3613 * the primary instance.
3616 * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline3.c">
3617 * <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3625 * SECTION:gasyncinitable
3626 * @short_description: Asynchronously failable object initialization interface
3627 * @include: gio/gio.h
3628 * @see_also: #GInitable
3630 * This is the asynchronous version of #GInitable; it behaves the same
3631 * in all ways except that initialization is asynchronous. For more details
3632 * see the descriptions on #GInitable.
3634 * A class may implement both the #GInitable and #GAsyncInitable interfaces.
3636 * Users of objects implementing this are not intended to use the interface
3637 * method directly; instead it will be used automatically in various ways.
3638 * For C applications you generally just call g_async_initable_new_async()
3639 * directly, or indirectly via a foo_thing_new_async() wrapper. This will call
3640 * g_async_initable_init_async() under the cover, calling back with %NULL and
3641 * a set %GError on failure.
3643 * A typical implementation might look something like this:
3653 * _foo_ready_cb (Foo *self)
3657 * self->priv->state = INITIALIZED;
3659 * for (l = self->priv->init_results; l != NULL; l = l->next)
3661 * GSimpleAsyncResult *simple = l->data;
3663 * if (!self->priv->success)
3664 * g_simple_async_result_set_error (simple, ...);
3666 * g_simple_async_result_complete (simple);
3667 * g_object_unref (simple);
3670 * g_list_free (self->priv->init_results);
3671 * self->priv->init_results = NULL;
3675 * foo_init_async (GAsyncInitable *initable,
3677 * GCancellable *cancellable,
3678 * GAsyncReadyCallback callback,
3679 * gpointer user_data)
3681 * Foo *self = FOO (initable);
3682 * GSimpleAsyncResult *simple;
3684 * simple = g_simple_async_result_new (G_OBJECT (initable)
3689 * switch (self->priv->state)
3691 * case NOT_INITIALIZED:
3692 * _foo_get_ready (self);
3693 * self->priv->init_results = g_list_append (self->priv->init_results,
3695 * self->priv->state = INITIALIZING;
3697 * case INITIALIZING:
3698 * self->priv->init_results = g_list_append (self->priv->init_results,
3702 * if (!self->priv->success)
3703 * g_simple_async_result_set_error (simple, ...);
3705 * g_simple_async_result_complete_in_idle (simple);
3706 * g_object_unref (simple);
3712 * foo_init_finish (GAsyncInitable *initable,
3713 * GAsyncResult *result,
3716 * g_return_val_if_fail (g_simple_async_result_is_valid (result,
3717 * G_OBJECT (initable), foo_init_async), FALSE);
3719 * if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result),
3727 * foo_async_initable_iface_init (gpointer g_iface,
3730 * GAsyncInitableIface *iface = g_iface;
3732 * iface->init_async = foo_init_async;
3733 * iface->init_finish = foo_init_finish;
3740 * SECTION:gasyncresult
3741 * @short_description: Asynchronous Function Results
3742 * @include: gio/gio.h
3743 * @see_also: #GSimpleAsyncResult
3745 * Provides a base class for implementing asynchronous function results.
3747 * Asynchronous operations are broken up into two separate operations
3748 * which are chained together by a #GAsyncReadyCallback. To begin
3749 * an asynchronous operation, provide a #GAsyncReadyCallback to the
3750 * asynchronous function. This callback will be triggered when the
3751 * operation has completed, and will be passed a #GAsyncResult instance
3752 * filled with the details of the operation's success or failure, the
3753 * object the asynchronous function was started for and any error codes
3754 * returned. The asynchronous callback function is then expected to call
3755 * the corresponding "_finish()" function, passing the object the
3756 * function was called for, the #GAsyncResult instance, and (optionally)
3757 * an @error to grab any error conditions that may have occurred.
3759 * The "_finish()" function for an operation takes the generic result
3760 * (of type #GAsyncResult) and returns the specific result that the
3761 * operation in question yields (e.g. a #GFileEnumerator for a
3762 * "enumerate children" operation). If the result or error status of the
3763 * operation is not needed, there is no need to call the "_finish()"
3764 * function; GIO will take care of cleaning up the result and error
3765 * information after the #GAsyncReadyCallback returns. You can pass
3766 * %NULL for the #GAsyncReadyCallback if you don't need to take any
3767 * action at all after the operation completes. Applications may also
3768 * take a reference to the #GAsyncResult and call "_finish()" later;
3769 * however, the "_finish()" function may be called at most once.
3771 * Example of a typical asynchronous operation flow:
3773 * void _theoretical_frobnitz_async (Theoretical *t,
3775 * GAsyncReadyCallback *cb,
3778 * gboolean _theoretical_frobnitz_finish (Theoretical *t,
3779 * GAsyncResult *res,
3783 * frobnitz_result_func (GObject *source_object,
3784 * GAsyncResult *res,
3785 * gpointer user_data)
3787 * gboolean success = FALSE;
3789 * success = _theoretical_frobnitz_finish (source_object, res, NULL);
3792 * g_printf ("Hurray!\n");
3794 * g_printf ("Uh oh!\n");
3796 * /<!-- -->* ... *<!-- -->/
3800 * int main (int argc, void *argv[])
3802 * /<!-- -->* ... *<!-- -->/
3804 * _theoretical_frobnitz_async (theoretical_data,
3806 * frobnitz_result_func,
3809 * /<!-- -->* ... *<!-- -->/
3813 * The callback for an asynchronous operation is called only once, and is
3814 * always called, even in the case of a cancelled operation. On cancellation
3815 * the result is a %G_IO_ERROR_CANCELLED error.
3820 * SECTION:gbufferedinputstream
3821 * @short_description: Buffered Input Stream
3822 * @include: gio/gio.h
3823 * @see_also: #GFilterInputStream, #GInputStream
3825 * Buffered input stream implements #GFilterInputStream and provides
3826 * for buffered reads.
3828 * By default, #GBufferedInputStream's buffer size is set at 4 kilobytes.
3830 * To create a buffered input stream, use g_buffered_input_stream_new(),
3831 * or g_buffered_input_stream_new_sized() to specify the buffer's size at
3834 * To get the size of a buffer within a buffered input stream, use
3835 * g_buffered_input_stream_get_buffer_size(). To change the size of a
3836 * buffered input stream's buffer, use
3837 * g_buffered_input_stream_set_buffer_size(). Note that the buffer's size
3838 * cannot be reduced below the size of the data within the buffer.
3843 * SECTION:gbufferedoutputstream
3844 * @short_description: Buffered Output Stream
3845 * @include: gio/gio.h
3846 * @see_also: #GFilterOutputStream, #GOutputStream
3848 * Buffered output stream implements #GFilterOutputStream and provides
3849 * for buffered writes.
3851 * By default, #GBufferedOutputStream's buffer size is set at 4 kilobytes.
3853 * To create a buffered output stream, use g_buffered_output_stream_new(),
3854 * or g_buffered_output_stream_new_sized() to specify the buffer's size
3857 * To get the size of a buffer within a buffered input stream, use
3858 * g_buffered_output_stream_get_buffer_size(). To change the size of a
3859 * buffered output stream's buffer, use
3860 * g_buffered_output_stream_set_buffer_size(). Note that the buffer's
3861 * size cannot be reduced below the size of the data within the buffer.
3866 * SECTION:gcancellable
3867 * @short_description: Thread-safe Operation Cancellation Stack
3868 * @include: gio/gio.h
3870 * GCancellable is a thread-safe operation cancellation stack used
3871 * throughout GIO to allow for cancellation of synchronous and
3872 * asynchronous operations.
3877 * SECTION:gcharsetconverter
3878 * @short_description: Convert between charsets
3879 * @include: gio/gio.h
3881 * #GCharsetConverter is an implementation of #GConverter based on
3887 * SECTION:gcontenttype
3888 * @short_description: Platform-specific content typing
3889 * @include: gio/gio.h
3891 * A content type is a platform specific string that defines the type
3892 * 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".
3893 * On Win32 it is an extension string like ".doc", ".txt" or a perceived
3894 * string like "audio". Such strings can be looked up in the registry at
3895 * HKEY_CLASSES_ROOT.
3900 * SECTION:gconverter
3901 * @short_description: Data conversion interface
3902 * @include: gio/gio.h
3903 * @see_also: #GInputStream, #GOutputStream
3905 * #GConverter is implemented by objects that convert
3906 * binary data in various ways. The conversion can be
3907 * stateful and may fail at any place.
3909 * Some example conversions are: character set conversion,
3910 * compression, decompression and regular expression
3918 * SECTION:gconverterinputstream
3919 * @short_description: Converter Input Stream
3920 * @include: gio/gio.h
3921 * @see_also: #GInputStream, #GConverter
3923 * Converter input stream implements #GInputStream and allows
3924 * conversion of data of various types during reading.
3926 * As of GLib 2.34, #GConverterInputStream implements
3927 * #GPollableInputStream.
3932 * SECTION:gconverteroutputstream
3933 * @short_description: Converter Output Stream
3934 * @include: gio/gio.h
3935 * @see_also: #GOutputStream, #GConverter
3937 * Converter output stream implements #GOutputStream and allows
3938 * conversion of data of various types during reading.
3940 * As of GLib 2.34, #GConverterOutputStream implements
3941 * #GPollableOutputStream.
3946 * SECTION:gcredentials
3947 * @short_description: An object containing credentials
3948 * @include: gio/gio.h
3950 * The #GCredentials type is a reference-counted wrapper for native
3951 * credentials. This information is typically used for identifying,
3952 * authenticating and authorizing other processes.
3954 * Some operating systems supports looking up the credentials of the
3955 * remote peer of a communication endpoint - see e.g.
3956 * g_socket_get_credentials().
3958 * Some operating systems supports securely sending and receiving
3959 * credentials over a Unix Domain Socket, see
3960 * #GUnixCredentialsMessage, g_unix_connection_send_credentials() and
3961 * g_unix_connection_receive_credentials() for details.
3963 * On Linux, the native credential type is a <type>struct ucred</type>
3965 * <citerefentry><refentrytitle>unix</refentrytitle><manvolnum>7</manvolnum></citerefentry>
3966 * man page for details. This corresponds to
3967 * %G_CREDENTIALS_TYPE_LINUX_UCRED.
3969 * On FreeBSD, the native credential type is a <type>struct cmsgcred</type>.
3970 * This corresponds to %G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED.
3972 * On OpenBSD, the native credential type is a <type>struct sockpeercred</type>.
3973 * This corresponds to %G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED.
3978 * SECTION:gdatainputstream
3979 * @short_description: Data Input Stream
3980 * @include: gio/gio.h
3981 * @see_also: #GInputStream
3983 * Data input stream implements #GInputStream and includes functions for
3984 * reading structured data directly from a binary input stream.
3989 * SECTION:gdataoutputstream
3990 * @short_description: Data Output Stream
3991 * @include: gio/gio.h
3992 * @see_also: #GOutputStream
3994 * Data output stream implements #GOutputStream and includes functions for
3995 * writing data directly to an output stream.
4000 * SECTION:gdbusactiongroup
4001 * @title: GDBusActionGroup
4002 * @short_description: A D-Bus GActionGroup implementation
4003 * @see_also: <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
4005 * #GDBusActionGroup is an implementation of the #GActionGroup
4006 * interface that can be used as a proxy for an action group
4007 * that is exported over D-Bus with g_dbus_connection_export_action_group().
4012 * SECTION:gdbusaddress
4013 * @title: D-Bus Addresses
4014 * @short_description: D-Bus connection endpoints
4015 * @include: gio/gio.h
4017 * Routines for working with D-Bus addresses. A D-Bus address is a string
4018 * like "unix:tmpdir=/tmp/my-app-name". The exact format of addresses
4019 * is explained in detail in the <link linkend="http://dbus.freedesktop.org/doc/dbus-specification.html#addresses">D-Bus specification</link>.
4024 * SECTION:gdbusauthobserver
4025 * @short_description: Object used for authenticating connections
4026 * @include: gio/gio.h
4028 * The #GDBusAuthObserver type provides a mechanism for participating
4029 * in how a #GDBusServer (or a #GDBusConnection) authenticates remote
4030 * peers. Simply instantiate a #GDBusAuthObserver and connect to the
4031 * signals you are interested in. Note that new signals may be added
4034 * For example, if you only want to allow D-Bus connections from
4035 * processes owned by the same uid as the server, you would use a
4036 * signal handler like the following:
4037 * <example id="auth-observer"><title>Controlling Authentication</title><programlisting>
4039 * on_authorize_authenticated_peer (GDBusAuthObserver *observer,
4040 * GIOStream *stream,
4041 * GCredentials *credentials,
4042 * gpointer user_data)
4044 * gboolean authorized;
4046 * authorized = FALSE;
4047 * if (credentials != NULL)
4049 * GCredentials *own_credentials;
4050 * own_credentials = g_credentials_new ();
4051 * if (g_credentials_is_same_user (credentials, own_credentials, NULL))
4052 * authorized = TRUE;
4053 * g_object_unref (own_credentials);
4056 * return authorized;
4058 * </programlisting></example>
4063 * SECTION:gdbusconnection
4064 * @short_description: D-Bus Connections
4065 * @include: gio/gio.h
4067 * The #GDBusConnection type is used for D-Bus connections to remote
4068 * peers such as a message buses. It is a low-level API that offers a
4069 * lot of flexibility. For instance, it lets you establish a connection
4070 * over any transport that can by represented as an #GIOStream.
4072 * This class is rarely used directly in D-Bus clients. If you are writing
4073 * an D-Bus client, it is often easier to use the g_bus_own_name(),
4074 * g_bus_watch_name() or g_dbus_proxy_new_for_bus() APIs.
4076 * As an exception to the usual GLib rule that a particular object must not be
4077 * used by two threads at the same time, #GDBusConnection's methods may be
4078 * called from any thread<footnote>
4080 * This is so that g_bus_get() and g_bus_get_sync() can safely return the
4081 * same #GDBusConnection when called from any thread.
4085 * Most of the ways to obtain a #GDBusConnection automatically initialize it
4086 * (i.e. connect to D-Bus): for instance, g_dbus_connection_new() and
4087 * g_bus_get(), and the synchronous versions of those methods, give you an
4088 * initialized connection. Language bindings for GIO should use
4089 * g_initable_new() or g_async_initable_new_async(), which also initialize the
4092 * If you construct an uninitialized #GDBusConnection, such as via
4093 * g_object_new(), you must initialize it via g_initable_init() or
4094 * g_async_initable_init_async() before using its methods or properties.
4095 * Calling methods or accessing properties on a #GDBusConnection that has not
4096 * completed initialization successfully is considered to be invalid, and leads
4097 * to undefined behaviour. In particular, if initialization fails with a
4098 * #GError, the only valid thing you can do with that #GDBusConnection is to
4099 * free it with g_object_unref().
4101 * <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>
4103 * <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>
4105 * <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>
4107 * <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>
4112 * SECTION:gdbuserror
4113 * @title: GDBusError
4114 * @short_description: Mapping D-Bus errors to and from GError
4115 * @include: gio/gio.h
4117 * All facilities that return errors from remote methods (such as
4118 * g_dbus_connection_call_sync()) use #GError to represent both D-Bus
4119 * errors (e.g. errors returned from the other peer) and locally
4120 * in-process generated errors.
4122 * To check if a returned #GError is an error from a remote peer, use
4123 * g_dbus_error_is_remote_error(). To get the actual D-Bus error name,
4124 * use g_dbus_error_get_remote_error(). Before presenting an error,
4125 * always use g_dbus_error_strip_remote_error().
4127 * In addition, facilities used to return errors to a remote peer also
4128 * use #GError. See g_dbus_method_invocation_return_error() for
4129 * discussion about how the D-Bus error name is set.
4131 * Applications can associate a #GError error domain with a set of D-Bus errors in order to
4132 * automatically map from D-Bus errors to #GError and back. This
4133 * is typically done in the function returning the #GQuark for the
4135 * <example id="error-registration"><title>Error Registration</title><programlisting>
4136 * /<!-- -->* foo-bar-error.h: *<!-- -->/
4138 * #define FOO_BAR_ERROR (foo_bar_error_quark ())
4139 * GQuark foo_bar_error_quark (void);
4143 * FOO_BAR_ERROR_FAILED,
4144 * FOO_BAR_ERROR_ANOTHER_ERROR,
4145 * FOO_BAR_ERROR_SOME_THIRD_ERROR,
4148 * /<!-- -->* foo-bar-error.c: *<!-- -->/
4150 * static const GDBusErrorEntry foo_bar_error_entries[] =
4152 * {FOO_BAR_ERROR_FAILED, "org.project.Foo.Bar.Error.Failed"},
4153 * {FOO_BAR_ERROR_ANOTHER_ERROR, "org.project.Foo.Bar.Error.AnotherError"},
4154 * {FOO_BAR_ERROR_SOME_THIRD_ERROR, "org.project.Foo.Bar.Error.SomeThirdError"},
4158 * foo_bar_error_quark (void)
4160 * static volatile gsize quark_volatile = 0;
4161 * g_dbus_error_register_error_domain ("foo-bar-error-quark",
4163 * foo_bar_error_entries,
4164 * G_N_ELEMENTS (foo_bar_error_entries));
4165 * G_STATIC_ASSERT (G_N_ELEMENTS (foo_bar_error_entries) - 1 == FOO_BAR_ERROR_SOME_THIRD_ERROR);
4166 * return (GQuark) quark_volatile;
4168 * </programlisting></example>
4169 * With this setup, a D-Bus peer can transparently pass e.g. %FOO_BAR_ERROR_ANOTHER_ERROR and
4170 * other peers will see the D-Bus error name <literal>org.project.Foo.Bar.Error.AnotherError</literal>.
4171 * If the other peer is using GDBus, the peer will see also %FOO_BAR_ERROR_ANOTHER_ERROR instead
4172 * of %G_IO_ERROR_DBUS_ERROR. Note that GDBus clients can still recover
4173 * <literal>org.project.Foo.Bar.Error.AnotherError</literal> using g_dbus_error_get_remote_error().
4175 * Note that errors in the %G_DBUS_ERROR error domain is intended only
4176 * for returning errors from a remote message bus process. Errors
4177 * generated locally in-process by e.g. #GDBusConnection is from the
4178 * %G_IO_ERROR domain.
4183 * SECTION:gdbusinterface
4184 * @short_description: Base type for D-Bus interfaces
4185 * @include: gio/gio.h
4187 * The #GDBusInterface type is the base type for D-Bus interfaces both
4188 * on the service side (see #GDBusInterfaceSkeleton) and client side
4189 * (see #GDBusProxy).
4194 * SECTION:gdbusinterfaceskeleton
4195 * @short_description: Service-side D-Bus interface
4196 * @include: gio/gio.h
4198 * Abstract base class for D-Bus interfaces on the service side.
4203 * SECTION:gdbusintrospection
4204 * @title: D-Bus Introspection Data
4205 * @short_description: Node and interface description data structures
4206 * @include: gio/gio.h
4208 * Various data structures and convenience routines to parse and
4209 * generate D-Bus introspection XML. Introspection information is
4210 * used when registering objects with g_dbus_connection_register_object().
4212 * The format of D-Bus introspection XML is specified in the
4213 * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format">D-Bus specification</ulink>.
4218 * SECTION:gdbusmenumodel
4219 * @title: GDBusMenuModel
4220 * @short_description: A D-Bus GMenuModel implementation
4221 * @see_also: <link linkend="gio-GMenuModel-exporter">GMenuModel Exporter</link>
4223 * #GDBusMenuModel is an implementation of #GMenuModel that can be used
4224 * as a proxy for a menu model that is exported over D-Bus with
4225 * g_dbus_connection_export_menu_model().
4230 * SECTION:gdbusmessage
4231 * @short_description: D-Bus Message
4232 * @include: gio/gio.h
4234 * A type for representing D-Bus messages that can be sent or received
4235 * on a #GDBusConnection.
4240 * SECTION:gdbusmethodinvocation
4241 * @short_description: Object for handling remote calls
4242 * @include: gio/gio.h
4244 * Instances of the #GDBusMethodInvocation class are used when
4245 * handling D-Bus method calls. It provides a way to asynchronously
4246 * return results and errors.
4248 * The normal way to obtain a #GDBusMethodInvocation object is to receive
4249 * it as an argument to the handle_method_call() function in a
4250 * #GDBusInterfaceVTable that was passed to g_dbus_connection_register_object().
4255 * SECTION:gdbusnameowning
4256 * @title: Owning Bus Names
4257 * @short_description: Simple API for owning bus names
4258 * @include: gio/gio.h
4260 * Convenience API for owning bus names.
4262 * <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>
4267 * SECTION:gdbusnamewatching
4268 * @title: Watching Bus Names
4269 * @short_description: Simple API for watching bus names
4270 * @include: gio/gio.h
4272 * Convenience API for watching bus names.
4274 * <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>
4279 * SECTION:gdbusobject
4280 * @short_description: Base type for D-Bus objects
4281 * @include: gio/gio.h
4283 * The #GDBusObject type is the base type for D-Bus objects on both
4284 * the service side (see #GDBusObjectSkeleton) and the client side
4285 * (see #GDBusObjectProxy). It is essentially just a container of
4291 * SECTION:gdbusobjectmanager
4292 * @short_description: Base type for D-Bus object managers
4293 * @include: gio/gio.h
4295 * The #GDBusObjectManager type is the base type for service- and
4296 * client-side implementations of the standardized <ulink
4297 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4300 * See #GDBusObjectManagerClient for the client-side implementation
4301 * and #GDBusObjectManagerServer for the service-side implementation.
4306 * SECTION:gdbusobjectmanagerclient
4307 * @short_description: Client-side object manager
4308 * @include: gio/gio.h
4310 * #GDBusObjectManagerClient is used to create, monitor and delete object
4311 * proxies for remote objects exported by a #GDBusObjectManagerServer (or any
4312 * code implementing the <ulink
4313 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4316 * Once an instance of this type has been created, you can connect to
4317 * the #GDBusObjectManager::object-added and
4318 * #GDBusObjectManager::object-removed signals and inspect the
4319 * #GDBusObjectProxy objects returned by
4320 * g_dbus_object_manager_get_objects().
4322 * If the name for a #GDBusObjectManagerClient is not owned by anyone at
4323 * object construction time, the default behavior is to request the
4324 * message bus to launch an owner for the name. This behavior can be
4325 * disabled using the %G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START
4326 * flag. It's also worth noting that this only works if the name of
4327 * interest is activatable in the first place. E.g. in some cases it
4328 * is not possible to launch an owner for the requested name. In this
4329 * case, #GDBusObjectManagerClient object construction still succeeds but
4330 * there will be no object proxies
4331 * (e.g. g_dbus_object_manager_get_objects() returns the empty list) and
4332 * the #GDBusObjectManagerClient:name-owner property is %NULL.
4334 * The owner of the requested name can come and go (for example
4335 * consider a system service being restarted) – #GDBusObjectManagerClient
4336 * handles this case too; simply connect to the #GObject::notify
4337 * signal to watch for changes on the #GDBusObjectManagerClient:name-owner
4338 * property. When the name owner vanishes, the behavior is that
4339 * #GDBusObjectManagerClient:name-owner is set to %NULL (this includes
4340 * emission of the #GObject::notify signal) and then
4341 * #GDBusObjectManager::object-removed signals are synthesized
4342 * for all currently existing object proxies. Since
4343 * #GDBusObjectManagerClient:name-owner is %NULL when this happens, you can
4344 * use this information to disambiguate a synthesized signal from a
4345 * genuine signal caused by object removal on the remote
4346 * #GDBusObjectManager. Similarly, when a new name owner appears,
4347 * #GDBusObjectManager::object-added signals are synthesized
4348 * while #GDBusObjectManagerClient:name-owner is still %NULL. Only when all
4349 * object proxies have been added, the #GDBusObjectManagerClient:name-owner
4350 * is set to the new name owner (this includes emission of the
4351 * #GObject::notify signal). Furthermore, you are guaranteed that
4352 * #GDBusObjectManagerClient:name-owner will alternate between a name owner
4353 * (e.g. <literal>:1.42</literal>) and %NULL even in the case where
4354 * the name of interest is atomically replaced
4356 * Ultimately, #GDBusObjectManagerClient is used to obtain #GDBusProxy
4357 * instances. All signals (including the
4358 * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
4359 * signal) delivered to #GDBusProxy instances are guaranteed to
4360 * originate from the name owner. This guarantee along with the
4361 * behavior described above, means that certain race conditions
4362 * including the <emphasis><quote>half the proxy is from the old owner
4363 * and the other half is from the new owner</quote></emphasis> problem
4366 * To avoid having the application connect to signals on the returned
4367 * #GDBusObjectProxy and #GDBusProxy objects, the
4368 * #GDBusObject::interface-added,
4369 * #GDBusObject::interface-removed,
4370 * #GDBusProxy::g-properties-changed and
4371 * #GDBusProxy::g-signal signals
4372 * are also emitted on the #GDBusObjectManagerClient instance managing these
4373 * objects. The signals emitted are
4374 * #GDBusObjectManager::interface-added,
4375 * #GDBusObjectManager::interface-removed,
4376 * #GDBusObjectManagerClient::interface-proxy-properties-changed and
4377 * #GDBusObjectManagerClient::interface-proxy-signal.
4379 * Note that all callbacks and signals are emitted in the
4380 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4381 * that the #GDBusObjectManagerClient object was constructed
4382 * in. Additionally, the #GDBusObjectProxy and #GDBusProxy objects
4383 * originating from the #GDBusObjectManagerClient object will be created in
4384 * the same context and, consequently, will deliver signals in the
4390 * SECTION:gdbusobjectmanagerserver
4391 * @short_description: Service-side object manager
4392 * @include: gio/gio.h
4394 * #GDBusObjectManagerServer is used to export #GDBusObject instances using
4395 * the standardized <ulink
4396 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4397 * interface. For example, remote D-Bus clients can get all objects
4398 * and properties in a single call. Additionally, any change in the
4399 * object hierarchy is broadcast using signals. This means that D-Bus
4400 * clients can keep caches up to date by only listening to D-Bus
4403 * See #GDBusObjectManagerClient for the client-side code that is
4404 * intended to be used with #GDBusObjectManagerServer or any D-Bus
4405 * object implementing the org.freedesktop.DBus.ObjectManager
4411 * SECTION:gdbusobjectproxy
4412 * @short_description: Client-side D-Bus object
4413 * @include: gio/gio.h
4415 * A #GDBusObjectProxy is an object used to represent a remote object
4416 * with one or more D-Bus interfaces. Normally, you don't instantiate
4417 * a #GDBusObjectProxy yourself - typically #GDBusObjectManagerClient
4418 * is used to obtain it.
4425 * SECTION:gdbusobjectskeleton
4426 * @short_description: Service-side D-Bus object
4427 * @include: gio/gio.h
4429 * A #GDBusObjectSkeleton instance is essentially a group of D-Bus
4430 * interfaces. The set of exported interfaces on the object may be
4431 * dynamic and change at runtime.
4433 * This type is intended to be used with #GDBusObjectManager.
4438 * SECTION:gdbusproxy
4439 * @short_description: Client-side D-Bus interface proxy
4440 * @include: gio/gio.h
4442 * #GDBusProxy is a base class used for proxies to access a D-Bus
4443 * interface on a remote object. A #GDBusProxy can be constructed for
4444 * both well-known and unique names.
4446 * By default, #GDBusProxy will cache all properties (and listen to
4447 * changes) of the remote object, and proxy all signals that gets
4448 * emitted. This behaviour can be changed by passing suitable
4449 * #GDBusProxyFlags when the proxy is created. If the proxy is for a
4450 * well-known name, the property cache is flushed when the name owner
4451 * vanishes and reloaded when a name owner appears.
4453 * If a #GDBusProxy is used for a well-known name, the owner of the
4454 * name is tracked and can be read from
4455 * #GDBusProxy:g-name-owner. Connect to the #GObject::notify signal to
4456 * get notified of changes. Additionally, only signals and property
4457 * changes emitted from the current name owner are considered and
4458 * calls are always sent to the current name owner. This avoids a
4459 * number of race conditions when the name is lost by one owner and
4460 * claimed by another. However, if no name owner currently exists,
4461 * then calls will be sent to the well-known name which may result in
4462 * the message bus launching an owner (unless
4463 * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START is set).
4465 * The generic #GDBusProxy::g-properties-changed and
4466 * #GDBusProxy::g-signal signals are not very convenient to work
4467 * with. Therefore, the recommended way of working with proxies is to
4468 * subclass #GDBusProxy, and have more natural properties and signals
4469 * in your derived class. See <xref linkend="gdbus-example-gdbus-codegen"/>
4470 * for how this can easily be done using the
4471 * <command><link linkend="gdbus-codegen">gdbus-codegen</link></command>
4474 * A #GDBusProxy instance can be used from multiple threads but note
4475 * that all signals (e.g. #GDBusProxy::g-signal, #GDBusProxy::g-properties-changed
4476 * and #GObject::notify) are emitted in the
4477 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4478 * of the thread where the instance was constructed.
4480 * <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>
4485 * SECTION:gdbusserver
4486 * @short_description: Helper for accepting connections
4487 * @include: gio/gio.h
4489 * #GDBusServer is a helper for listening to and accepting D-Bus
4490 * connections. This can be used to create a new D-Bus server, allowing two
4491 * peers to use the D-Bus protocol for their own specialized communication.
4492 * A server instance provided in this way will not perform message routing or
4493 * implement the org.freedesktop.DBus interface.
4495 * To just export an object on a well-known name on a message bus, such as the
4496 * session or system bus, you should instead use g_bus_own_name().
4498 * <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>
4503 * SECTION:gdbusutils
4504 * @title: D-Bus Utilities
4505 * @short_description: Various utilities related to D-Bus.
4506 * @include: gio/gio.h
4508 * Various utility routines related to D-Bus.
4513 * SECTION:gdesktopappinfo
4514 * @title: GDesktopAppInfo
4515 * @short_description: Application information from desktop files
4516 * @include: gio/gdesktopappinfo.h
4518 * #GDesktopAppInfo is an implementation of #GAppInfo based on
4521 * Note that <filename><gio/gdesktopappinfo.h></filename> belongs to
4522 * the UNIX-specific GIO interfaces, thus you have to use the
4523 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
4529 * @short_description: Drive management
4530 * @include: gio/gio.h
4532 * #GDrive - this represent a piece of hardware connected to the machine.
4533 * It's generally only created for removable hardware or hardware with
4536 * #GDrive is a container class for #GVolume objects that stem from
4537 * the same piece of media. As such, #GDrive abstracts a drive with
4538 * (or without) removable media and provides operations for querying
4539 * whether media is available, determing whether media change is
4540 * automatically detected and ejecting the media.
4542 * If the #GDrive reports that media isn't automatically detected, one
4543 * can poll for media; typically one should not do this periodically
4544 * as a poll for media operation is potententially expensive and may
4545 * spin up the drive creating noise.
4547 * #GDrive supports starting and stopping drives with authentication
4548 * support for the former. This can be used to support a diverse set
4549 * of use cases including connecting/disconnecting iSCSI devices,
4550 * powering down external disk enclosures and starting/stopping
4551 * multi-disk devices such as RAID devices. Note that the actual
4552 * semantics and side-effects of starting/stopping a #GDrive may vary
4553 * according to implementation. To choose the correct verbs in e.g. a
4554 * file manager, use g_drive_get_start_stop_type().
4556 * For porting from GnomeVFS note that there is no equivalent of
4557 * #GDrive in that API.
4563 * @short_description: An object for emblems
4564 * @include: gio/gio.h
4565 * @see_also: #GIcon, #GEmblemedIcon, #GLoadableIcon, #GThemedIcon
4567 * #GEmblem is an implementation of #GIcon that supports
4568 * having an emblem, which is an icon with additional properties.
4569 * It can than be added to a #GEmblemedIcon.
4571 * Currently, only metainformation about the emblem's origin is
4572 * supported. More may be added in the future.
4577 * SECTION:gemblemedicon
4578 * @short_description: Icon with emblems
4579 * @include: gio/gio.h
4580 * @see_also: #GIcon, #GLoadableIcon, #GThemedIcon, #GEmblem
4582 * #GEmblemedIcon is an implementation of #GIcon that supports
4583 * adding an emblem to an icon. Adding multiple emblems to an
4584 * icon is ensured via g_emblemed_icon_add_emblem().
4586 * Note that #GEmblemedIcon allows no control over the position
4587 * of the emblems. See also #GEmblem for more information.
4593 * @short_description: File and Directory Handling
4594 * @include: gio/gio.h
4595 * @see_also: #GFileInfo, #GFileEnumerator
4597 * #GFile is a high level abstraction for manipulating files on a
4598 * virtual file system. #GFile<!-- -->s are lightweight, immutable
4599 * objects that do no I/O upon creation. It is necessary to understand that
4600 * #GFile objects do not represent files, merely an identifier for a file. All
4601 * file content I/O is implemented as streaming operations (see #GInputStream and
4604 * To construct a #GFile, you can use:
4605 * g_file_new_for_path() if you have a path.
4606 * g_file_new_for_uri() if you have a URI.
4607 * g_file_new_for_commandline_arg() for a command line argument.
4608 * g_file_new_tmp() to create a temporary file from a template.
4609 * g_file_parse_name() from a utf8 string gotten from g_file_get_parse_name().
4611 * One way to think of a #GFile is as an abstraction of a pathname. For normal
4612 * files the system pathname is what is stored internally, but as #GFile<!-- -->s
4613 * are extensible it could also be something else that corresponds to a pathname
4614 * in a userspace implementation of a filesystem.
4616 * #GFile<!-- -->s make up hierarchies of directories and files that correspond to the
4617 * files on a filesystem. You can move through the file system with #GFile using
4618 * g_file_get_parent() to get an identifier for the parent directory, g_file_get_child()
4619 * to get a child within a directory, g_file_resolve_relative_path() to resolve a relative
4620 * path between two #GFile<!-- -->s. There can be multiple hierarchies, so you may not
4621 * end up at the same root if you repeatedly call g_file_get_parent() on two different
4624 * All #GFile<!-- -->s have a basename (get with g_file_get_basename()). These names
4625 * are byte strings that are used to identify the file on the filesystem (relative to
4626 * its parent directory) and there is no guarantees that they have any particular charset
4627 * encoding or even make any sense at all. If you want to use filenames in a user
4628 * interface you should use the display name that you can get by requesting the
4629 * %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with g_file_query_info().
4630 * This is guaranteed to be in utf8 and can be used in a user interface. But always
4631 * store the real basename or the #GFile to use to actually access the file, because
4632 * there is no way to go from a display name to the actual name.
4634 * Using #GFile as an identifier has the same weaknesses as using a path in that
4635 * there may be multiple aliases for the same file. For instance, hard or
4636 * soft links may cause two different #GFile<!-- -->s to refer to the same file.
4637 * Other possible causes for aliases are: case insensitive filesystems, short
4638 * and long names on Fat/NTFS, or bind mounts in Linux. If you want to check if
4639 * two #GFile<!-- -->s point to the same file you can query for the
4640 * %G_FILE_ATTRIBUTE_ID_FILE attribute. Note that #GFile does some trivial
4641 * canonicalization of pathnames passed in, so that trivial differences in the
4642 * path string used at creation (duplicated slashes, slash at end of path, "."
4643 * or ".." path segments, etc) does not create different #GFile<!-- -->s.
4645 * Many #GFile operations have both synchronous and asynchronous versions
4646 * to suit your application. Asynchronous versions of synchronous functions
4647 * simply have _async() appended to their function names. The asynchronous
4648 * I/O functions call a #GAsyncReadyCallback which is then used to finalize
4649 * the operation, producing a GAsyncResult which is then passed to the
4650 * function's matching _finish() operation.
4652 * Some #GFile operations do not have synchronous analogs, as they may
4653 * take a very long time to finish, and blocking may leave an application
4654 * unusable. Notable cases include:
4655 * g_file_mount_mountable() to mount a mountable file.
4656 * g_file_unmount_mountable_with_operation() to unmount a mountable file.
4657 * g_file_eject_mountable_with_operation() to eject a mountable file.
4659 * <para id="gfile-etag"><indexterm><primary>entity tag</primary></indexterm>
4660 * One notable feature of #GFile<!-- -->s are entity tags, or "etags" for
4661 * short. Entity tags are somewhat like a more abstract version of the
4662 * traditional mtime, and can be used to quickly determine if the file has
4663 * been modified from the version on the file system. See the HTTP 1.1
4664 * <ulink url="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">specification</ulink>
4665 * for HTTP Etag headers, which are a very similar concept.
4671 * SECTION:gfileattribute
4672 * @short_description: Key-Value Paired File Attributes
4673 * @include: gio/gio.h
4674 * @see_also: #GFile, #GFileInfo
4676 * File attributes in GIO consist of a list of key-value pairs.
4678 * Keys are strings that contain a key namespace and a key name, separated
4679 * by a colon, e.g. "namespace:keyname". Namespaces are included to sort
4680 * key-value pairs by namespaces for relevance. Keys can be retrived
4681 * using wildcards, e.g. "standard::*" will return all of the keys in the
4682 * "standard" namespace.
4684 * The list of possible attributes for a filesystem (pointed to by a #GFile) is
4685 * available as a #GFileAttributeInfoList. This list is queryable by key names
4686 * as indicated earlier.
4688 * Information is stored within the list in #GFileAttributeInfo structures.
4689 * The info structure can store different types, listed in the enum
4690 * #GFileAttributeType. Upon creation of a #GFileAttributeInfo, the type will
4691 * be set to %G_FILE_ATTRIBUTE_TYPE_INVALID.
4693 * Classes that implement #GFileIface will create a #GFileAttributeInfoList and
4694 * install default keys and values for their given file system, architecture,
4695 * and other possible implementation details (e.g., on a UNIX system, a file
4696 * attribute key will be registered for the user id for a given file).
4700 * <title>GFileAttributes Default Namespaces</title>
4701 * <tgroup cols='2' align='left'><thead>
4702 * <row><entry>Namspace</entry><entry>Description</entry></row>
4705 * <row><entry>"standard"</entry><entry>The "Standard" namespace. General file
4706 * information that any application may need should be put in this namespace.
4707 * Examples include the file's name, type, and size.</entry></row>
4708 * <row><entry>"etag"</entry><entry>The <link linkend="gfile-etag">"Entity Tag"</link>
4709 * namespace. Currently, the only key in this namespace is "value", which contains
4710 * the value of the current entity tag.</entry></row>
4711 * <row><entry>"id"</entry><entry>The "Identification" namespace. This
4712 * namespace is used by file managers and applications that list directories
4713 * to check for loops and to uniquely identify files.</entry></row>
4714 * <row><entry>"access"</entry><entry>The "Access" namespace. Used to check
4715 * if a user has the proper privilidges to access files and perform
4716 * file operations. Keys in this namespace are made to be generic
4717 * and easily understood, e.g. the "can_read" key is %TRUE if
4718 * the current user has permission to read the file. UNIX permissions and
4719 * NTFS ACLs in Windows should be mapped to these values.</entry></row>
4720 * <row><entry>"mountable"</entry><entry>The "Mountable" namespace. Includes
4721 * simple boolean keys for checking if a file or path supports mount operations, e.g.
4722 * mount, unmount, eject. These are used for files of type %G_FILE_TYPE_MOUNTABLE.</entry></row>
4723 * <row><entry>"time"</entry><entry>The "Time" namespace. Includes file
4724 * access, changed, created times. </entry></row>
4725 * <row><entry>"unix"</entry><entry>The "Unix" namespace. Includes UNIX-specific
4726 * information and may not be available for all files. Examples include
4727 * the UNIX "UID", "GID", etc.</entry></row>
4728 * <row><entry>"dos"</entry><entry>The "DOS" namespace. Includes DOS-specific
4729 * information and may not be available for all files. Examples include
4730 * "is_system" for checking if a file is marked as a system file, and "is_archive"
4731 * for checking if a file is marked as an archive file.</entry></row>
4732 * <row><entry>"owner"</entry><entry>The "Owner" namespace. Includes information
4733 * about who owns a file. May not be available for all file systems. Examples include
4734 * "user" for getting the user name of the file owner. This information is often mapped from
4735 * some backend specific data such as a unix UID.</entry></row>
4736 * <row><entry>"thumbnail"</entry><entry>The "Thumbnail" namespace. Includes
4737 * information about file thumbnails and their location within the file system. Examples of
4738 * keys in this namespace include "path" to get the location of a thumbnail, and "failed"
4739 * to check if thumbnailing of the file failed.</entry></row>
4740 * <row><entry>"filesystem"</entry><entry>The "Filesystem" namespace. Gets information
4741 * about the file system where a file is located, such as its type, how much
4742 * space is left available, and the overall size of the file system.</entry></row>
4743 * <row><entry>"gvfs"</entry><entry>The "GVFS" namespace. Keys in this namespace
4744 * contain information about the current GVFS backend in use. </entry></row>
4745 * <row><entry>"xattr"</entry><entry>The "xattr" namespace. Gets information
4746 * about extended user attributes. See attr(5). The "user." prefix of the
4747 * extended user attribute name is stripped away when constructing keys in
4748 * this namespace, e.g. "xattr::mime_type" for the extended attribute with
4749 * the name "user.mime_type". Note that this information is only available
4750 * if GLib has been built with extended attribute support.</entry></row>
4751 * <row><entry>"xattr-sys"</entry><entry>The "xattr-sys" namespace.
4752 * Gets information about extended attributes which are not user-specific.
4753 * See attr(5). Note that this information is only available if GLib
4754 * has been built with extended attribute support.</entry></row>
4755 * <row><entry>"selinux"</entry><entry>The "SELinux" namespace. Includes
4756 * information about the SELinux context of files. Note that this information
4757 * is only available if GLib has been built with SELinux support.</entry></row>
4763 * Please note that these are not all of the possible namespaces.
4764 * More namespaces can be added from GIO modules or by individual applications.
4765 * For more information about writing GIO modules, see #GIOModule.
4767 * <!-- TODO: Implementation note about using extended attributes on supported
4771 * <title>GFileAttributes Built-in Keys and Value Types</title>
4772 * <tgroup cols='3' align='left'><thead>
4773 * <row><entry>Enum Value</entry><entry>Namespace:Key</entry><entry>Value Type</entry></row>
4775 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TYPE</entry><entry>standard::type</entry><entry>uint32 (#GFileType)</entry></row>
4776 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN</entry><entry>standard::is-hidden</entry><entry>boolean</entry></row>
4777 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP</entry><entry>standard::is-backup</entry><entry>boolean</entry></row>
4778 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK</entry><entry>standard::is-symlink</entry><entry>boolean</entry></row>
4779 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL</entry><entry>standard::is-virtual</entry><entry>boolean</entry></row>
4780 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_NAME</entry><entry>standard::name</entry><entry>byte string</entry></row>
4781 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME</entry><entry>standard::display-name</entry><entry>string</entry></row>
4782 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME</entry><entry>standard::edit-name</entry><entry>string</entry></row>
4783 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ICON</entry><entry>standard::icon</entry><entry>object (#GIcon)</entry></row>
4784 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE</entry><entry>standard::content-type</entry><entry>string</entry></row>
4785 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE</entry><entry>standard::fast-content-type</entry><entry>string</entry></row>
4786 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SIZE</entry><entry>standard::size</entry><entry>uint64</entry></row>
4787 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE</entry><entry>standard::allocated-size</entry><entry>uint64</entry></row>
4788 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET</entry><entry>standard::symlink-target</entry><entry>byte string</entry></row>
4789 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TARGET_URI</entry><entry>standard::target-uri</entry><entry>string</entry></row>
4790 * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER</entry><entry>standard::sort-order</entry><entry>int32</entry></row>
4791 * <row><entry>%G_FILE_ATTRIBUTE_ETAG_VALUE</entry><entry>etag::value</entry><entry>string</entry></row>
4792 * <row><entry>%G_FILE_ATTRIBUTE_ID_FILE</entry><entry>id::file</entry><entry>string</entry></row>
4793 * <row><entry>%G_FILE_ATTRIBUTE_ID_FILESYSTEM</entry><entry>id::filesystem</entry><entry>string</entry></row>
4794 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_READ</entry><entry>access::can-read</entry><entry>boolean</entry></row>
4795 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE</entry><entry>access::can-write</entry><entry>boolean</entry></row>
4796 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE</entry><entry>access::can-execute</entry><entry>boolean</entry></row>
4797 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE</entry><entry>access::can-delete</entry><entry>boolean</entry></row>
4798 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH</entry><entry>access::can-trash</entry><entry>boolean</entry></row>
4799 * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME</entry><entry>access::can-rename</entry><entry>boolean</entry></row>
4800 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT</entry><entry>mountable::can-mount</entry><entry>boolean</entry></row>
4801 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT</entry><entry>mountable::can-unmount</entry><entry>boolean</entry></row>
4802 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT</entry><entry>mountable::can-eject</entry><entry>boolean</entry></row>
4803 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE</entry><entry>mountable::unix-device</entry><entry>uint32</entry></row>
4804 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE</entry><entry>mountable::unix-device-file</entry><entry>string</entry></row>
4805 * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI</entry><entry>mountable::hal-udi</entry><entry>string</entry></row>
4806 * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED</entry><entry>time::modified</entry><entry>uint64</entry></row>
4807 * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC</entry><entry>time::modified-usec</entry><entry>uint32</entry></row>
4808 * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS</entry><entry>time::access</entry><entry>uint64</entry></row>
4809 * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS_USEC</entry><entry>time::access-usec</entry><entry>uint32</entry></row>
4810 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED</entry><entry>time::changed</entry><entry>uint64</entry></row>
4811 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED_USEC</entry><entry>time::changed-usec</entry><entry>uint32</entry></row>
4812 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED</entry><entry>time::created</entry><entry>uint64</entry></row>
4813 * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED_USEC</entry><entry>time::created-usec</entry><entry>uint32</entry></row>
4814 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_DEVICE</entry><entry>unix::device</entry><entry>uint32</entry></row>
4815 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_INODE</entry><entry>unix::inode</entry><entry>uint64</entry></row>
4816 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_MODE</entry><entry>unix::mode</entry><entry>uint32</entry></row>
4817 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_NLINK</entry><entry>unix::nlink</entry><entry>uint32</entry></row>
4818 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_UID</entry><entry>unix::uid</entry><entry>uint32</entry></row>
4819 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_GID</entry><entry>unix::gid</entry><entry>uint32</entry></row>
4820 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_RDEV</entry><entry>unix::rdev</entry><entry>uint32</entry></row>
4821 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE</entry><entry>unix::block-size</entry><entry>uint32</entry></row>
4822 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCKS</entry><entry>unix::blocks</entry><entry>uint64</entry></row>
4823 * <row><entry>%G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT</entry><entry>unix::is-mountpoint</entry><entry>boolean</entry></row>
4824 * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE</entry><entry>dos::is-archive</entry><entry>boolean</entry></row>
4825 * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_SYSTEM</entry><entry>dos::is-system</entry><entry>boolean</entry></row>
4826 * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER</entry><entry>owner::user</entry><entry>string</entry></row>
4827 * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER_REAL</entry><entry>owner::user-real</entry><entry>string</entry></row>
4828 * <row><entry>%G_FILE_ATTRIBUTE_OWNER_GROUP</entry><entry>owner::group</entry><entry>string</entry></row>
4829 * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAIL_PATH</entry><entry>thumbnail::path</entry><entry>bytestring</entry></row>
4830 * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAILING_FAILED</entry><entry>thumbnail::failed</entry><entry>boolean</entry></row>
4831 * <row><entry>%G_FILE_ATTRIBUTE_PREVIEW_ICON</entry><entry>preview::icon</entry><entry>object (#GIcon)</entry></row>
4832 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_SIZE</entry><entry>filesystem::size</entry><entry>uint64</entry></row>
4833 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_FREE</entry><entry>filesystem::free</entry><entry>uint64</entry></row>
4834 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_USED</entry><entry>filesystem::used</entry><entry>uint64</entry></row>
4835 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_TYPE</entry><entry>filesystem::type</entry><entry>string</entry></row>
4836 * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_READONLY</entry><entry>filesystem::readonly</entry><entry>boolean</entry></row>
4837 * <row><entry>%G_FILE_ATTRIBUTE_GVFS_BACKEND</entry><entry>gvfs::backend</entry><entry>string</entry></row>
4838 * <row><entry>%G_FILE_ATTRIBUTE_SELINUX_CONTEXT</entry><entry>selinux::context</entry><entry>string</entry></row>
4839 * </tbody></tgroup></table></para>
4841 * Note that there are no predefined keys in the "xattr" and "xattr-sys"
4842 * namespaces. Keys for the "xattr" namespace are constructed by stripping
4843 * away the "user." prefix from the extended user attribute, and prepending
4844 * "xattr::". Keys for the "xattr-sys" namespace are constructed by
4845 * concatenating "xattr-sys::" with the extended attribute name. All extended
4846 * attribute values are returned as hex-encoded strings in which bytes outside
4847 * the ASCII range are encoded as hexadecimal escape sequences of the form
4848 * \x<replaceable>nn</replaceable>.
4853 * SECTION:gfiledescriptorbased
4854 * @short_description: Interface for file descriptor based IO
4855 * @include: gio/gfiledescriptorbased.h
4856 * @see_also: #GInputStream, #GOutputStream
4858 * #GFileDescriptorBased is implemented by streams (implementations of
4859 * #GInputStream or #GOutputStream) that are based on file descriptors.
4861 * Note that <filename><gio/gfiledescriptorbased.h></filename> belongs to
4862 * the UNIX-specific GIO interfaces, thus you have to use the
4863 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
4870 * SECTION:gfileenumerator
4871 * @short_description: Enumerated Files Routines
4872 * @include: gio/gio.h
4874 * #GFileEnumerator allows you to operate on a set of #GFile<!-- -->s,
4875 * returning a #GFileInfo structure for each file enumerated (e.g.
4876 * g_file_enumerate_children() will return a #GFileEnumerator for each
4877 * of the children within a directory).
4879 * To get the next file's information from a #GFileEnumerator, use
4880 * g_file_enumerator_next_file() or its asynchronous version,
4881 * g_file_enumerator_next_files_async(). Note that the asynchronous
4882 * version will return a list of #GFileInfo<!---->s, whereas the
4883 * synchronous will only return the next file in the enumerator.
4885 * To close a #GFileEnumerator, use g_file_enumerator_close(), or
4886 * its asynchronous version, g_file_enumerator_close_async(). Once
4887 * a #GFileEnumerator is closed, no further actions may be performed
4888 * on it, and it should be freed with g_object_unref().
4894 * @short_description: Icons pointing to an image file
4895 * @include: gio/gio.h
4896 * @see_also: #GIcon, #GLoadableIcon
4898 * #GFileIcon specifies an icon by pointing to an image file
4899 * to be used as icon.
4905 * @short_description: File Information and Attributes
4906 * @include: gio/gio.h
4907 * @see_also: #GFile, <link linkend="gio-GFileAttribute">GFileAttribute</link>
4909 * Functionality for manipulating basic metadata for files. #GFileInfo
4910 * implements methods for getting information that all files should
4911 * contain, and allows for manipulation of extended attributes.
4913 * See <link linkend="gio-GFileAttribute">GFileAttribute</link> for more
4914 * information on how GIO handles file attributes.
4916 * To obtain a #GFileInfo for a #GFile, use g_file_query_info() (or its
4917 * async variant). To obtain a #GFileInfo for a file input or output
4918 * stream, use g_file_input_stream_query_info() or
4919 * g_file_output_stream_query_info() (or their async variants).
4921 * To change the actual attributes of a file, you should then set the
4922 * attribute in the #GFileInfo and call g_file_set_attributes_from_info()
4923 * or g_file_set_attributes_async() on a GFile.
4925 * However, not all attributes can be changed in the file. For instance,
4926 * the actual size of a file cannot be changed via g_file_info_set_size().
4927 * You may call g_file_query_settable_attributes() and
4928 * g_file_query_writable_namespaces() to discover the settable attributes
4929 * of a particular file at runtime.
4931 * #GFileAttributeMatcher allows for searching through a #GFileInfo for
4937 * SECTION:gfileinputstream
4938 * @short_description: File input streaming operations
4939 * @include: gio/gio.h
4940 * @see_also: #GInputStream, #GDataInputStream, #GSeekable
4942 * GFileInputStream provides input streams that take their
4943 * content from a file.
4945 * GFileInputStream implements #GSeekable, which allows the input
4946 * stream to jump to arbitrary positions in the file, provided the
4947 * filesystem of the file allows it. To find the position of a file
4948 * input stream, use g_seekable_tell(). To find out if a file input
4949 * stream supports seeking, use g_seekable_can_seek().
4950 * To position a file input stream, use g_seekable_seek().
4955 * SECTION:gfileiostream
4956 * @short_description: File read and write streaming operations
4957 * @include: gio/gio.h
4958 * @see_also: #GIOStream, #GFileInputStream, #GFileOutputStream, #GSeekable
4960 * GFileIOStream provides io streams that both read and write to the same
4963 * GFileIOStream implements #GSeekable, which allows the io
4964 * stream to jump to arbitrary positions in the file and to truncate
4965 * the file, provided the filesystem of the file supports these
4968 * To find the position of a file io stream, use
4969 * g_seekable_tell().
4971 * To find out if a file io stream supports seeking, use g_seekable_can_seek().
4972 * To position a file io stream, use g_seekable_seek().
4973 * To find out if a file io stream supports truncating, use
4974 * g_seekable_can_truncate(). To truncate a file io
4975 * stream, use g_seekable_truncate().
4977 * The default implementation of all the #GFileIOStream operations
4978 * and the implementation of #GSeekable just call into the same operations
4979 * on the output stream.
4986 * SECTION:gfilemonitor
4987 * @short_description: File Monitor
4988 * @include: gio/gio.h
4990 * Monitors a file or directory for changes.
4992 * To obtain a #GFileMonitor for a file or directory, use
4993 * g_file_monitor(), g_file_monitor_file(), or
4994 * g_file_monitor_directory().
4996 * To get informed about changes to the file or directory you are
4997 * monitoring, connect to the #GFileMonitor::changed signal. The
4998 * signal will be emitted in the <link
4999 * linkend="g-main-context-push-thread-default">thread-default main
5000 * context</link> of the thread that the monitor was created in
5001 * (though if the global default main context is blocked, this may
5002 * cause notifications to be blocked even if the thread-default
5003 * context is still running).
5008 * SECTION:gfilenamecompleter
5009 * @short_description: Filename Completer
5010 * @include: gio/gio.h
5012 * Completes partial file and directory names given a partial string by
5013 * looking in the file system for clues. Can return a list of possible
5014 * completion strings for widget implementations.
5019 * SECTION:gfileoutputstream
5020 * @short_description: File output streaming operations
5021 * @include: gio/gio.h
5022 * @see_also: #GOutputStream, #GDataOutputStream, #GSeekable
5024 * GFileOutputStream provides output streams that write their
5025 * content to a file.
5027 * GFileOutputStream implements #GSeekable, which allows the output
5028 * stream to jump to arbitrary positions in the file and to truncate
5029 * the file, provided the filesystem of the file supports these
5032 * To find the position of a file output stream, use g_seekable_tell().
5033 * To find out if a file output stream supports seeking, use
5034 * g_seekable_can_seek().To position a file output stream, use
5035 * g_seekable_seek(). To find out if a file output stream supports
5036 * truncating, use g_seekable_can_truncate(). To truncate a file output
5037 * stream, use g_seekable_truncate().
5042 * SECTION:gfilterinputstream
5043 * @short_description: Filter Input Stream
5044 * @include: gio/gio.h
5046 * Base class for input stream implementations that perform some
5047 * kind of filtering operation on a base stream. Typical examples
5048 * of filtering operations are character set conversion, compression
5049 * and byte order flipping.
5054 * SECTION:gfilteroutputstream
5055 * @short_description: Filter Output Stream
5056 * @include: gio/gio.h
5058 * Base class for output stream implementations that perform some
5059 * kind of filtering operation on a base stream. Typical examples
5060 * of filtering operations are character set conversion, compression
5061 * and byte order flipping.
5067 * @short_description: Interface for icons
5068 * @include: gio/gio.h
5070 * #GIcon is a very minimal interface for icons. It provides functions
5071 * for checking the equality of two icons, hashing of icons and
5072 * serializing an icon to and from strings.
5074 * #GIcon does not provide the actual pixmap for the icon as this is out
5075 * of GIO's scope, however implementations of #GIcon may contain the name
5076 * of an icon (see #GThemedIcon), or the path to an icon (see #GLoadableIcon).
5078 * To obtain a hash of a #GIcon, see g_icon_hash().
5080 * To check if two #GIcons are equal, see g_icon_equal().
5082 * For serializing a #GIcon, use g_icon_to_string() and
5083 * g_icon_new_for_string().
5085 * If your application or library provides one or more #GIcon
5086 * implementations you need to ensure that each #GType is registered
5087 * with the type system prior to calling g_icon_new_for_string().
5092 * SECTION:ginetaddress
5093 * @short_description: An IPv4/IPv6 address
5095 * #GInetAddress represents an IPv4 or IPv6 internet address. Use
5096 * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_async() to
5097 * look up the #GInetAddress for a hostname. Use
5098 * g_resolver_lookup_by_address() or
5099 * g_resolver_lookup_by_address_async() to look up the hostname for a
5102 * To actually connect to a remote host, you will need a
5103 * #GInetSocketAddress (which includes a #GInetAddress as well as a
5109 * SECTION:ginetaddressmask
5110 * @short_description: An IPv4/IPv6 address mask
5112 * #GInetAddressMask represents a range of IPv4 or IPv6 addresses
5113 * described by a base address and a length indicating how many bits
5114 * of the base address are relevant for matching purposes. These are
5115 * often given in string form. Eg, "10.0.0.0/8", or "fe80::/10".
5120 * SECTION:ginetsocketaddress
5121 * @short_description: Internet GSocketAddress
5123 * An IPv4 or IPv6 socket address; that is, the combination of a
5124 * #GInetAddress and a port number.
5130 * @short_description: Failable object initialization interface
5131 * @include: gio/gio.h
5132 * @see_also: #GAsyncInitable
5134 * #GInitable is implemented by objects that can fail during
5135 * initialization. If an object implements this interface then
5136 * it must be initialized as the first thing after construction,
5137 * either via g_initable_init() or g_async_initable_init_async()
5138 * (the latter is only available if it also implements #GAsyncInitable).
5140 * If the object is not initialized, or initialization returns with an
5141 * error, then all operations on the object except g_object_ref() and
5142 * g_object_unref() are considered to be invalid, and have undefined
5143 * behaviour. They will often fail with g_critical() or g_warning(), but
5144 * this must not be relied on.
5146 * Users of objects implementing this are not intended to use
5147 * the interface method directly, instead it will be used automatically
5148 * in various ways. For C applications you generally just call
5149 * g_initable_new() directly, or indirectly via a foo_thing_new() wrapper.
5150 * This will call g_initable_init() under the cover, returning %NULL and
5151 * setting a #GError on failure (at which point the instance is
5154 * For bindings in languages where the native constructor supports
5155 * exceptions the binding could check for objects implemention %GInitable
5156 * during normal construction and automatically initialize them, throwing
5157 * an exception on failure.
5162 * SECTION:ginputstream
5163 * @short_description: Base class for implementing streaming input
5164 * @include: gio/gio.h
5166 * #GInputStream has functions to read from a stream (g_input_stream_read()),
5167 * to close a stream (g_input_stream_close()) and to skip some content
5168 * (g_input_stream_skip()).
5170 * To copy the content of an input stream to an output stream without
5171 * manually handling the reads and writes, use g_output_stream_splice().
5173 * All of these functions have async variants too.
5179 * @short_description: Error helper functions
5180 * @include: gio/gio.h
5182 * Contains helper functions for reporting errors to the user.
5188 * @short_description: Loadable GIO Modules
5189 * @include: gio/gio.h
5191 * Provides an interface and default functions for loading and unloading
5192 * modules. This is used internally to make GIO extensible, but can also
5193 * be used by others to implement module loading.
5198 * SECTION:gioscheduler
5199 * @short_description: I/O Scheduler
5200 * @include: gio/gio.h
5202 * Schedules asynchronous I/O operations. #GIOScheduler integrates
5203 * into the main event loop (#GMainLoop) and uses threads.
5205 * <para id="io-priority"><indexterm><primary>I/O priority</primary></indexterm>
5206 * Each I/O operation has a priority, and the scheduler uses the priorities
5207 * to determine the order in which operations are executed. They are
5208 * <emphasis>not</emphasis> used to determine system-wide I/O scheduling.
5209 * Priorities are integers, with lower numbers indicating higher priority.
5210 * It is recommended to choose priorities between %G_PRIORITY_LOW and
5211 * %G_PRIORITY_HIGH, with %G_PRIORITY_DEFAULT as a default.
5218 * @short_description: Base class for implementing read/write streams
5219 * @include: gio/gio.h
5220 * @see_also: #GInputStream, #GOutputStream
5222 * GIOStream represents an object that has both read and write streams.
5223 * Generally the two streams acts as separate input and output streams,
5224 * but they share some common resources and state. For instance, for
5225 * seekable streams they may use the same position in both streams.
5227 * Examples of #GIOStream objects are #GSocketConnection which represents
5228 * a two-way network connection, and #GFileIOStream which represent a
5229 * file handle opened in read-write mode.
5231 * To do the actual reading and writing you need to get the substreams
5232 * with g_io_stream_get_input_stream() and g_io_stream_get_output_stream().
5234 * The #GIOStream object owns the input and the output streams, not the other
5235 * way around, so keeping the substreams alive will not keep the #GIOStream
5236 * object alive. If the #GIOStream object is freed it will be closed, thus
5237 * closing the substream, so even if the substreams stay alive they will
5238 * always just return a %G_IO_ERROR_CLOSED for all operations.
5240 * To close a stream use g_io_stream_close() which will close the common
5241 * stream object and also the individual substreams. You can also close
5242 * the substreams themselves. In most cases this only marks the
5243 * substream as closed, so further I/O on it fails. However, some streams
5244 * may support "half-closed" states where one direction of the stream
5245 * is actually shut down.
5252 * SECTION:gloadableicon
5253 * @short_description: Loadable Icons
5254 * @include: gio/gio.h
5255 * @see_also: #GIcon, #GThemedIcon
5257 * Extends the #GIcon interface and adds the ability to
5258 * load icons from streams.
5263 * SECTION:gmemoryinputstream
5264 * @short_description: Streaming input operations on memory chunks
5265 * @include: gio/gio.h
5266 * @see_also: #GMemoryOutputStream
5268 * #GMemoryInputStream is a class for using arbitrary
5269 * memory chunks as input for GIO streaming input operations.
5271 * As of GLib 2.34, #GMemoryInputStream implements
5272 * #GPollableInputStream.
5277 * SECTION:gmemoryoutputstream
5278 * @short_description: Streaming output operations on memory chunks
5279 * @include: gio/gio.h
5280 * @see_also: #GMemoryInputStream
5282 * #GMemoryOutputStream is a class for using arbitrary
5283 * memory chunks as output for GIO streaming output operations.
5285 * As of GLib 2.34, #GMemoryOutputStream implements
5286 * #GPollableOutputStream.
5293 * @short_description: A simple implementation of GMenuModel
5295 * #GMenu is a simple implementation of #GMenuModel.
5296 * You populate a #GMenu by adding #GMenuItem instances to it.
5298 * There are some convenience functions to allow you to directly
5299 * add items (avoiding #GMenuItem) for the common cases. To add
5300 * a regular item, use g_menu_insert(). To add a section, use
5301 * g_menu_insert_section(). To add a submenu, use
5302 * g_menu_insert_submenu().
5307 * SECTION:gmenuexporter
5308 * @title: GMenuModel exporter
5309 * @short_description: Export GMenuModels on D-Bus
5310 * @see_also: #GMenuModel, #GDBusMenuModel
5312 * These functions support exporting a #GMenuModel on D-Bus.
5313 * The D-Bus interface that is used is a private implementation
5316 * To access an exported #GMenuModel remotely, use
5317 * g_dbus_menu_model_get() to obtain a #GDBusMenuModel.
5322 * SECTION:gmenumodel
5323 * @title: GMenuModel
5324 * @short_description: An abstract class representing the contents of a menu
5325 * @see_also: #GActionGroup
5327 * #GMenuModel represents the contents of a menu -- an ordered list of
5328 * menu items. The items are associated with actions, which can be
5329 * activated through them. Items can be grouped in sections, and may
5330 * have submenus associated with them. Both items and sections usually
5331 * have some representation data, such as labels or icons. The type of
5332 * the associated action (ie whether it is stateful, and what kind of
5333 * state it has) can influence the representation of the item.
5335 * The conceptual model of menus in #GMenuModel is hierarchical:
5336 * sections and submenus are again represented by #GMenuModels.
5337 * Menus themselves do not define their own roles. Rather, the role
5338 * of a particular #GMenuModel is defined by the item that references
5339 * it (or, in the case of the 'root' menu, is defined by the context
5340 * in which it is used).
5342 * As an example, consider the visible portions of the menu in
5343 * <xref linkend="menu-example"/>.
5345 * <figure id="menu-example">
5346 * <title>An example menu</title>
5347 * <graphic fileref="menu-example.png" format="PNG"></graphic>
5350 * There are 8 "menus" visible in the screenshot: one menubar, two
5351 * submenus and 5 sections:
5353 * <listitem>the toplevel menubar (containing 4 items)</listitem>
5354 * <listitem>the View submenu (containing 3 sections)</listitem>
5355 * <listitem>the first section of the View submenu (containing 2 items)</listitem>
5356 * <listitem>the second section of the View submenu (containing 1 item)</listitem>
5357 * <listitem>the final section of the View submenu (containing 1 item)</listitem>
5358 * <listitem>the Highlight Mode submenu (containing 2 sections)</listitem>
5359 * <listitem>the Sources section (containing 2 items)</listitem>
5360 * <listitem>the Markup section (containing 2 items)</listitem>
5363 * <xref linkend="menu-model"/> illustrates the conceptual connection between
5364 * these 8 menus. Each large block in the figure represents a menu and the
5365 * smaller blocks within the large block represent items in that menu. Some
5366 * items contain references to other menus.
5368 * <figure id="menu-model">
5369 * <title>A menu model</title>
5370 * <graphic fileref="menu-model.png" format="PNG"></graphic>
5373 * Notice that the separators visible in <xref linkend="menu-example"/>
5374 * appear nowhere in <xref linkend="menu-model"/>. This is because
5375 * separators are not explicitly represented in the menu model. Instead,
5376 * a separator is inserted between any two non-empty sections of a menu.
5377 * Section items can have labels just like any other item. In that case,
5378 * a display system may show a section header instead of a separator.
5380 * The motivation for this abstract model of application controls is
5381 * that modern user interfaces tend to make these controls available
5382 * outside the application. Examples include global menus, jumplists,
5383 * dash boards, etc. To support such uses, it is necessary to 'export'
5384 * information about actions and their representation in menus, which
5385 * is exactly what the
5386 * <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
5388 * <link linkend="gio-GMenuModel-exporter">GMenuModel exporter</link>
5389 * do for #GActionGroup and #GMenuModel. The client-side counterparts
5390 * to make use of the exported information are #GDBusActionGroup and
5393 * The API of #GMenuModel is very generic, with iterators for the
5394 * attributes and links of an item, see g_menu_model_iterate_item_attributes()
5395 * and g_menu_model_iterate_item_links(). The 'standard' attributes and
5396 * link types have predefined names: %G_MENU_ATTRIBUTE_LABEL,
5397 * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, %G_MENU_LINK_SECTION
5398 * and %G_MENU_LINK_SUBMENU.
5400 * Items in a #GMenuModel represent active controls if they refer to
5401 * an action that can get activated when the user interacts with the
5402 * menu item. The reference to the action is encoded by the string id
5403 * in the %G_MENU_ATTRIBUTE_ACTION attribute. An action id uniquely
5404 * identifies an action in an action group. Which action group(s) provide
5405 * actions depends on the context in which the menu model is used.
5406 * E.g. when the model is exported as the application menu of a
5407 * #GtkApplication, actions can be application-wide or window-specific
5408 * (and thus come from two different action groups). By convention, the
5409 * application-wide actions have names that start with "app.", while the
5410 * names of window-specific actions start with "win.".
5412 * While a wide variety of stateful actions is possible, the following
5413 * is the minimum that is expected to be supported by all users of exported
5416 * <listitem>an action with no parameter type and no state</listitem>
5417 * <listitem>an action with no parameter type and boolean state</listitem>
5418 * <listitem>an action with string parameter type and string state</listitem>
5421 * <formalpara><title>Stateless</title>
5423 * A stateless action typically corresponds to an ordinary menu item.
5426 * Selecting such a menu item will activate the action (with no parameter).
5430 * <formalpara><title>Boolean State</title>
5432 * An action with a boolean state will most typically be used with a "toggle"
5433 * or "switch" menu item. The state can be set directly, but activating the
5434 * action (with no parameter) results in the state being toggled.
5437 * Selecting a toggle menu item will activate the action. The menu item should
5438 * be rendered as "checked" when the state is true.
5442 * <formalpara><title>String Parameter and State</title>
5444 * Actions with string parameters and state will most typically be used to
5445 * represent an enumerated choice over the items available for a group of
5446 * radio menu items. Activating the action with a string parameter is
5447 * equivalent to setting that parameter as the state.
5450 * Radio menu items, in addition to being associated with the action, will
5451 * have a target value. Selecting that menu item will result in activation
5452 * of the action with the target value as the parameter. The menu item should
5453 * be rendered as "selected" when the state of the action is equal to the
5454 * target value of the menu item.
5462 * @short_description: Mount management
5463 * @include: gio/gio.h
5464 * @see_also: GVolume, GUnixMountEntry, GUnixMountPoint
5466 * The #GMount interface represents user-visible mounts. Note, when
5467 * porting from GnomeVFS, #GMount is the moral equivalent of #GnomeVFSVolume.
5469 * #GMount is a "mounted" filesystem that you can access. Mounted is in
5470 * quotes because it's not the same as a unix mount, it might be a gvfs
5471 * mount, but you can still access the files on it if you use GIO. Might or
5472 * might not be related to a volume object.
5474 * Unmounting a #GMount instance is an asynchronous operation. For
5475 * more information about asynchronous operations, see #GAsyncResult
5476 * and #GSimpleAsyncResult. To unmount a #GMount instance, first call
5477 * g_mount_unmount_with_operation() with (at least) the #GMount instance and a
5478 * #GAsyncReadyCallback. The callback will be fired when the
5479 * operation has resolved (either with success or failure), and a
5480 * #GAsyncReady structure will be passed to the callback. That
5481 * callback should then call g_mount_unmount_with_operation_finish() with the #GMount
5482 * and the #GAsyncReady data to see if the operation was completed
5483 * successfully. If an @error is present when g_mount_unmount_with_operation_finish()
5484 * is called, then it will be filled with any error information.
5489 * SECTION:gmountoperation
5490 * @short_description: Object used for authentication and user interaction
5491 * @include: gio/gio.h
5493 * #GMountOperation provides a mechanism for interacting with the user.
5494 * It can be used for authenticating mountable operations, such as loop
5495 * mounting files, hard drive partitions or server locations. It can
5496 * also be used to ask the user questions or show a list of applications
5497 * preventing unmount or eject operations from completing.
5499 * Note that #GMountOperation is used for more than just #GMount
5500 * objects – for example it is also used in g_drive_start() and
5503 * Users should instantiate a subclass of this that implements all the
5504 * various callbacks to show the required dialogs, such as
5505 * #GtkMountOperation. If no user interaction is desired (for example
5506 * when automounting filesystems at login time), usually %NULL can be
5507 * passed, see each method taking a #GMountOperation for details.
5512 * SECTION:gnetworkaddress
5513 * @short_description: A GSocketConnectable for resolving hostnames
5514 * @include: gio/gio.h
5516 * #GNetworkAddress provides an easy way to resolve a hostname and
5517 * then attempt to connect to that host, handling the possibility of
5518 * multiple IP addresses and multiple address families.
5520 * See #GSocketConnectable for and example of using the connectable
5526 * SECTION:gnetworkmonitor
5527 * @title: GNetworkMonitor
5528 * @short_description: Network status monitor
5529 * @include: gio/gio.h
5531 * #GNetworkMonitor provides an easy-to-use cross-platform API
5532 * for monitoring network connectivity. On Linux, the implementation
5533 * is based on the kernels netlink interface.
5538 * SECTION:gnetworkservice
5539 * @short_description: A GSocketConnectable for resolving SRV records
5540 * @include: gio/gio.h
5542 * Like #GNetworkAddress does with hostnames, #GNetworkService
5543 * provides an easy way to resolve a SRV record, and then attempt to
5544 * connect to one of the hosts that implements that service, handling
5545 * service priority/weighting, multiple IP addresses, and multiple
5548 * See #GSrvTarget for more information about SRV records, and see
5549 * #GSocketConnectable for and example of using the connectable
5555 * SECTION:goutputstream
5556 * @short_description: Base class for implementing streaming output
5557 * @include: gio/gio.h
5559 * #GOutputStream has functions to write to a stream (g_output_stream_write()),
5560 * to close a stream (g_output_stream_close()) and to flush pending writes
5561 * (g_output_stream_flush()).
5563 * To copy the content of an input stream to an output stream without
5564 * manually handling the reads and writes, use g_output_stream_splice().
5566 * All of these functions have async variants too.
5571 * SECTION:gpermission
5572 * @title: GPermission
5573 * @short_description: An object representing the permission to perform a certain action
5575 * A #GPermission represents the status of the caller's permission to
5576 * perform a certain action.
5578 * You can query if the action is currently allowed and if it is
5579 * possible to acquire the permission so that the action will be allowed
5582 * There is also an API to actually acquire the permission and one to
5585 * As an example, a #GPermission might represent the ability for the
5586 * user to write to a #GSettings object. This #GPermission object could
5587 * then be used to decide if it is appropriate to show a "Click here to
5588 * unlock" button in a dialog and to provide the mechanism to invoke
5589 * when that button is clicked.
5594 * SECTION:gpollableinputstream
5595 * @short_description: Interface for pollable input streams
5596 * @include: gio/gio.h
5597 * @see_also: #GInputStream, #GPollableOutputStream, #GFileDescriptorBased
5599 * #GPollableInputStream is implemented by #GInputStream<!-- -->s that
5600 * can be polled for readiness to read. This can be used when
5601 * interfacing with a non-GIO API that expects
5602 * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5609 * SECTION:gpollableoutputstream
5610 * @short_description: Interface for pollable output streams
5611 * @include: gio/gio.h
5612 * @see_also: #GOutputStream, #GFileDescriptorBased, #GPollableInputStream
5614 * #GPollableOutputStream is implemented by #GOutputStream<!-- -->s that
5615 * can be polled for readiness to write. This can be used when
5616 * interfacing with a non-GIO API that expects
5617 * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5624 * SECTION:gpollableutils
5625 * @short_description: #GPollableInputStream / #GPollableOutputStream utilities
5626 * @include: gio/gio.h
5628 * Utility functions for #GPollableInputStream and
5629 * #GPollableOutputStream implementations.
5635 * @short_description: Interface for proxy handling
5637 * A #GProxy handles connecting to a remote host via a given type of
5638 * proxy server. It is implemented by the 'gio-proxy' extension point.
5639 * The extensions are named after their proxy protocol name. As an
5640 * example, a SOCKS5 proxy implementation can be retrieved with the
5641 * name 'socks5' using the function
5642 * g_io_extension_point_get_extension_by_name().
5649 * SECTION:gproxyaddress
5650 * @short_description: An internet address with proxy information
5652 * Support for proxied #GInetSocketAddress.
5657 * SECTION:gproxyresolver
5658 * @short_description: Asynchronous and cancellable network proxy resolver
5659 * @include: gio/gio.h
5661 * #GProxyResolver provides synchronous and asynchronous network proxy
5662 * resolution. #GProxyResolver is used within #GSocketClient through
5663 * the method g_socket_connectable_proxy_enumerate().
5668 * SECTION:gremoteactiongroup
5669 * @title: GRemoteActionGroup
5670 * @short_description: a #GActionGroup that interacts with other processes
5672 * The GRemoteActionGroup interface is implemented by #GActionGroup
5673 * instances that either transmit action invocations to other processes
5674 * or receive action invocations in the local process from other
5677 * The interface has <literal>_full</literal> variants of the two
5678 * methods on #GActionGroup used to activate actions:
5679 * g_action_group_activate_action() and
5680 * g_action_group_change_action_state(). These variants allow a
5681 * "platform data" #GVariant to be specified: a dictionary providing
5682 * context for the action invocation (for example: timestamps, startup
5683 * notification IDs, etc).
5685 * #GDBusActionGroup implements #GRemoteActionGroup. This provides a
5686 * mechanism to send platform data for action invocations over D-Bus.
5688 * Additionally, g_dbus_connection_export_action_group() will check if
5689 * the exported #GActionGroup implements #GRemoteActionGroup and use the
5690 * <literal>_full</literal> variants of the calls if available. This
5691 * provides a mechanism by which to receive platform data for action
5692 * invocations that arrive by way of D-Bus.
5700 * @short_description: Asynchronous and cancellable DNS resolver
5701 * @include: gio/gio.h
5703 * #GResolver provides cancellable synchronous and asynchronous DNS
5704 * resolution, for hostnames (g_resolver_lookup_by_address(),
5705 * g_resolver_lookup_by_name() and their async variants) and SRV
5706 * (service) records (g_resolver_lookup_service()).
5708 * #GNetworkAddress and #GNetworkService provide wrappers around
5709 * #GResolver functionality that also implement #GSocketConnectable,
5710 * making it easy to connect to a remote host/service.
5716 * @short_description: Resource framework
5717 * @include: gio/gio.h
5719 * Applications and libraries often contain binary or textual data that is really part of the
5720 * application, rather than user data. For instance #GtkBuilder .ui files, splashscreen images,
5721 * GMenu markup xml, CSS files, icons, etc. These are often shipped as files in <filename>$datadir/appname</filename>, or
5722 * manually included as literal strings in the code.
5724 * The #GResource API and the <link linkend="glib-compile-resources">glib-compile-resources</link> program
5725 * provide a convenient and efficient alternative to this which has some nice properties. You
5726 * maintain the files as normal files, so its easy to edit them, but during the build the files
5727 * are combined into a binary bundle that is linked into the executable. This means that loading
5728 * the resource files are efficient (as they are already in memory, shared with other instances) and
5729 * simple (no need to check for things like I/O errors or locate the files in the filesystem). It
5730 * also makes it easier to create relocatable applications.
5732 * Resource files can also be marked as compressed. Such files will be included in the resource bundle
5733 * in a compressed form, but will be automatically uncompressed when the resource is used. This
5734 * is very useful e.g. for larger text files that are parsed once (or rarely) and then thrown away.
5736 * Resource files can also be marked to be preprocessed, by setting the value of the
5737 * <literal>preprocess</literal> attribute to a comma-separated list of preprocessing options.
5738 * The only options currently supported are:
5740 * <literal>xml-stripblanks</literal> which will use <command>xmllint</command> to strip
5741 * ignorable whitespace from the xml file. For this to work, the <envar>XMLLINT</envar>
5742 * environment variable must be set to the full path to the xmllint executable, or xmllint
5743 * must be in the PATH; otherwise the preprocessing step is skipped.
5745 * <literal>to-pixdata</literal> which will use <command>gdk-pixbuf-pixdata</command> to convert
5746 * images to the GdkPixdata format, which allows you to create pixbufs directly using the data inside
5747 * the resource file, rather than an (uncompressed) copy if it. For this, the gdk-pixbuf-pixdata
5748 * program must be in the PATH, or the <envar>GDK_PIXBUF_PIXDATA</envar> environment variable must be
5749 * set to the full path to the gdk-pixbuf-pixdata executable; otherwise the resource compiler will
5752 * Resource bundles are created by the <link linkend="glib-compile-resources">glib-compile-resources</link> program
5753 * which takes an xml file that describes the bundle, and a set of files that the xml references. These
5754 * are combined into a binary resource bundle.
5756 * <example id="resource-example"><title>Example resource description</title>
5757 * <programlisting><![CDATA[
5758 * <?xml version="1.0" encoding="UTF-8"?>
5760 * <gresource prefix="/org/gtk/Example">
5761 * <file>data/splashscreen.png</file>
5762 * <file compressed="true">dialog.ui</file>
5763 * <file preprocess="xml-stripblanks">menumarkup.xml</file>
5766 * ]]></programlisting></example>
5768 * This will create a resource bundle with the following files:
5769 * <programlisting><![CDATA[
5770 * /org/gtk/Example/data/splashscreen.png
5771 * /org/gtk/Example/dialog.ui
5772 * /org/gtk/Example/menumarkup.xml
5773 * ]]></programlisting>
5775 * Note that all resources in the process share the same namespace, so use java-style
5776 * path prefixes (like in the above example) to avoid conflicts.
5778 * You can then use <link linkend="glib-compile-resources">glib-compile-resources</link> to compile the xml to a
5779 * binary bundle that you can load with g_resource_load(). However, its more common to use the --generate-source and
5780 * --generate-header arguments to create a source file and header to link directly into your application.
5782 * Once a #GResource has been created and registered all the data in it can be accessed globally in the process by
5783 * using API calls like g_resources_open_stream() to stream the data or g_resources_lookup_data() to get a direct pointer
5784 * to the data. You can also use uris like "resource:///org/gtk/Example/data/splashscreen.png" with #GFile to access
5785 * the resource data.
5787 * There are two forms of the generated source, the default version uses the compiler support for constructor
5788 * and destructor functions (where available) to automatically create and register the #GResource on startup
5789 * or library load time. If you pass --manual-register two functions to register/unregister the resource is instead
5790 * created. This requires an explicit initialization call in your application/library, but it works on all platforms,
5791 * even on the minor ones where this is not available. (Constructor support is available for at least Win32, MacOS and Linux.)
5793 * Note that resource data can point directly into the data segment of e.g. a library, so if you are unloading libraries
5794 * during runtime you need to be very careful with keeping around pointers to data from a resource, as this goes away
5795 * when the library is unloaded. However, in practice this is not generally a problem, since most resource accesses
5796 * is for your own resources, and resource data is often used once, during parsing, and then released.
5804 * @short_description: Stream seeking interface
5805 * @include: gio/gio.h
5806 * @see_also: #GInputStream, #GOutputStream
5808 * #GSeekable is implemented by streams (implementations of
5809 * #GInputStream or #GOutputStream) that support seeking.
5815 * @short_description: High-level API for application settings
5817 * The #GSettings class provides a convenient API for storing and retrieving
5818 * application settings.
5820 * Reads and writes can be considered to be non-blocking. Reading
5821 * settings with #GSettings is typically extremely fast: on
5822 * approximately the same order of magnitude (but slower than) a
5823 * #GHashTable lookup. Writing settings is also extremely fast in terms
5824 * of time to return to your application, but can be extremely expensive
5825 * for other threads and other processes. Many settings backends
5826 * (including dconf) have lazy initialisation which means in the common
5827 * case of the user using their computer without modifying any settings
5828 * a lot of work can be avoided. For dconf, the D-Bus service doesn't
5829 * even need to be started in this case. For this reason, you should
5830 * only ever modify #GSettings keys in response to explicit user action.
5831 * Particular care should be paid to ensure that modifications are not
5832 * made during startup -- for example, when setting the initial value
5833 * of preferences widgets. The built-in g_settings_bind() functionality
5834 * is careful not to write settings in response to notify signals as a
5835 * result of modifications that it makes to widgets.
5837 * When creating a GSettings instance, you have to specify a schema
5838 * that describes the keys in your settings and their types and default
5839 * values, as well as some other information.
5841 * Normally, a schema has as fixed path that determines where the settings
5842 * are stored in the conceptual global tree of settings. However, schemas
5843 * can also be 'relocatable', i.e. not equipped with a fixed path. This is
5844 * useful e.g. when the schema describes an 'account', and you want to be
5845 * able to store a arbitrary number of accounts.
5847 * Paths must start with and end with a forward slash character ('/')
5848 * and must not contain two sequential slash characters. Paths should
5849 * be chosen based on a domain name associated with the program or
5850 * library to which the settings belong. Examples of paths are
5851 * "/org/gtk/settings/file-chooser/" and "/ca/desrt/dconf-editor/".
5852 * Paths should not start with "/apps/", "/desktop/" or "/system/" as
5853 * they often did in GConf.
5855 * Unlike other configuration systems (like GConf), GSettings does not
5856 * restrict keys to basic types like strings and numbers. GSettings stores
5857 * values as #GVariant, and allows any #GVariantType for keys. Key names
5858 * are restricted to lowercase characters, numbers and '-'. Furthermore,
5859 * the names must begin with a lowercase character, must not end
5860 * with a '-', and must not contain consecutive dashes.
5862 * Similar to GConf, the default values in GSettings schemas can be
5863 * localized, but the localized values are stored in gettext catalogs
5864 * and looked up with the domain that is specified in the
5865 * <tag class="attribute">gettext-domain</tag> attribute of the
5866 * <tag class="starttag">schemalist</tag> or <tag class="starttag">schema</tag>
5867 * elements and the category that is specified in the l10n attribute of the
5868 * <tag class="starttag">key</tag> element.
5870 * GSettings uses schemas in a compact binary form that is created
5871 * by the <link linkend="glib-compile-schemas">glib-compile-schemas</link>
5872 * utility. The input is a schema description in an XML format that can be
5873 * described by the following DTD:
5874 * |[<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>]|
5876 * glib-compile-schemas expects schema files to have the extension <filename>.gschema.xml</filename>
5878 * At runtime, schemas are identified by their id (as specified
5879 * in the <tag class="attribute">id</tag> attribute of the
5880 * <tag class="starttag">schema</tag> element). The
5881 * convention for schema ids is to use a dotted name, similar in
5882 * style to a D-Bus bus name, e.g. "org.gnome.SessionManager". In particular,
5883 * if the settings are for a specific service that owns a D-Bus bus name,
5884 * the D-Bus bus name and schema id should match. For schemas which deal
5885 * with settings not associated with one named application, the id should
5886 * not use StudlyCaps, e.g. "org.gnome.font-rendering".
5888 * In addition to #GVariant types, keys can have types that have enumerated
5889 * types. These can be described by a <tag class="starttag">choice</tag>,
5890 * <tag class="starttag">enum</tag> or <tag class="starttag">flags</tag> element, see
5891 * <xref linkend="schema-enumerated"/>. The underlying type of
5892 * such a key is string, but you can use g_settings_get_enum(),
5893 * g_settings_set_enum(), g_settings_get_flags(), g_settings_set_flags()
5894 * access the numeric values corresponding to the string value of enum
5897 * <example id="schema-default-values"><title>Default values</title>
5898 * <programlisting><![CDATA[
5900 * <schema id="org.gtk.Test" path="/org/gtk/Test/" gettext-domain="test">
5902 * <key name="greeting" type="s">
5903 * <default l10n="messages">"Hello, earthlings"</default>
5904 * <summary>A greeting</summary>
5906 * Greeting of the invading martians
5910 * <key name="box" type="(ii)">
5911 * <default>(20,30)</default>
5916 * ]]></programlisting></example>
5918 * <example id="schema-enumerated"><title>Ranges, choices and enumerated types</title>
5919 * <programlisting><![CDATA[
5922 * <enum id="org.gtk.Test.myenum">
5923 * <value nick="first" value="1"/>
5924 * <value nick="second" value="2"/>
5927 * <flags id="org.gtk.Test.myflags">
5928 * <value nick="flag1" value="1"/>
5929 * <value nick="flag2" value="2"/>
5930 * <value nick="flag3" value="4"/>
5933 * <schema id="org.gtk.Test">
5935 * <key name="key-with-range" type="i">
5936 * <range min="1" max="100"/>
5937 * <default>10</default>
5940 * <key name="key-with-choices" type="s">
5942 * <choice value='Elisabeth'/>
5943 * <choice value='Annabeth'/>
5944 * <choice value='Joe'/>
5947 * <alias value='Anna' target='Annabeth'/>
5948 * <alias value='Beth' target='Elisabeth'/>
5950 * <default>'Joe'</default>
5953 * <key name='enumerated-key' enum='org.gtk.Test.myenum'>
5954 * <default>'first'</default>
5957 * <key name='flags-key' flags='org.gtk.Test.myflags'>
5958 * <default>["flag1",flag2"]</default>
5962 * ]]></programlisting></example>
5965 * <title>Vendor overrides</title>
5967 * Default values are defined in the schemas that get installed by
5968 * an application. Sometimes, it is necessary for a vendor or distributor
5969 * to adjust these defaults. Since patching the XML source for the schema
5970 * is inconvenient and error-prone,
5971 * <link linkend="glib-compile-schemas">glib-compile-schemas</link> reads
5972 * so-called 'vendor override' files. These are keyfiles in the same
5973 * directory as the XML schema sources which can override default values.
5974 * The schema id serves as the group name in the key file, and the values
5975 * are expected in serialized GVariant form, as in the following example:
5976 * <informalexample><programlisting>
5980 * </programlisting></informalexample>
5983 * glib-compile-schemas expects schema files to have the extension
5984 * <filename>.gschema.override</filename>
5989 * <title>Binding</title>
5991 * A very convenient feature of GSettings lets you bind #GObject properties
5992 * directly to settings, using g_settings_bind(). Once a GObject property
5993 * has been bound to a setting, changes on either side are automatically
5994 * propagated to the other side. GSettings handles details like
5995 * mapping between GObject and GVariant types, and preventing infinite
5999 * This makes it very easy to hook up a preferences dialog to the
6000 * underlying settings. To make this even more convenient, GSettings
6001 * looks for a boolean property with the name "sensitivity" and
6002 * automatically binds it to the writability of the bound setting.
6003 * If this 'magic' gets in the way, it can be suppressed with the
6004 * #G_SETTINGS_BIND_NO_SENSITIVITY flag.
6011 * SECTION:gsettingsbackend
6012 * @title: GSettingsBackend
6013 * @short_description: Interface for settings backend implementations
6014 * @include: gio/gsettingsbackend.h
6015 * @see_also: #GSettings, #GIOExtensionPoint
6017 * The #GSettingsBackend interface defines a generic interface for
6018 * non-strictly-typed data that is stored in a hierarchy. To implement
6019 * an alternative storage backend for #GSettings, you need to implement
6020 * the #GSettingsBackend interface and then make it implement the
6021 * extension point #G_SETTINGS_BACKEND_EXTENSION_POINT_NAME.
6023 * The interface defines methods for reading and writing values, a
6024 * method for determining if writing of certain values will fail
6025 * (lockdown) and a change notification mechanism.
6027 * The semantics of the interface are very precisely defined and
6028 * implementations must carefully adhere to the expectations of
6029 * callers that are documented on each of the interface methods.
6031 * Some of the GSettingsBackend functions accept or return a #GTree.
6032 * These trees always have strings as keys and #GVariant as values.
6033 * g_settings_backend_create_tree() is a convenience function to create
6037 * The #GSettingsBackend API is exported to allow third-party
6038 * implementations, but does not carry the same stability guarantees
6039 * as the public GIO API. For this reason, you have to define the
6040 * C preprocessor symbol #G_SETTINGS_ENABLE_BACKEND before including
6041 * <filename>gio/gsettingsbackend.h</filename>
6047 * SECTION:gsettingsschema
6048 * @short_description: introspecting and controlling the loading of #GSettings schemas
6050 * The #GSettingsSchemaSource and #GSettingsSchema APIs provide a
6051 * mechanism for advanced control over the loading of schemas and a
6052 * mechanism for introspecting their content.
6054 * Plugin loading systems that wish to provide plugins a way to access
6055 * settings face the problem of how to make the schemas for these
6056 * settings visible to GSettings. Typically, a plugin will want to ship
6057 * the schema along with itself and it won't be installed into the
6058 * standard system directories for schemas.
6060 * #GSettingsSchemaSource provides a mechanism for dealing with this by
6061 * allowing the creation of a new 'schema source' from which schemas can
6062 * be acquired. This schema source can then become part of the metadata
6063 * associated with the plugin and queried whenever the plugin requires
6064 * access to some settings.
6066 * Consider the following example:
6072 * GSettingsSchemaSource *schema_source;
6077 * initialise_plugin (const gchar *dir)
6083 * plugin->schema_source =
6084 * g_settings_new_schema_source_from_directory (dir,
6085 * g_settings_schema_source_get_default (), FALSE, NULL);
6095 * plugin_get_settings (Plugin *plugin,
6096 * const gchar *schema_id)
6098 * GSettingsSchema *schema;
6100 * if (schema_id == NULL)
6101 * schema_id = plugin->identifier;
6103 * schema = g_settings_schema_source_lookup (plugin->schema_source,
6104 * schema_id, FALSE);
6106 * if (schema == NULL)
6108 * ... disable the plugin or abort, etc ...
6111 * return g_settings_new_full (schema, NULL, NULL);
6115 * The code above shows how hooks should be added to the code that
6116 * initialises (or enables) the plugin to create the schema source and
6117 * how an API can be added to the plugin system to provide a convenient
6118 * way for the plugin to access its settings, using the schemas that it
6121 * From the standpoint of the plugin, it would need to ensure that it
6122 * ships a gschemas.compiled file as part of itself, and then simply do
6127 * GSettings *settings;
6130 * settings = plugin_get_settings (self, NULL);
6131 * some_value = g_settings_get_int (settings, "some-value");
6136 * It's also possible that the plugin system expects the schema source
6137 * files (ie: .gschema.xml files) instead of a gschemas.compiled file.
6138 * In that case, the plugin loading system must compile the schemas for
6139 * itself before attempting to create the settings source.
6146 * SECTION:gsimpleaction
6147 * @title: GSimpleAction
6148 * @short_description: A simple GAction implementation
6150 * A #GSimpleAction is the obvious simple implementation of the #GAction
6151 * interface. This is the easiest way to create an action for purposes of
6152 * adding it to a #GSimpleActionGroup.
6154 * See also #GtkAction.
6159 * SECTION:gsimpleactiongroup
6160 * @title: GSimpleActionGroup
6161 * @short_description: A simple GActionGroup implementation
6163 * #GSimpleActionGroup is a hash table filled with #GAction objects,
6164 * implementing the #GActionGroup and #GActionMap interfaces.
6169 * SECTION:gsimpleasyncresult
6170 * @short_description: Simple asynchronous results implementation
6171 * @include: gio/gio.h
6172 * @see_also: #GAsyncResult
6174 * Implements #GAsyncResult for simple cases. Most of the time, this
6175 * will be all an application needs, and will be used transparently.
6176 * Because of this, #GSimpleAsyncResult is used throughout GIO for
6177 * handling asynchronous functions.
6179 * GSimpleAsyncResult handles #GAsyncReadyCallback<!-- -->s, error
6180 * reporting, operation cancellation and the final state of an operation,
6181 * completely transparent to the application. Results can be returned
6182 * as a pointer e.g. for functions that return data that is collected
6183 * asynchronously, a boolean value for checking the success or failure
6184 * of an operation, or a #gssize for operations which return the number
6185 * of bytes modified by the operation; all of the simple return cases
6188 * Most of the time, an application will not need to know of the details
6189 * of this API; it is handled transparently, and any necessary operations
6190 * are handled by #GAsyncResult's interface. However, if implementing a
6191 * new GIO module, for writing language bindings, or for complex
6192 * applications that need better control of how asynchronous operations
6193 * are completed, it is important to understand this functionality.
6195 * GSimpleAsyncResults are tagged with the calling function to ensure
6196 * that asynchronous functions and their finishing functions are used
6197 * together correctly.
6199 * To create a new #GSimpleAsyncResult, call g_simple_async_result_new().
6200 * If the result needs to be created for a #GError, use
6201 * g_simple_async_result_new_from_error() or
6202 * g_simple_async_result_new_take_error(). If a #GError is not available
6203 * (e.g. the asynchronous operation's doesn't take a #GError argument),
6204 * but the result still needs to be created for an error condition, use
6205 * g_simple_async_result_new_error() (or g_simple_async_result_set_error_va()
6206 * if your application or binding requires passing a variable argument list
6207 * directly), and the error can then be propagated through the use of
6208 * g_simple_async_result_propagate_error().
6210 * An asynchronous operation can be made to ignore a cancellation event by
6211 * calling g_simple_async_result_set_handle_cancellation() with a
6212 * #GSimpleAsyncResult for the operation and %FALSE. This is useful for
6213 * operations that are dangerous to cancel, such as close (which would
6214 * cause a leak if cancelled before being run).
6216 * GSimpleAsyncResult can integrate into GLib's event loop, #GMainLoop,
6217 * or it can use #GThread<!-- -->s.
6218 * g_simple_async_result_complete() will finish an I/O task directly
6219 * from the point where it is called. g_simple_async_result_complete_in_idle()
6220 * will finish it from an idle handler in the <link
6221 * linkend="g-main-context-push-thread-default">thread-default main
6222 * context</link>. g_simple_async_result_run_in_thread() will run the
6223 * job in a separate thread and then deliver the result to the
6224 * thread-default main context.
6226 * To set the results of an asynchronous function,
6227 * g_simple_async_result_set_op_res_gpointer(),
6228 * g_simple_async_result_set_op_res_gboolean(), and
6229 * g_simple_async_result_set_op_res_gssize()
6230 * are provided, setting the operation's result to a gpointer, gboolean, or
6231 * gssize, respectively.
6233 * Likewise, to get the result of an asynchronous function,
6234 * g_simple_async_result_get_op_res_gpointer(),
6235 * g_simple_async_result_get_op_res_gboolean(), and
6236 * g_simple_async_result_get_op_res_gssize() are
6237 * provided, getting the operation's result as a gpointer, gboolean, and
6238 * gssize, respectively.
6240 * For the details of the requirements implementations must respect, see
6241 * #GAsyncResult. A typical implementation of an asynchronous operation
6242 * using GSimpleAsyncResult looks something like this:
6246 * baked_cb (Cake *cake,
6247 * gpointer user_data)
6249 * /* In this example, this callback is not given a reference to the cake, so
6250 * * the GSimpleAsyncResult has to take a reference to it.
6252 * GSimpleAsyncResult *result = user_data;
6255 * g_simple_async_result_set_error (result,
6257 * BAKER_ERROR_NO_FLOUR,
6258 * "Go to the supermarket");
6260 * g_simple_async_result_set_op_res_gpointer (result,
6261 * g_object_ref (cake),
6265 * /* In this example, we assume that baked_cb is called as a callback from
6266 * * the mainloop, so it's safe to complete the operation synchronously here.
6267 * * If, however, _baker_prepare_cake () might call its callback without
6268 * * first returning to the mainloop — inadvisable, but some APIs do so —
6269 * * we would need to use g_simple_async_result_complete_in_idle().
6271 * g_simple_async_result_complete (result);
6272 * g_object_unref (result);
6276 * baker_bake_cake_async (Baker *self,
6278 * GAsyncReadyCallback callback,
6279 * gpointer user_data)
6281 * GSimpleAsyncResult *simple;
6286 * g_simple_async_report_error_in_idle (G_OBJECT (self),
6290 * BAKER_ERROR_TOO_SMALL,
6291 * "%ucm radius cakes are silly",
6296 * simple = g_simple_async_result_new (G_OBJECT (self),
6299 * baker_bake_cake_async);
6300 * cake = _baker_get_cached_cake (self, radius);
6304 * g_simple_async_result_set_op_res_gpointer (simple,
6305 * g_object_ref (cake),
6307 * g_simple_async_result_complete_in_idle (simple);
6308 * g_object_unref (simple);
6309 * /* Drop the reference returned by _baker_get_cached_cake(); the
6310 * * GSimpleAsyncResult has taken its own reference.
6312 * g_object_unref (cake);
6316 * _baker_prepare_cake (self, radius, baked_cb, simple);
6320 * baker_bake_cake_finish (Baker *self,
6321 * GAsyncResult *result,
6324 * GSimpleAsyncResult *simple;
6327 * g_return_val_if_fail (g_simple_async_result_is_valid (result,
6329 * baker_bake_cake_async),
6332 * simple = (GSimpleAsyncResult *) result;
6334 * if (g_simple_async_result_propagate_error (simple, error))
6337 * cake = CAKE (g_simple_async_result_get_op_res_gpointer (simple));
6338 * return g_object_ref (cake);
6345 * SECTION:gsimplepermission
6346 * @title: GSimplePermission
6347 * @short_description: A GPermission that doesn't change value
6349 * #GSimplePermission is a trivial implementation of #GPermission that
6350 * represents a permission that is either always or never allowed. The
6351 * value is given at construction and doesn't change.
6353 * Calling request or release will result in errors.
6359 * @short_description: Low-level socket object
6360 * @include: gio/gio.h
6361 * @see_also: #GInitable
6363 * A #GSocket is a low-level networking primitive. It is a more or less
6364 * direct mapping of the BSD socket API in a portable GObject based API.
6365 * It supports both the UNIX socket implementations and winsock2 on Windows.
6367 * #GSocket is the platform independent base upon which the higher level
6368 * network primitives are based. Applications are not typically meant to
6369 * use it directly, but rather through classes like #GSocketClient,
6370 * #GSocketService and #GSocketConnection. However there may be cases where
6371 * direct use of #GSocket is useful.
6373 * #GSocket implements the #GInitable interface, so if it is manually constructed
6374 * by e.g. g_object_new() you must call g_initable_init() and check the
6375 * results before using the object. This is done automatically in
6376 * g_socket_new() and g_socket_new_from_fd(), so these functions can return
6379 * Sockets operate in two general modes, blocking or non-blocking. When
6380 * in blocking mode all operations block until the requested operation
6381 * is finished or there is an error. In non-blocking mode all calls that
6382 * would block return immediately with a %G_IO_ERROR_WOULD_BLOCK error.
6383 * To know when a call would successfully run you can call g_socket_condition_check(),
6384 * or g_socket_condition_wait(). You can also use g_socket_create_source() and
6385 * attach it to a #GMainContext to get callbacks when I/O is possible.
6386 * Note that all sockets are always set to non blocking mode in the system, and
6387 * blocking mode is emulated in GSocket.
6389 * When working in non-blocking mode applications should always be able to
6390 * handle getting a %G_IO_ERROR_WOULD_BLOCK error even when some other
6391 * function said that I/O was possible. This can easily happen in case
6392 * of a race condition in the application, but it can also happen for other
6393 * reasons. For instance, on Windows a socket is always seen as writable
6394 * until a write returns %G_IO_ERROR_WOULD_BLOCK.
6396 * #GSocket<!-- -->s can be either connection oriented or datagram based.
6397 * For connection oriented types you must first establish a connection by
6398 * either connecting to an address or accepting a connection from another
6399 * address. For connectionless socket types the target/source address is
6400 * specified or received in each I/O operation.
6402 * All socket file descriptors are set to be close-on-exec.
6404 * Note that creating a #GSocket causes the signal %SIGPIPE to be
6405 * ignored for the remainder of the program. If you are writing a
6406 * command-line utility that uses #GSocket, you may need to take into
6407 * account the fact that your program will not automatically be killed
6408 * if it tries to write to %stdout after it has been closed.
6415 * SECTION:gsocketaddress
6416 * @short_description: Abstract base class representing endpoints for socket communication
6418 * #GSocketAddress is the equivalent of <type>struct sockaddr</type>
6419 * in the BSD sockets API. This is an abstract class; use
6420 * #GInetSocketAddress for internet sockets, or #GUnixSocketAddress
6421 * for UNIX domain sockets.
6426 * SECTION:gsocketclient
6427 * @short_description: Helper for connecting to a network service
6428 * @include: gio/gio.h
6429 * @see_also: #GSocketConnection, #GSocketListener
6431 * #GSocketClient is a lightweight high-level utility class for connecting to
6432 * a network host using a connection oriented socket type.
6434 * You create a #GSocketClient object, set any options you want, and then
6435 * call a sync or async connect operation, which returns a #GSocketConnection
6436 * subclass on success.
6438 * The type of the #GSocketConnection object returned depends on the type of
6439 * the underlying socket that is in use. For instance, for a TCP/IP connection
6440 * it will be a #GTcpConnection.
6442 * As #GSocketClient is a lightweight object, you don't need to cache it. You
6443 * can just create a new one any time you need one.
6450 * SECTION:gsocketconnectable
6451 * @short_description: Interface for potential socket endpoints
6453 * Objects that describe one or more potential socket endpoints
6454 * implement #GSocketConnectable. Callers can then use
6455 * g_socket_connectable_enumerate() to get a #GSocketAddressEnumerator
6456 * to try out each socket address in turn until one succeeds, as shown
6457 * in the sample code below.
6460 * MyConnectionType *
6461 * connect_to_host (const char *hostname,
6463 * GCancellable *cancellable,
6466 * MyConnection *conn = NULL;
6467 * GSocketConnectable *addr;
6468 * GSocketAddressEnumerator *enumerator;
6469 * GSocketAddress *sockaddr;
6470 * GError *conn_error = NULL;
6472 * addr = g_network_address_new ("www.gnome.org", 80);
6473 * enumerator = g_socket_connectable_enumerate (addr);
6474 * g_object_unref (addr);
6476 * /<!-- -->* Try each sockaddr until we succeed. Record the first
6477 * * connection error, but not any further ones (since they'll probably
6478 * * be basically the same as the first).
6480 * while (!conn && (sockaddr = g_socket_address_enumerator_next (enumerator, cancellable, error))
6482 * conn = connect_to_sockaddr (sockaddr, conn_error ? NULL : &conn_error);
6483 * g_object_unref (sockaddr);
6485 * g_object_unref (enumerator);
6491 * /<!-- -->* We couldn't connect to the first address, but we succeeded
6492 * * in connecting to a later address.
6494 * g_error_free (conn_error);
6500 * /<!-- -->* Either the initial lookup failed, or else the caller
6504 * g_error_free (conn_error);
6509 * g_error_propagate (error, conn_error);
6518 * SECTION:gsocketconnection
6519 * @short_description: A socket connection
6520 * @include: gio/gio.h
6521 * @see_also: #GIOStream, #GSocketClient, #GSocketListener
6523 * #GSocketConnection is a #GIOStream for a connected socket. They
6524 * can be created either by #GSocketClient when connecting to a host,
6525 * or by #GSocketListener when accepting a new client.
6527 * The type of the #GSocketConnection object returned from these calls
6528 * depends on the type of the underlying socket that is in use. For
6529 * instance, for a TCP/IP connection it will be a #GTcpConnection.
6531 * Choosing what type of object to construct is done with the socket
6532 * connection factory, and it is possible for 3rd parties to register
6533 * custom socket connection types for specific combination of socket
6534 * family/type/protocol using g_socket_connection_factory_register_type().
6541 * SECTION:gsocketcontrolmessage
6542 * @title: GSocketControlMessage
6543 * @short_description: A GSocket control message
6544 * @see_also: #GSocket.
6546 * A #GSocketControlMessage is a special-purpose utility message that
6547 * can be sent to or received from a #GSocket. These types of
6548 * messages are often called "ancillary data".
6550 * The message can represent some sort of special instruction to or
6551 * information from the socket or can represent a special kind of
6552 * transfer to the peer (for example, sending a file description over
6555 * These messages are sent with g_socket_send_message() and received
6556 * with g_socket_receive_message().
6558 * To extend the set of control message that can be sent, subclass this
6559 * class and override the get_size, get_level, get_type and serialize
6562 * To extend the set of control messages that can be received, subclass
6563 * this class and implement the deserialize method. Also, make sure your
6564 * class is registered with the GType typesystem before calling
6565 * g_socket_receive_message() to read such a message.
6572 * SECTION:gsocketlistener
6573 * @title: GSocketListener
6574 * @short_description: Helper for accepting network client connections
6575 * @see_also: #GThreadedSocketService, #GSocketService.
6577 * A #GSocketListener is an object that keeps track of a set
6578 * of server sockets and helps you accept sockets from any of the
6579 * socket, either sync or async.
6581 * If you want to implement a network server, also look at #GSocketService
6582 * and #GThreadedSocketService which are subclass of #GSocketListener
6583 * that makes this even easier.
6590 * SECTION:gsocketservice
6591 * @title: GSocketService
6592 * @short_description: Make it easy to implement a network service
6593 * @see_also: #GThreadedSocketService, #GSocketListener.
6595 * A #GSocketService is an object that represents a service that
6596 * is provided to the network or over local sockets. When a new
6597 * connection is made to the service the #GSocketService::incoming
6598 * signal is emitted.
6600 * A #GSocketService is a subclass of #GSocketListener and you need
6601 * to add the addresses you want to accept connections on with the
6602 * #GSocketListener APIs.
6604 * There are two options for implementing a network service based on
6605 * #GSocketService. The first is to create the service using
6606 * g_socket_service_new() and to connect to the #GSocketService::incoming
6607 * signal. The second is to subclass #GSocketService and override the
6608 * default signal handler implementation.
6610 * In either case, the handler must immediately return, or else it
6611 * will block additional incoming connections from being serviced.
6612 * If you are interested in writing connection handlers that contain
6613 * blocking code then see #GThreadedSocketService.
6615 * The socket service runs on the main loop of the <link
6616 * linkend="g-main-context-push-thread-default-context">thread-default
6617 * context</link> of the thread it is created in, and is not
6618 * threadsafe in general. However, the calls to start and stop the
6619 * service are thread-safe so these can be used from threads that
6620 * handle incoming clients.
6627 * SECTION:gsrvtarget
6628 * @short_description: DNS SRV record target
6629 * @include: gio/gio.h
6631 * SRV (service) records are used by some network protocols to provide
6632 * service-specific aliasing and load-balancing. For example, XMPP
6633 * (Jabber) uses SRV records to locate the XMPP server for a domain;
6634 * rather than connecting directly to "example.com" or assuming a
6635 * specific server hostname like "xmpp.example.com", an XMPP client
6636 * would look up the "xmpp-client" SRV record for "example.com", and
6637 * then connect to whatever host was pointed to by that record.
6639 * You can use g_resolver_lookup_service() or
6640 * g_resolver_lookup_service_async() to find the #GSrvTarget<!-- -->s
6641 * for a given service. However, if you are simply planning to connect
6642 * to the remote service, you can use #GNetworkService's
6643 * #GSocketConnectable interface and not need to worry about
6644 * #GSrvTarget at all.
6649 * SECTION:gtcpconnection
6650 * @title: GTcpConnection
6651 * @short_description: A TCP GSocketConnection
6652 * @see_also: #GSocketConnection.
6654 * This is the subclass of #GSocketConnection that is created
6655 * for TCP/IP sockets.
6662 * SECTION:gtcpwrapperconnection
6663 * @title: GTcpWrapperConnection
6664 * @short_description: wrapper for non-GSocketConnection-based, GSocket-based GIOStreams
6665 * @see_also: #GSocketConnection.
6667 * A #GTcpWrapperConnection can be used to wrap a #GIOStream that is
6668 * based on a #GSocket, but which is not actually a
6669 * #GSocketConnection. This is used by #GSocketClient so that it can
6670 * always return a #GSocketConnection, even when the connection it has
6671 * actually created is not directly a #GSocketConnection.
6679 * @short_description: D-Bus testing helper
6680 * @include: gio/gio.h
6682 * Helper to test D-Bus code wihtout messing up with user' session bus.
6687 * SECTION:gthemedicon
6688 * @short_description: Icon theming support
6689 * @include: gio/gio.h
6690 * @see_also: #GIcon, #GLoadableIcon
6692 * #GThemedIcon is an implementation of #GIcon that supports icon themes.
6693 * #GThemedIcon contains a list of all of the icons present in an icon
6694 * theme, so that icons can be looked up quickly. #GThemedIcon does
6695 * not provide actual pixmaps for icons, just the icon names.
6696 * Ideally something like gtk_icon_theme_choose_icon() should be used to
6697 * resolve the list of names so that fallback icons work nicely with
6698 * themes that inherit other themes.
6703 * SECTION:gthreadedsocketservice
6704 * @title: GThreadedSocketService
6705 * @short_description: A threaded GSocketService
6706 * @see_also: #GSocketService.
6708 * A #GThreadedSocketService is a simple subclass of #GSocketService
6709 * that handles incoming connections by creating a worker thread and
6710 * dispatching the connection to it by emitting the
6711 * #GThreadedSocketService::run signal in the new thread.
6713 * The signal handler may perform blocking IO and need not return
6714 * until the connection is closed.
6716 * The service is implemented using a thread pool, so there is a
6717 * limited amount of threads available to serve incoming requests.
6718 * The service automatically stops the #GSocketService from accepting
6719 * new connections when all threads are busy.
6721 * As with #GSocketService, you may connect to #GThreadedSocketService::run,
6722 * or subclass and override the default handler.
6728 * @title: TLS Overview
6729 * @short_description: TLS (aka SSL) support for GSocketConnection
6730 * @include: gio/gio.h
6732 * #GTlsConnection and related classes provide TLS (Transport Layer
6733 * Security, previously known as SSL, Secure Sockets Layer) support for
6734 * gio-based network streams.
6736 * In the simplest case, for a client connection, you can just set the
6737 * #GSocketClient:tls flag on a #GSocketClient, and then any
6738 * connections created by that client will have TLS negotiated
6739 * automatically, using appropriate default settings, and rejecting
6740 * any invalid or self-signed certificates (unless you change that
6741 * default by setting the #GSocketClient:tls-validation-flags
6742 * property). The returned object will be a #GTcpWrapperConnection,
6743 * which wraps the underlying #GTlsClientConnection.
6745 * For greater control, you can create your own #GTlsClientConnection,
6746 * wrapping a #GSocketConnection (or an arbitrary #GIOStream with
6747 * pollable input and output streams) and then connect to its signals,
6748 * such as #GTlsConnection::accept-certificate, before starting the
6751 * Server-side TLS is similar, using #GTlsServerConnection. At the
6752 * moment, there is no support for automatically wrapping server-side
6753 * connections in the way #GSocketClient does for client-side
6759 * SECTION:gtlsbackend
6760 * @title: GTlsBackend
6761 * @short_description: TLS backend implementation
6762 * @include: gio/gio.h
6769 * SECTION:gtlscertificate
6770 * @title: GTlsCertificate
6771 * @short_description: TLS certificate
6772 * @see_also: #GTlsConnection
6774 * A certificate used for TLS authentication and encryption.
6775 * This can represent either a public key only (eg, the certificate
6776 * received by a client from a server), or the combination of
6777 * a public key and a private key (which is needed when acting as a
6778 * #GTlsServerConnection).
6785 * SECTION:gtlsclientconnection
6786 * @short_description: TLS client-side connection
6787 * @include: gio/gio.h
6789 * #GTlsClientConnection is the client-side subclass of
6790 * #GTlsConnection, representing a client-side TLS connection.
6795 * SECTION:gtlsconnection
6796 * @short_description: TLS connection type
6797 * @include: gio/gio.h
6799 * #GTlsConnection is the base TLS connection class type, which wraps
6800 * a #GIOStream and provides TLS encryption on top of it. Its
6801 * subclasses, #GTlsClientConnection and #GTlsServerConnection,
6802 * implement client-side and server-side TLS, respectively.
6809 * SECTION:gtlsdatabase
6810 * @short_description: TLS database type
6811 * @include: gio/gio.h
6813 * #GTlsDatabase is used to lookup certificates and other information
6814 * from a certificate or key store. It is an abstract base class which
6815 * TLS library specific subtypes override.
6817 * Most common client applications will not directly interact with
6818 * #GTlsDatabase. It is used internally by #GTlsConnection.
6825 * SECTION:gtlsfiledatabase
6826 * @short_description: TLS file based database type
6827 * @include: gio/gio.h
6829 * #GTlsFileDatabase is implemented by #GTlsDatabase objects which load
6830 * their certificate information from a file. It is in interface which
6831 * TLS library specific subtypes implement.
6838 * SECTION:gtlsinteraction
6839 * @short_description: Interaction with the user during TLS operations.
6840 * @include: gio/gio.h
6842 * #GTlsInteraction provides a mechanism for the TLS connection and database
6843 * code to interact with the user. It can be used to ask the user for passwords.
6845 * To use a #GTlsInteraction with a TLS connection use
6846 * g_tls_connection_set_interaction().
6848 * Callers should instantiate a derived class that implements the various
6849 * interaction methods to show the required dialogs.
6851 * Callers should use the 'invoke' functions like
6852 * g_tls_interaction_invoke_ask_password() to run interaction methods. These
6853 * functions make sure that the interaction is invoked in the main loop
6854 * and not in the current thread, if the current thread is not running the
6857 * Derived classes can choose to implement whichever interactions methods they'd
6858 * like to support by overriding those virtual methods in their class
6859 * initialization function. Any interactions not implemented will return
6860 * %G_TLS_INTERACTION_UNHANDLED. If a derived class implements an async method,
6861 * it must also implement the corresponding finish method.
6866 * SECTION:gtlspassword
6867 * @title: GTlsPassword
6868 * @short_description: TLS Passwords for prompting
6869 * @include: gio/gio.h
6871 * Holds a password used in TLS.
6876 * SECTION:gtlsserverconnection
6877 * @short_description: TLS server-side connection
6878 * @include: gio/gio.h
6880 * #GTlsServerConnection is the server-side subclass of #GTlsConnection,
6881 * representing a server-side TLS connection.
6888 * SECTION:gunixconnection
6889 * @title: GUnixConnection
6890 * @short_description: A UNIX domain GSocketConnection
6891 * @include: gio/gunixconnection.h
6892 * @see_also: #GSocketConnection.
6894 * This is the subclass of #GSocketConnection that is created
6895 * for UNIX domain sockets.
6897 * It contains functions to do some of the UNIX socket specific
6898 * functionality like passing file descriptors.
6900 * Note that <filename><gio/gunixconnection.h></filename> belongs to
6901 * the UNIX-specific GIO interfaces, thus you have to use the
6902 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
6909 * SECTION:gunixcredentialsmessage
6910 * @title: GUnixCredentialsMessage
6911 * @short_description: A GSocketControlMessage containing credentials
6912 * @include: gio/gunixcredentialsmessage.h
6913 * @see_also: #GUnixConnection, #GSocketControlMessage
6915 * This #GSocketControlMessage contains a #GCredentials instance. It
6916 * may be sent using g_socket_send_message() and received using
6917 * g_socket_receive_message() over UNIX sockets (ie: sockets in the
6918 * %G_SOCKET_FAMILY_UNIX family).
6920 * For an easier way to send and receive credentials over
6921 * stream-oriented UNIX sockets, see
6922 * g_unix_connection_send_credentials() and
6923 * g_unix_connection_receive_credentials(). To receive credentials of
6924 * a foreign process connected to a socket, use
6925 * g_socket_get_credentials().
6930 * SECTION:gunixfdlist
6931 * @title: GUnixFDList
6932 * @short_description: An object containing a set of UNIX file descriptors
6933 * @include: gio/gunixfdlist.h
6934 * @see_also: #GUnixFDMessage
6936 * A #GUnixFDList contains a list of file descriptors. It owns the file
6937 * descriptors that it contains, closing them when finalized.
6939 * It may be wrapped in a #GUnixFDMessage and sent over a #GSocket in
6940 * the %G_SOCKET_ADDRESS_UNIX family by using g_socket_send_message()
6941 * and received using g_socket_receive_message().
6943 * Note that <filename><gio/gunixfdlist.h></filename> belongs to
6944 * the UNIX-specific GIO interfaces, thus you have to use the
6945 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
6950 * SECTION:gunixfdmessage
6951 * @title: GUnixFDMessage
6952 * @short_description: A GSocketControlMessage containing a GUnixFDList
6953 * @include: gio/gunixfdmessage.h
6954 * @see_also: #GUnixConnection, #GUnixFDList, #GSocketControlMessage
6956 * This #GSocketControlMessage contains a #GUnixFDList.
6957 * It may be sent using g_socket_send_message() and received using
6958 * g_socket_receive_message() over UNIX sockets (ie: sockets in the
6959 * %G_SOCKET_ADDRESS_UNIX family). The file descriptors are copied
6960 * between processes by the kernel.
6962 * For an easier way to send and receive file descriptors over
6963 * stream-oriented UNIX sockets, see g_unix_connection_send_fd() and
6964 * g_unix_connection_receive_fd().
6966 * Note that <filename><gio/gunixfdmessage.h></filename> belongs to
6967 * the UNIX-specific GIO interfaces, thus you have to use the
6968 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
6973 * SECTION:gunixinputstream
6974 * @short_description: Streaming input operations for UNIX file descriptors
6975 * @include: gio/gunixinputstream.h
6976 * @see_also: #GInputStream
6978 * #GUnixInputStream implements #GInputStream for reading from a UNIX
6979 * file descriptor, including asynchronous operations. (If the file
6980 * descriptor refers to a socket or pipe, this will use poll() to do
6981 * asynchronous I/O. If it refers to a regular file, it will fall back
6982 * to doing asynchronous I/O in another thread.)
6984 * Note that <filename><gio/gunixinputstream.h></filename> belongs
6985 * to the UNIX-specific GIO interfaces, thus you have to use the
6986 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
6991 * SECTION:gunixmounts
6992 * @include: gio/gunixmounts.h
6993 * @short_description: UNIX mounts
6995 * Routines for managing mounted UNIX mount points and paths.
6997 * Note that <filename><gio/gunixmounts.h></filename> belongs to the
6998 * UNIX-specific GIO interfaces, thus you have to use the
6999 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7004 * SECTION:gunixoutputstream
7005 * @short_description: Streaming output operations for UNIX file descriptors
7006 * @include: gio/gunixoutputstream.h
7007 * @see_also: #GOutputStream
7009 * #GUnixOutputStream implements #GOutputStream for writing to a UNIX
7010 * file descriptor, including asynchronous operations. (If the file
7011 * descriptor refers to a socket or pipe, this will use poll() to do
7012 * asynchronous I/O. If it refers to a regular file, it will fall back
7013 * to doing asynchronous I/O in another thread.)
7015 * Note that <filename><gio/gunixoutputstream.h></filename> belongs
7016 * to the UNIX-specific GIO interfaces, thus you have to use the
7017 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7022 * SECTION:gunixsocketaddress
7023 * @short_description: UNIX GSocketAddress
7024 * @include: gio/gunixsocketaddress.h
7026 * Support for UNIX-domain (also known as local) sockets.
7028 * UNIX domain sockets are generally visible in the filesystem.
7029 * However, some systems support abstract socket names which are not
7030 * visible in the filesystem and not affected by the filesystem
7031 * permissions, visibility, etc. Currently this is only supported
7032 * under Linux. If you attempt to use abstract sockets on other
7033 * systems, function calls may return %G_IO_ERROR_NOT_SUPPORTED
7034 * errors. You can use g_unix_socket_address_abstract_names_supported()
7035 * to see if abstract names are supported.
7037 * Note that <filename><gio/gunixsocketaddress.h></filename> belongs to
7038 * the UNIX-specific GIO interfaces, thus you have to use the
7039 * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7045 * @short_description: Virtual File System
7046 * @include: gio/gio.h
7048 * Entry point for using GIO functionality.
7054 * @short_description: Volume management
7055 * @include: gio/gio.h
7057 * The #GVolume interface represents user-visible objects that can be
7058 * mounted. Note, when porting from GnomeVFS, #GVolume is the moral
7059 * equivalent of #GnomeVFSDrive.
7061 * Mounting a #GVolume instance is an asynchronous operation. For more
7062 * information about asynchronous operations, see #GAsyncResult and
7063 * #GSimpleAsyncResult. To mount a #GVolume, first call
7064 * g_volume_mount() with (at least) the #GVolume instance, optionally
7065 * a #GMountOperation object and a #GAsyncReadyCallback.
7067 * Typically, one will only want to pass %NULL for the
7068 * #GMountOperation if automounting all volumes when a desktop session
7069 * starts since it's not desirable to put up a lot of dialogs asking
7072 * The callback will be fired when the operation has resolved (either
7073 * with success or failure), and a #GAsyncReady structure will be
7074 * passed to the callback. That callback should then call
7075 * g_volume_mount_finish() with the #GVolume instance and the
7076 * #GAsyncReady data to see if the operation was completed
7077 * successfully. If an @error is present when g_volume_mount_finish()
7078 * is called, then it will be filled with any error information.
7080 * <para id="volume-identifier">
7081 * It is sometimes necessary to directly access the underlying
7082 * operating system object behind a volume (e.g. for passing a volume
7083 * to an application via the commandline). For this purpose, GIO
7084 * allows to obtain an 'identifier' for the volume. There can be
7085 * different kinds of identifiers, such as Hal UDIs, filesystem labels,
7086 * traditional Unix devices (e.g. <filename>/dev/sda2</filename>),
7087 * uuids. GIO uses predefind strings as names for the different kinds
7088 * of identifiers: #G_VOLUME_IDENTIFIER_KIND_HAL_UDI,
7089 * #G_VOLUME_IDENTIFIER_KIND_LABEL, etc. Use g_volume_get_identifier()
7090 * to obtain an identifier for a volume.
7093 * Note that #G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available
7094 * when the gvfs hal volume monitor is in use. Other volume monitors
7095 * will generally be able to provide the #G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE
7096 * identifier, which can be used to obtain a hal device by means of
7097 * libhal_manager_find_device_string_match().
7102 * SECTION:gvolumemonitor
7103 * @short_description: Volume Monitor
7104 * @include: gio/gio.h
7105 * @see_also: #GFileMonitor
7107 * #GVolumeMonitor is for listing the user interesting devices and volumes
7108 * on the computer. In other words, what a file selector or file manager
7109 * would show in a sidebar.
7111 * #GVolumeMonitor is not <link
7112 * linkend="g-main-context-push-thread-default">thread-default-context
7113 * aware</link>, and so should not be used other than from the main
7114 * thread, with no thread-default-context active.
7119 * SECTION:gwin32inputstream
7120 * @short_description: Streaming input operations for Windows file handles
7121 * @include: gio/gwin32inputstream.h
7122 * @see_also: #GInputStream
7124 * #GWin32InputStream implements #GInputStream for reading from a
7125 * Windows file handle.
7127 * Note that <filename><gio/gwin32inputstream.h></filename> belongs
7128 * to the Windows-specific GIO interfaces, thus you have to use the
7129 * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
7134 * SECTION:gwin32outputstream
7135 * @short_description: Streaming output operations for Windows file handles
7136 * @include: gio/gwin32outputstream.h
7137 * @see_also: #GOutputStream
7139 * #GWin32OutputStream implements #GOutputStream for writing to a
7140 * Windows file handle.
7142 * Note that <filename><gio/gwin32outputstream.h></filename> belongs
7143 * to the Windows-specific GIO interfaces, thus you have to use the
7144 * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
7149 * SECTION:gzcompressor
7150 * @short_description: Zlib compressor
7151 * @include: gio/gio.h
7153 * #GZlibCompressor is an implementation of #GConverter that
7154 * compresses data using zlib.
7159 * SECTION:gzdecompressor
7160 * @short_description: Zlib decompressor
7161 * @include: gio/gio.h
7163 * #GZlibDecompressor is an implementation of #GConverter that
7164 * decompresses data compressed with zlib.
7169 * _GFreedesktopDBus:
7171 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
7176 * _GFreedesktopDBus::handle-add-match:
7177 * @object: A #_GFreedesktopDBus.
7178 * @invocation: A #GDBusMethodInvocation.
7179 * @arg_rule: Argument passed by remote caller.
7181 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.AddMatch">AddMatch()</link> D-Bus method.
7183 * 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.
7185 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7190 * _GFreedesktopDBus::handle-get-connection-selinux-security-context:
7191 * @object: A #_GFreedesktopDBus.
7192 * @invocation: A #GDBusMethodInvocation.
7193 * @arg_name: Argument passed by remote caller.
7195 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionSELinuxSecurityContext">GetConnectionSELinuxSecurityContext()</link> D-Bus method.
7197 * 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.
7199 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7204 * _GFreedesktopDBus::handle-get-connection-unix-process-id:
7205 * @object: A #_GFreedesktopDBus.
7206 * @invocation: A #GDBusMethodInvocation.
7207 * @arg_name: Argument passed by remote caller.
7209 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixProcessID">GetConnectionUnixProcessID()</link> D-Bus method.
7211 * 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.
7213 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7218 * _GFreedesktopDBus::handle-get-connection-unix-user:
7219 * @object: A #_GFreedesktopDBus.
7220 * @invocation: A #GDBusMethodInvocation.
7221 * @arg_name: Argument passed by remote caller.
7223 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixUser">GetConnectionUnixUser()</link> D-Bus method.
7225 * 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.
7227 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7232 * _GFreedesktopDBus::handle-get-id:
7233 * @object: A #_GFreedesktopDBus.
7234 * @invocation: A #GDBusMethodInvocation.
7236 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetId">GetId()</link> D-Bus method.
7238 * 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.
7240 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7245 * _GFreedesktopDBus::handle-get-name-owner:
7246 * @object: A #_GFreedesktopDBus.
7247 * @invocation: A #GDBusMethodInvocation.
7248 * @arg_name: Argument passed by remote caller.
7250 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.GetNameOwner">GetNameOwner()</link> D-Bus method.
7252 * 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.
7254 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7259 * _GFreedesktopDBus::handle-hello:
7260 * @object: A #_GFreedesktopDBus.
7261 * @invocation: A #GDBusMethodInvocation.
7263 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.Hello">Hello()</link> D-Bus method.
7265 * 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.
7267 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7272 * _GFreedesktopDBus::handle-list-activatable-names:
7273 * @object: A #_GFreedesktopDBus.
7274 * @invocation: A #GDBusMethodInvocation.
7276 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListActivatableNames">ListActivatableNames()</link> D-Bus method.
7278 * 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.
7280 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7285 * _GFreedesktopDBus::handle-list-names:
7286 * @object: A #_GFreedesktopDBus.
7287 * @invocation: A #GDBusMethodInvocation.
7289 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListNames">ListNames()</link> D-Bus method.
7291 * 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.
7293 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7298 * _GFreedesktopDBus::handle-list-queued-owners:
7299 * @object: A #_GFreedesktopDBus.
7300 * @invocation: A #GDBusMethodInvocation.
7301 * @arg_name: Argument passed by remote caller.
7303 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ListQueuedOwners">ListQueuedOwners()</link> D-Bus method.
7305 * 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.
7307 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7312 * _GFreedesktopDBus::handle-name-has-owner:
7313 * @object: A #_GFreedesktopDBus.
7314 * @invocation: A #GDBusMethodInvocation.
7315 * @arg_name: Argument passed by remote caller.
7317 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.NameHasOwner">NameHasOwner()</link> D-Bus method.
7319 * 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.
7321 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7326 * _GFreedesktopDBus::handle-release-name:
7327 * @object: A #_GFreedesktopDBus.
7328 * @invocation: A #GDBusMethodInvocation.
7329 * @arg_name: Argument passed by remote caller.
7331 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ReleaseName">ReleaseName()</link> D-Bus method.
7333 * 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.
7335 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7340 * _GFreedesktopDBus::handle-reload-config:
7341 * @object: A #_GFreedesktopDBus.
7342 * @invocation: A #GDBusMethodInvocation.
7344 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.ReloadConfig">ReloadConfig()</link> D-Bus method.
7346 * 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.
7348 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7353 * _GFreedesktopDBus::handle-remove-match:
7354 * @object: A #_GFreedesktopDBus.
7355 * @invocation: A #GDBusMethodInvocation.
7356 * @arg_rule: Argument passed by remote caller.
7358 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.RemoveMatch">RemoveMatch()</link> D-Bus method.
7360 * 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.
7362 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7367 * _GFreedesktopDBus::handle-request-name:
7368 * @object: A #_GFreedesktopDBus.
7369 * @invocation: A #GDBusMethodInvocation.
7370 * @arg_name: Argument passed by remote caller.
7371 * @arg_flags: Argument passed by remote caller.
7373 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.RequestName">RequestName()</link> D-Bus method.
7375 * 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.
7377 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7382 * _GFreedesktopDBus::handle-start-service-by-name:
7383 * @object: A #_GFreedesktopDBus.
7384 * @invocation: A #GDBusMethodInvocation.
7385 * @arg_name: Argument passed by remote caller.
7386 * @arg_flags: Argument passed by remote caller.
7388 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.StartServiceByName">StartServiceByName()</link> D-Bus method.
7390 * 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.
7392 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7397 * _GFreedesktopDBus::handle-update-activation-environment:
7398 * @object: A #_GFreedesktopDBus.
7399 * @invocation: A #GDBusMethodInvocation.
7400 * @arg_environment: Argument passed by remote caller.
7402 * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-DBus.UpdateActivationEnvironment">UpdateActivationEnvironment()</link> D-Bus method.
7404 * 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.
7406 * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
7411 * _GFreedesktopDBus::name-acquired:
7412 * @object: A #_GFreedesktopDBus.
7413 * @arg_name: Argument.
7415 * 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.
7417 * 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.
7422 * _GFreedesktopDBus::name-lost:
7423 * @object: A #_GFreedesktopDBus.
7424 * @arg_name: Argument.
7426 * 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.
7428 * 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.
7433 * _GFreedesktopDBus::name-owner-changed:
7434 * @object: A #_GFreedesktopDBus.
7435 * @arg_name: Argument.
7436 * @arg_old_owner: Argument.
7437 * @arg_new_owner: Argument.
7439 * 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.
7441 * 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.
7446 * _GFreedesktopDBusIface:
7447 * @parent_iface: The parent interface.
7448 * @handle_add_match: Handler for the #_GFreedesktopDBus::handle-add-match signal.
7449 * @handle_get_connection_selinux_security_context: Handler for the #_GFreedesktopDBus::handle-get-connection-selinux-security-context signal.
7450 * @handle_get_connection_unix_process_id: Handler for the #_GFreedesktopDBus::handle-get-connection-unix-process-id signal.
7451 * @handle_get_connection_unix_user: Handler for the #_GFreedesktopDBus::handle-get-connection-unix-user signal.
7452 * @handle_get_id: Handler for the #_GFreedesktopDBus::handle-get-id signal.
7453 * @handle_get_name_owner: Handler for the #_GFreedesktopDBus::handle-get-name-owner signal.
7454 * @handle_hello: Handler for the #_GFreedesktopDBus::handle-hello signal.
7455 * @handle_list_activatable_names: Handler for the #_GFreedesktopDBus::handle-list-activatable-names signal.
7456 * @handle_list_names: Handler for the #_GFreedesktopDBus::handle-list-names signal.
7457 * @handle_list_queued_owners: Handler for the #_GFreedesktopDBus::handle-list-queued-owners signal.
7458 * @handle_name_has_owner: Handler for the #_GFreedesktopDBus::handle-name-has-owner signal.
7459 * @handle_release_name: Handler for the #_GFreedesktopDBus::handle-release-name signal.
7460 * @handle_reload_config: Handler for the #_GFreedesktopDBus::handle-reload-config signal.
7461 * @handle_remove_match: Handler for the #_GFreedesktopDBus::handle-remove-match signal.
7462 * @handle_request_name: Handler for the #_GFreedesktopDBus::handle-request-name signal.
7463 * @handle_start_service_by_name: Handler for the #_GFreedesktopDBus::handle-start-service-by-name signal.
7464 * @handle_update_activation_environment: Handler for the #_GFreedesktopDBus::handle-update-activation-environment signal.
7465 * @name_acquired: Handler for the #_GFreedesktopDBus::name-acquired signal.
7466 * @name_lost: Handler for the #_GFreedesktopDBus::name-lost signal.
7467 * @name_owner_changed: Handler for the #_GFreedesktopDBus::name-owner-changed signal.
7469 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
7474 * _GFreedesktopDBusProxy:
7476 * The #_GFreedesktopDBusProxy structure contains only private data and should only be accessed using the provided API.
7481 * _GFreedesktopDBusProxyClass:
7482 * @parent_class: The parent class.
7484 * Class structure for #_GFreedesktopDBusProxy.
7489 * _GFreedesktopDBusSkeleton:
7491 * The #_GFreedesktopDBusSkeleton structure contains only private data and should only be accessed using the provided API.
7496 * _GFreedesktopDBusSkeletonClass:
7497 * @parent_class: The parent class.
7499 * Class structure for #_GFreedesktopDBusSkeleton.
7504 * _g_freedesktop_dbus_call_add_match:
7505 * @proxy: A #_GFreedesktopDBusProxy.
7506 * @arg_rule: Argument to pass with the method invocation.
7507 * @cancellable: (allow-none): A #GCancellable or %NULL.
7508 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7509 * @user_data: User data to pass to @callback.
7511 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.AddMatch">AddMatch()</link> D-Bus method on @proxy.
7512 * 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.
7513 * You can then call _g_freedesktop_dbus_call_add_match_finish() to get the result of the operation.
7515 * See _g_freedesktop_dbus_call_add_match_sync() for the synchronous, blocking version of this method.
7520 * _g_freedesktop_dbus_call_add_match_finish:
7521 * @proxy: A #_GFreedesktopDBusProxy.
7522 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_add_match().
7523 * @error: Return location for error or %NULL.
7525 * Finishes an operation started with _g_freedesktop_dbus_call_add_match().
7527 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7532 * _g_freedesktop_dbus_call_add_match_sync:
7533 * @proxy: A #_GFreedesktopDBusProxy.
7534 * @arg_rule: Argument to pass with the method invocation.
7535 * @cancellable: (allow-none): A #GCancellable or %NULL.
7536 * @error: Return location for error or %NULL.
7538 * 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.
7540 * See _g_freedesktop_dbus_call_add_match() for the asynchronous version of this method.
7542 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7547 * _g_freedesktop_dbus_call_get_connection_selinux_security_context:
7548 * @proxy: A #_GFreedesktopDBusProxy.
7549 * @arg_name: Argument to pass with the method invocation.
7550 * @cancellable: (allow-none): A #GCancellable or %NULL.
7551 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7552 * @user_data: User data to pass to @callback.
7554 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionSELinuxSecurityContext">GetConnectionSELinuxSecurityContext()</link> D-Bus method on @proxy.
7555 * 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.
7556 * You can then call _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish() to get the result of the operation.
7558 * See _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync() for the synchronous, blocking version of this method.
7563 * _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish:
7564 * @proxy: A #_GFreedesktopDBusProxy.
7565 * @out_security_context: (out): Return location for return parameter or %NULL to ignore.
7566 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_selinux_security_context().
7567 * @error: Return location for error or %NULL.
7569 * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_selinux_security_context().
7571 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7576 * _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync:
7577 * @proxy: A #_GFreedesktopDBusProxy.
7578 * @arg_name: Argument to pass with the method invocation.
7579 * @out_security_context: (out): Return location for return parameter or %NULL to ignore.
7580 * @cancellable: (allow-none): A #GCancellable or %NULL.
7581 * @error: Return location for error or %NULL.
7583 * 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.
7585 * See _g_freedesktop_dbus_call_get_connection_selinux_security_context() for the asynchronous version of this method.
7587 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7592 * _g_freedesktop_dbus_call_get_connection_unix_process_id:
7593 * @proxy: A #_GFreedesktopDBusProxy.
7594 * @arg_name: Argument to pass with the method invocation.
7595 * @cancellable: (allow-none): A #GCancellable or %NULL.
7596 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7597 * @user_data: User data to pass to @callback.
7599 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixProcessID">GetConnectionUnixProcessID()</link> D-Bus method on @proxy.
7600 * 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.
7601 * You can then call _g_freedesktop_dbus_call_get_connection_unix_process_id_finish() to get the result of the operation.
7603 * See _g_freedesktop_dbus_call_get_connection_unix_process_id_sync() for the synchronous, blocking version of this method.
7608 * _g_freedesktop_dbus_call_get_connection_unix_process_id_finish:
7609 * @proxy: A #_GFreedesktopDBusProxy.
7610 * @out_pid: (out): Return location for return parameter or %NULL to ignore.
7611 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_unix_process_id().
7612 * @error: Return location for error or %NULL.
7614 * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_unix_process_id().
7616 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7621 * _g_freedesktop_dbus_call_get_connection_unix_process_id_sync:
7622 * @proxy: A #_GFreedesktopDBusProxy.
7623 * @arg_name: Argument to pass with the method invocation.
7624 * @out_pid: (out): Return location for return parameter or %NULL to ignore.
7625 * @cancellable: (allow-none): A #GCancellable or %NULL.
7626 * @error: Return location for error or %NULL.
7628 * 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.
7630 * See _g_freedesktop_dbus_call_get_connection_unix_process_id() for the asynchronous version of this method.
7632 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7637 * _g_freedesktop_dbus_call_get_connection_unix_user:
7638 * @proxy: A #_GFreedesktopDBusProxy.
7639 * @arg_name: Argument to pass with the method invocation.
7640 * @cancellable: (allow-none): A #GCancellable or %NULL.
7641 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7642 * @user_data: User data to pass to @callback.
7644 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetConnectionUnixUser">GetConnectionUnixUser()</link> D-Bus method on @proxy.
7645 * 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.
7646 * You can then call _g_freedesktop_dbus_call_get_connection_unix_user_finish() to get the result of the operation.
7648 * See _g_freedesktop_dbus_call_get_connection_unix_user_sync() for the synchronous, blocking version of this method.
7653 * _g_freedesktop_dbus_call_get_connection_unix_user_finish:
7654 * @proxy: A #_GFreedesktopDBusProxy.
7655 * @out_uid: (out): Return location for return parameter or %NULL to ignore.
7656 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_unix_user().
7657 * @error: Return location for error or %NULL.
7659 * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_unix_user().
7661 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7666 * _g_freedesktop_dbus_call_get_connection_unix_user_sync:
7667 * @proxy: A #_GFreedesktopDBusProxy.
7668 * @arg_name: Argument to pass with the method invocation.
7669 * @out_uid: (out): Return location for return parameter or %NULL to ignore.
7670 * @cancellable: (allow-none): A #GCancellable or %NULL.
7671 * @error: Return location for error or %NULL.
7673 * 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.
7675 * See _g_freedesktop_dbus_call_get_connection_unix_user() for the asynchronous version of this method.
7677 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7682 * _g_freedesktop_dbus_call_get_id:
7683 * @proxy: A #_GFreedesktopDBusProxy.
7684 * @cancellable: (allow-none): A #GCancellable or %NULL.
7685 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7686 * @user_data: User data to pass to @callback.
7688 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetId">GetId()</link> D-Bus method on @proxy.
7689 * 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.
7690 * You can then call _g_freedesktop_dbus_call_get_id_finish() to get the result of the operation.
7692 * See _g_freedesktop_dbus_call_get_id_sync() for the synchronous, blocking version of this method.
7697 * _g_freedesktop_dbus_call_get_id_finish:
7698 * @proxy: A #_GFreedesktopDBusProxy.
7699 * @out_unique_id: (out): Return location for return parameter or %NULL to ignore.
7700 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_id().
7701 * @error: Return location for error or %NULL.
7703 * Finishes an operation started with _g_freedesktop_dbus_call_get_id().
7705 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7710 * _g_freedesktop_dbus_call_get_id_sync:
7711 * @proxy: A #_GFreedesktopDBusProxy.
7712 * @out_unique_id: (out): Return location for return parameter or %NULL to ignore.
7713 * @cancellable: (allow-none): A #GCancellable or %NULL.
7714 * @error: Return location for error or %NULL.
7716 * 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.
7718 * See _g_freedesktop_dbus_call_get_id() for the asynchronous version of this method.
7720 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7725 * _g_freedesktop_dbus_call_get_name_owner:
7726 * @proxy: A #_GFreedesktopDBusProxy.
7727 * @arg_name: Argument to pass with the method invocation.
7728 * @cancellable: (allow-none): A #GCancellable or %NULL.
7729 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7730 * @user_data: User data to pass to @callback.
7732 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.GetNameOwner">GetNameOwner()</link> D-Bus method on @proxy.
7733 * 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.
7734 * You can then call _g_freedesktop_dbus_call_get_name_owner_finish() to get the result of the operation.
7736 * See _g_freedesktop_dbus_call_get_name_owner_sync() for the synchronous, blocking version of this method.
7741 * _g_freedesktop_dbus_call_get_name_owner_finish:
7742 * @proxy: A #_GFreedesktopDBusProxy.
7743 * @out_unique_name: (out): Return location for return parameter or %NULL to ignore.
7744 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_name_owner().
7745 * @error: Return location for error or %NULL.
7747 * Finishes an operation started with _g_freedesktop_dbus_call_get_name_owner().
7749 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7754 * _g_freedesktop_dbus_call_get_name_owner_sync:
7755 * @proxy: A #_GFreedesktopDBusProxy.
7756 * @arg_name: Argument to pass with the method invocation.
7757 * @out_unique_name: (out): Return location for return parameter or %NULL to ignore.
7758 * @cancellable: (allow-none): A #GCancellable or %NULL.
7759 * @error: Return location for error or %NULL.
7761 * 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.
7763 * See _g_freedesktop_dbus_call_get_name_owner() for the asynchronous version of this method.
7765 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7770 * _g_freedesktop_dbus_call_hello:
7771 * @proxy: A #_GFreedesktopDBusProxy.
7772 * @cancellable: (allow-none): A #GCancellable or %NULL.
7773 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7774 * @user_data: User data to pass to @callback.
7776 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.Hello">Hello()</link> D-Bus method on @proxy.
7777 * 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.
7778 * You can then call _g_freedesktop_dbus_call_hello_finish() to get the result of the operation.
7780 * See _g_freedesktop_dbus_call_hello_sync() for the synchronous, blocking version of this method.
7785 * _g_freedesktop_dbus_call_hello_finish:
7786 * @proxy: A #_GFreedesktopDBusProxy.
7787 * @out_assigned_name: (out): Return location for return parameter or %NULL to ignore.
7788 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_hello().
7789 * @error: Return location for error or %NULL.
7791 * Finishes an operation started with _g_freedesktop_dbus_call_hello().
7793 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7798 * _g_freedesktop_dbus_call_hello_sync:
7799 * @proxy: A #_GFreedesktopDBusProxy.
7800 * @out_assigned_name: (out): Return location for return parameter or %NULL to ignore.
7801 * @cancellable: (allow-none): A #GCancellable or %NULL.
7802 * @error: Return location for error or %NULL.
7804 * 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.
7806 * See _g_freedesktop_dbus_call_hello() for the asynchronous version of this method.
7808 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7813 * _g_freedesktop_dbus_call_list_activatable_names:
7814 * @proxy: A #_GFreedesktopDBusProxy.
7815 * @cancellable: (allow-none): A #GCancellable or %NULL.
7816 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7817 * @user_data: User data to pass to @callback.
7819 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListActivatableNames">ListActivatableNames()</link> D-Bus method on @proxy.
7820 * 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.
7821 * You can then call _g_freedesktop_dbus_call_list_activatable_names_finish() to get the result of the operation.
7823 * See _g_freedesktop_dbus_call_list_activatable_names_sync() for the synchronous, blocking version of this method.
7828 * _g_freedesktop_dbus_call_list_activatable_names_finish:
7829 * @proxy: A #_GFreedesktopDBusProxy.
7830 * @out_activatable_names: (out): Return location for return parameter or %NULL to ignore.
7831 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_activatable_names().
7832 * @error: Return location for error or %NULL.
7834 * Finishes an operation started with _g_freedesktop_dbus_call_list_activatable_names().
7836 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7841 * _g_freedesktop_dbus_call_list_activatable_names_sync:
7842 * @proxy: A #_GFreedesktopDBusProxy.
7843 * @out_activatable_names: (out): Return location for return parameter or %NULL to ignore.
7844 * @cancellable: (allow-none): A #GCancellable or %NULL.
7845 * @error: Return location for error or %NULL.
7847 * 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.
7849 * See _g_freedesktop_dbus_call_list_activatable_names() for the asynchronous version of this method.
7851 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7856 * _g_freedesktop_dbus_call_list_names:
7857 * @proxy: A #_GFreedesktopDBusProxy.
7858 * @cancellable: (allow-none): A #GCancellable or %NULL.
7859 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7860 * @user_data: User data to pass to @callback.
7862 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListNames">ListNames()</link> D-Bus method on @proxy.
7863 * 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.
7864 * You can then call _g_freedesktop_dbus_call_list_names_finish() to get the result of the operation.
7866 * See _g_freedesktop_dbus_call_list_names_sync() for the synchronous, blocking version of this method.
7871 * _g_freedesktop_dbus_call_list_names_finish:
7872 * @proxy: A #_GFreedesktopDBusProxy.
7873 * @out_names: (out): Return location for return parameter or %NULL to ignore.
7874 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_names().
7875 * @error: Return location for error or %NULL.
7877 * Finishes an operation started with _g_freedesktop_dbus_call_list_names().
7879 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7884 * _g_freedesktop_dbus_call_list_names_sync:
7885 * @proxy: A #_GFreedesktopDBusProxy.
7886 * @out_names: (out): Return location for return parameter or %NULL to ignore.
7887 * @cancellable: (allow-none): A #GCancellable or %NULL.
7888 * @error: Return location for error or %NULL.
7890 * 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.
7892 * See _g_freedesktop_dbus_call_list_names() for the asynchronous version of this method.
7894 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7899 * _g_freedesktop_dbus_call_list_queued_owners:
7900 * @proxy: A #_GFreedesktopDBusProxy.
7901 * @arg_name: Argument to pass with the method invocation.
7902 * @cancellable: (allow-none): A #GCancellable or %NULL.
7903 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7904 * @user_data: User data to pass to @callback.
7906 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ListQueuedOwners">ListQueuedOwners()</link> D-Bus method on @proxy.
7907 * 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.
7908 * You can then call _g_freedesktop_dbus_call_list_queued_owners_finish() to get the result of the operation.
7910 * See _g_freedesktop_dbus_call_list_queued_owners_sync() for the synchronous, blocking version of this method.
7915 * _g_freedesktop_dbus_call_list_queued_owners_finish:
7916 * @proxy: A #_GFreedesktopDBusProxy.
7917 * @out_queued_owners: (out): Return location for return parameter or %NULL to ignore.
7918 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_queued_owners().
7919 * @error: Return location for error or %NULL.
7921 * Finishes an operation started with _g_freedesktop_dbus_call_list_queued_owners().
7923 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7928 * _g_freedesktop_dbus_call_list_queued_owners_sync:
7929 * @proxy: A #_GFreedesktopDBusProxy.
7930 * @arg_name: Argument to pass with the method invocation.
7931 * @out_queued_owners: (out): Return location for return parameter or %NULL to ignore.
7932 * @cancellable: (allow-none): A #GCancellable or %NULL.
7933 * @error: Return location for error or %NULL.
7935 * 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.
7937 * See _g_freedesktop_dbus_call_list_queued_owners() for the asynchronous version of this method.
7939 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7944 * _g_freedesktop_dbus_call_name_has_owner:
7945 * @proxy: A #_GFreedesktopDBusProxy.
7946 * @arg_name: Argument to pass with the method invocation.
7947 * @cancellable: (allow-none): A #GCancellable or %NULL.
7948 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7949 * @user_data: User data to pass to @callback.
7951 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.NameHasOwner">NameHasOwner()</link> D-Bus method on @proxy.
7952 * 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.
7953 * You can then call _g_freedesktop_dbus_call_name_has_owner_finish() to get the result of the operation.
7955 * See _g_freedesktop_dbus_call_name_has_owner_sync() for the synchronous, blocking version of this method.
7960 * _g_freedesktop_dbus_call_name_has_owner_finish:
7961 * @proxy: A #_GFreedesktopDBusProxy.
7962 * @out_has_owner: (out): Return location for return parameter or %NULL to ignore.
7963 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_name_has_owner().
7964 * @error: Return location for error or %NULL.
7966 * Finishes an operation started with _g_freedesktop_dbus_call_name_has_owner().
7968 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7973 * _g_freedesktop_dbus_call_name_has_owner_sync:
7974 * @proxy: A #_GFreedesktopDBusProxy.
7975 * @arg_name: Argument to pass with the method invocation.
7976 * @out_has_owner: (out): Return location for return parameter or %NULL to ignore.
7977 * @cancellable: (allow-none): A #GCancellable or %NULL.
7978 * @error: Return location for error or %NULL.
7980 * 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.
7982 * See _g_freedesktop_dbus_call_name_has_owner() for the asynchronous version of this method.
7984 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
7989 * _g_freedesktop_dbus_call_release_name:
7990 * @proxy: A #_GFreedesktopDBusProxy.
7991 * @arg_name: Argument to pass with the method invocation.
7992 * @cancellable: (allow-none): A #GCancellable or %NULL.
7993 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
7994 * @user_data: User data to pass to @callback.
7996 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ReleaseName">ReleaseName()</link> D-Bus method on @proxy.
7997 * 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.
7998 * You can then call _g_freedesktop_dbus_call_release_name_finish() to get the result of the operation.
8000 * See _g_freedesktop_dbus_call_release_name_sync() for the synchronous, blocking version of this method.
8005 * _g_freedesktop_dbus_call_release_name_finish:
8006 * @proxy: A #_GFreedesktopDBusProxy.
8007 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8008 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_release_name().
8009 * @error: Return location for error or %NULL.
8011 * Finishes an operation started with _g_freedesktop_dbus_call_release_name().
8013 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8018 * _g_freedesktop_dbus_call_release_name_sync:
8019 * @proxy: A #_GFreedesktopDBusProxy.
8020 * @arg_name: Argument to pass with the method invocation.
8021 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8022 * @cancellable: (allow-none): A #GCancellable or %NULL.
8023 * @error: Return location for error or %NULL.
8025 * 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.
8027 * See _g_freedesktop_dbus_call_release_name() for the asynchronous version of this method.
8029 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8034 * _g_freedesktop_dbus_call_reload_config:
8035 * @proxy: A #_GFreedesktopDBusProxy.
8036 * @cancellable: (allow-none): A #GCancellable or %NULL.
8037 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8038 * @user_data: User data to pass to @callback.
8040 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.ReloadConfig">ReloadConfig()</link> D-Bus method on @proxy.
8041 * 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.
8042 * You can then call _g_freedesktop_dbus_call_reload_config_finish() to get the result of the operation.
8044 * See _g_freedesktop_dbus_call_reload_config_sync() for the synchronous, blocking version of this method.
8049 * _g_freedesktop_dbus_call_reload_config_finish:
8050 * @proxy: A #_GFreedesktopDBusProxy.
8051 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_reload_config().
8052 * @error: Return location for error or %NULL.
8054 * Finishes an operation started with _g_freedesktop_dbus_call_reload_config().
8056 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8061 * _g_freedesktop_dbus_call_reload_config_sync:
8062 * @proxy: A #_GFreedesktopDBusProxy.
8063 * @cancellable: (allow-none): A #GCancellable or %NULL.
8064 * @error: Return location for error or %NULL.
8066 * 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.
8068 * See _g_freedesktop_dbus_call_reload_config() for the asynchronous version of this method.
8070 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8075 * _g_freedesktop_dbus_call_remove_match:
8076 * @proxy: A #_GFreedesktopDBusProxy.
8077 * @arg_rule: Argument to pass with the method invocation.
8078 * @cancellable: (allow-none): A #GCancellable or %NULL.
8079 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8080 * @user_data: User data to pass to @callback.
8082 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.RemoveMatch">RemoveMatch()</link> D-Bus method on @proxy.
8083 * 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.
8084 * You can then call _g_freedesktop_dbus_call_remove_match_finish() to get the result of the operation.
8086 * See _g_freedesktop_dbus_call_remove_match_sync() for the synchronous, blocking version of this method.
8091 * _g_freedesktop_dbus_call_remove_match_finish:
8092 * @proxy: A #_GFreedesktopDBusProxy.
8093 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_remove_match().
8094 * @error: Return location for error or %NULL.
8096 * Finishes an operation started with _g_freedesktop_dbus_call_remove_match().
8098 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8103 * _g_freedesktop_dbus_call_remove_match_sync:
8104 * @proxy: A #_GFreedesktopDBusProxy.
8105 * @arg_rule: Argument to pass with the method invocation.
8106 * @cancellable: (allow-none): A #GCancellable or %NULL.
8107 * @error: Return location for error or %NULL.
8109 * 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.
8111 * See _g_freedesktop_dbus_call_remove_match() for the asynchronous version of this method.
8113 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8118 * _g_freedesktop_dbus_call_request_name:
8119 * @proxy: A #_GFreedesktopDBusProxy.
8120 * @arg_name: Argument to pass with the method invocation.
8121 * @arg_flags: Argument to pass with the method invocation.
8122 * @cancellable: (allow-none): A #GCancellable or %NULL.
8123 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8124 * @user_data: User data to pass to @callback.
8126 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.RequestName">RequestName()</link> D-Bus method on @proxy.
8127 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
8128 * You can then call _g_freedesktop_dbus_call_request_name_finish() to get the result of the operation.
8130 * See _g_freedesktop_dbus_call_request_name_sync() for the synchronous, blocking version of this method.
8135 * _g_freedesktop_dbus_call_request_name_finish:
8136 * @proxy: A #_GFreedesktopDBusProxy.
8137 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8138 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_request_name().
8139 * @error: Return location for error or %NULL.
8141 * Finishes an operation started with _g_freedesktop_dbus_call_request_name().
8143 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8148 * _g_freedesktop_dbus_call_request_name_sync:
8149 * @proxy: A #_GFreedesktopDBusProxy.
8150 * @arg_name: Argument to pass with the method invocation.
8151 * @arg_flags: Argument to pass with the method invocation.
8152 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8153 * @cancellable: (allow-none): A #GCancellable or %NULL.
8154 * @error: Return location for error or %NULL.
8156 * 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.
8158 * See _g_freedesktop_dbus_call_request_name() for the asynchronous version of this method.
8160 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8165 * _g_freedesktop_dbus_call_start_service_by_name:
8166 * @proxy: A #_GFreedesktopDBusProxy.
8167 * @arg_name: Argument to pass with the method invocation.
8168 * @arg_flags: Argument to pass with the method invocation.
8169 * @cancellable: (allow-none): A #GCancellable or %NULL.
8170 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8171 * @user_data: User data to pass to @callback.
8173 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.StartServiceByName">StartServiceByName()</link> D-Bus method on @proxy.
8174 * 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.
8175 * You can then call _g_freedesktop_dbus_call_start_service_by_name_finish() to get the result of the operation.
8177 * See _g_freedesktop_dbus_call_start_service_by_name_sync() for the synchronous, blocking version of this method.
8182 * _g_freedesktop_dbus_call_start_service_by_name_finish:
8183 * @proxy: A #_GFreedesktopDBusProxy.
8184 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8185 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_start_service_by_name().
8186 * @error: Return location for error or %NULL.
8188 * Finishes an operation started with _g_freedesktop_dbus_call_start_service_by_name().
8190 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8195 * _g_freedesktop_dbus_call_start_service_by_name_sync:
8196 * @proxy: A #_GFreedesktopDBusProxy.
8197 * @arg_name: Argument to pass with the method invocation.
8198 * @arg_flags: Argument to pass with the method invocation.
8199 * @out_value: (out): Return location for return parameter or %NULL to ignore.
8200 * @cancellable: (allow-none): A #GCancellable or %NULL.
8201 * @error: Return location for error or %NULL.
8203 * 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.
8205 * See _g_freedesktop_dbus_call_start_service_by_name() for the asynchronous version of this method.
8207 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8212 * _g_freedesktop_dbus_call_update_activation_environment:
8213 * @proxy: A #_GFreedesktopDBusProxy.
8214 * @arg_environment: Argument to pass with the method invocation.
8215 * @cancellable: (allow-none): A #GCancellable or %NULL.
8216 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
8217 * @user_data: User data to pass to @callback.
8219 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-DBus.UpdateActivationEnvironment">UpdateActivationEnvironment()</link> D-Bus method on @proxy.
8220 * 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.
8221 * You can then call _g_freedesktop_dbus_call_update_activation_environment_finish() to get the result of the operation.
8223 * See _g_freedesktop_dbus_call_update_activation_environment_sync() for the synchronous, blocking version of this method.
8228 * _g_freedesktop_dbus_call_update_activation_environment_finish:
8229 * @proxy: A #_GFreedesktopDBusProxy.
8230 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_update_activation_environment().
8231 * @error: Return location for error or %NULL.
8233 * Finishes an operation started with _g_freedesktop_dbus_call_update_activation_environment().
8235 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8240 * _g_freedesktop_dbus_call_update_activation_environment_sync:
8241 * @proxy: A #_GFreedesktopDBusProxy.
8242 * @arg_environment: Argument to pass with the method invocation.
8243 * @cancellable: (allow-none): A #GCancellable or %NULL.
8244 * @error: Return location for error or %NULL.
8246 * 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.
8248 * See _g_freedesktop_dbus_call_update_activation_environment() for the asynchronous version of this method.
8250 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
8255 * _g_freedesktop_dbus_complete_add_match:
8256 * @object: A #_GFreedesktopDBus.
8257 * @invocation: (transfer full): A #GDBusMethodInvocation.
8259 * 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.
8261 * This method will free @invocation, you cannot use it afterwards.
8266 * _g_freedesktop_dbus_complete_get_connection_selinux_security_context:
8267 * @object: A #_GFreedesktopDBus.
8268 * @invocation: (transfer full): A #GDBusMethodInvocation.
8269 * @security_context: Parameter to return.
8271 * 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.
8273 * This method will free @invocation, you cannot use it afterwards.
8278 * _g_freedesktop_dbus_complete_get_connection_unix_process_id:
8279 * @object: A #_GFreedesktopDBus.
8280 * @invocation: (transfer full): A #GDBusMethodInvocation.
8281 * @pid: Parameter to return.
8283 * 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.
8285 * This method will free @invocation, you cannot use it afterwards.
8290 * _g_freedesktop_dbus_complete_get_connection_unix_user:
8291 * @object: A #_GFreedesktopDBus.
8292 * @invocation: (transfer full): A #GDBusMethodInvocation.
8293 * @uid: Parameter to return.
8295 * 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.
8297 * This method will free @invocation, you cannot use it afterwards.
8302 * _g_freedesktop_dbus_complete_get_id:
8303 * @object: A #_GFreedesktopDBus.
8304 * @invocation: (transfer full): A #GDBusMethodInvocation.
8305 * @unique_id: Parameter to return.
8307 * 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.
8309 * This method will free @invocation, you cannot use it afterwards.
8314 * _g_freedesktop_dbus_complete_get_name_owner:
8315 * @object: A #_GFreedesktopDBus.
8316 * @invocation: (transfer full): A #GDBusMethodInvocation.
8317 * @unique_name: Parameter to return.
8319 * 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.
8321 * This method will free @invocation, you cannot use it afterwards.
8326 * _g_freedesktop_dbus_complete_hello:
8327 * @object: A #_GFreedesktopDBus.
8328 * @invocation: (transfer full): A #GDBusMethodInvocation.
8329 * @assigned_name: Parameter to return.
8331 * 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.
8333 * This method will free @invocation, you cannot use it afterwards.
8338 * _g_freedesktop_dbus_complete_list_activatable_names:
8339 * @object: A #_GFreedesktopDBus.
8340 * @invocation: (transfer full): A #GDBusMethodInvocation.
8341 * @activatable_names: Parameter to return.
8343 * 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.
8345 * This method will free @invocation, you cannot use it afterwards.
8350 * _g_freedesktop_dbus_complete_list_names:
8351 * @object: A #_GFreedesktopDBus.
8352 * @invocation: (transfer full): A #GDBusMethodInvocation.
8353 * @names: Parameter to return.
8355 * 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.
8357 * This method will free @invocation, you cannot use it afterwards.
8362 * _g_freedesktop_dbus_complete_list_queued_owners:
8363 * @object: A #_GFreedesktopDBus.
8364 * @invocation: (transfer full): A #GDBusMethodInvocation.
8365 * @queued_owners: Parameter to return.
8367 * 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.
8369 * This method will free @invocation, you cannot use it afterwards.
8374 * _g_freedesktop_dbus_complete_name_has_owner:
8375 * @object: A #_GFreedesktopDBus.
8376 * @invocation: (transfer full): A #GDBusMethodInvocation.
8377 * @has_owner: Parameter to return.
8379 * 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.
8381 * This method will free @invocation, you cannot use it afterwards.
8386 * _g_freedesktop_dbus_complete_release_name:
8387 * @object: A #_GFreedesktopDBus.
8388 * @invocation: (transfer full): A #GDBusMethodInvocation.
8389 * @value: Parameter to return.
8391 * 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.
8393 * This method will free @invocation, you cannot use it afterwards.
8398 * _g_freedesktop_dbus_complete_reload_config:
8399 * @object: A #_GFreedesktopDBus.
8400 * @invocation: (transfer full): A #GDBusMethodInvocation.
8402 * 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.
8404 * This method will free @invocation, you cannot use it afterwards.
8409 * _g_freedesktop_dbus_complete_remove_match:
8410 * @object: A #_GFreedesktopDBus.
8411 * @invocation: (transfer full): A #GDBusMethodInvocation.
8413 * 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.
8415 * This method will free @invocation, you cannot use it afterwards.
8420 * _g_freedesktop_dbus_complete_request_name:
8421 * @object: A #_GFreedesktopDBus.
8422 * @invocation: (transfer full): A #GDBusMethodInvocation.
8423 * @value: Parameter to return.
8425 * 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.
8427 * This method will free @invocation, you cannot use it afterwards.
8432 * _g_freedesktop_dbus_complete_start_service_by_name:
8433 * @object: A #_GFreedesktopDBus.
8434 * @invocation: (transfer full): A #GDBusMethodInvocation.
8435 * @value: Parameter to return.
8437 * 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.
8439 * This method will free @invocation, you cannot use it afterwards.
8444 * _g_freedesktop_dbus_complete_update_activation_environment:
8445 * @object: A #_GFreedesktopDBus.
8446 * @invocation: (transfer full): A #GDBusMethodInvocation.
8448 * 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.
8450 * This method will free @invocation, you cannot use it afterwards.
8455 * _g_freedesktop_dbus_emit_name_acquired:
8456 * @object: A #_GFreedesktopDBus.
8457 * @arg_name: Argument to pass with the signal.
8459 * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameAcquired">"NameAcquired"</link> D-Bus signal.
8464 * _g_freedesktop_dbus_emit_name_lost:
8465 * @object: A #_GFreedesktopDBus.
8466 * @arg_name: Argument to pass with the signal.
8468 * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameLost">"NameLost"</link> D-Bus signal.
8473 * _g_freedesktop_dbus_emit_name_owner_changed:
8474 * @object: A #_GFreedesktopDBus.
8475 * @arg_name: Argument to pass with the signal.
8476 * @arg_old_owner: Argument to pass with the signal.
8477 * @arg_new_owner: Argument to pass with the signal.
8479 * Emits the <link linkend="gdbus-signal-org-freedesktop-DBus.NameOwnerChanged">"NameOwnerChanged"</link> D-Bus signal.
8484 * _g_freedesktop_dbus_interface_info:
8486 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link> D-Bus interface.
8488 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
8493 * _g_freedesktop_dbus_override_properties:
8494 * @klass: The class structure for a #GObject<!-- -->-derived class.
8495 * @property_id_begin: The property id to assign to the first overridden property.
8497 * Overrides all #GObject properties in the #_GFreedesktopDBus interface for a concrete class.
8498 * The properties are overridden in the order they are defined.
8500 * Returns: The last property id.
8505 * _g_freedesktop_dbus_proxy_new:
8506 * @connection: A #GDBusConnection.
8507 * @flags: Flags from the #GDBusProxyFlags enumeration.
8508 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
8509 * @object_path: An object path.
8510 * @cancellable: (allow-none): A #GCancellable or %NULL.
8511 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
8512 * @user_data: User data to pass to @callback.
8514 * 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.
8516 * 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.
8517 * You can then call _g_freedesktop_dbus_proxy_new_finish() to get the result of the operation.
8519 * See _g_freedesktop_dbus_proxy_new_sync() for the synchronous, blocking version of this constructor.
8524 * _g_freedesktop_dbus_proxy_new_finish:
8525 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_proxy_new().
8526 * @error: Return location for error or %NULL
8528 * Finishes an operation started with _g_freedesktop_dbus_proxy_new().
8530 * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
8535 * _g_freedesktop_dbus_proxy_new_for_bus:
8536 * @bus_type: A #GBusType.
8537 * @flags: Flags from the #GDBusProxyFlags enumeration.
8538 * @name: A bus name (well-known or unique).
8539 * @object_path: An object path.
8540 * @cancellable: (allow-none): A #GCancellable or %NULL.
8541 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
8542 * @user_data: User data to pass to @callback.
8544 * Like _g_freedesktop_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
8546 * 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.
8547 * You can then call _g_freedesktop_dbus_proxy_new_for_bus_finish() to get the result of the operation.
8549 * See _g_freedesktop_dbus_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
8554 * _g_freedesktop_dbus_proxy_new_for_bus_finish:
8555 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_proxy_new_for_bus().
8556 * @error: Return location for error or %NULL
8558 * Finishes an operation started with _g_freedesktop_dbus_proxy_new_for_bus().
8560 * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
8565 * _g_freedesktop_dbus_proxy_new_for_bus_sync:
8566 * @bus_type: A #GBusType.
8567 * @flags: Flags from the #GDBusProxyFlags enumeration.
8568 * @name: A bus name (well-known or unique).
8569 * @object_path: An object path.
8570 * @cancellable: (allow-none): A #GCancellable or %NULL.
8571 * @error: Return location for error or %NULL
8573 * Like _g_freedesktop_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
8575 * The calling thread is blocked until a reply is received.
8577 * See _g_freedesktop_dbus_proxy_new_for_bus() for the asynchronous version of this constructor.
8579 * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
8584 * _g_freedesktop_dbus_proxy_new_sync:
8585 * @connection: A #GDBusConnection.
8586 * @flags: Flags from the #GDBusProxyFlags enumeration.
8587 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
8588 * @object_path: An object path.
8589 * @cancellable: (allow-none): A #GCancellable or %NULL.
8590 * @error: Return location for error or %NULL
8592 * 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.
8594 * The calling thread is blocked until a reply is received.
8596 * See _g_freedesktop_dbus_proxy_new() for the asynchronous version of this constructor.
8598 * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set.
8603 * _g_freedesktop_dbus_skeleton_new:
8605 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-DBus.top_of_page">org.freedesktop.DBus</link>.
8607 * Returns: (transfer full) (type _GFreedesktopDBusSkeleton): The skeleton object.
8612 * _g_io_module_get_default:
8613 * @extension_point: the name of an extension point
8614 * @envvar: (allow-none): the name of an environment variable to override the default implementation.
8615 * @verify_func: (allow-none): a function to call to verify that a given implementation is usable in the current environment.
8617 * Retrieves the default object implementing @extension_point.
8619 * If @envvar is not %NULL, and the environment variable with that
8620 * name is set, then the implementation it specifies will be tried
8621 * first. After that, or if @envvar is not set, all other
8622 * implementations will be tried in order of decreasing priority.
8624 * If an extension point implementation implements #GInitable, then
8625 * that implementation will only be used if it initializes
8626 * successfully. Otherwise, if @verify_func is not %NULL, then it will
8627 * be called on each candidate implementation after construction, to
8628 * check if it is actually usable or not.
8630 * The result is cached after it is generated the first time, and
8631 * the function is thread-safe.
8633 * Returns: (transfer none): an object implementing @extension_point, or %NULL if there are no usable implementations.
8638 * g_action_activate:
8639 * @action: a #GAction
8640 * @parameter: (allow-none): the parameter to the activation
8642 * Activates the action.
8644 * @parameter must be the correct type of parameter for the action (ie:
8645 * the parameter type given at construction time). If the parameter
8646 * type was %NULL then @parameter must also be %NULL.
8653 * g_action_change_state:
8654 * @action: a #GAction
8655 * @value: the new state
8657 * Request for the state of @action to be changed to @value.
8659 * The action must be stateful and @value must be of the correct type.
8660 * See g_action_get_state_type().
8662 * This call merely requests a change. The action may refuse to change
8663 * its state or may change its state to something other than @value.
8664 * See g_action_get_state_hint().
8666 * If the @value GVariant is floating, it is consumed.
8673 * g_action_get_enabled:
8674 * @action: a #GAction
8676 * Checks if @action is currently enabled.
8678 * An action must be enabled in order to be activated or in order to
8679 * have its state changed from outside callers.
8681 * Returns: whether the action is enabled
8687 * g_action_get_name:
8688 * @action: a #GAction
8690 * Queries the name of @action.
8692 * Returns: the name of the action
8698 * g_action_get_parameter_type:
8699 * @action: a #GAction
8701 * Queries the type of the parameter that must be given when activating
8704 * When activating the action using g_action_activate(), the #GVariant
8705 * given to that function must be of the type returned by this function.
8707 * In the case that this function returns %NULL, you must not give any
8708 * #GVariant, but %NULL instead.
8710 * Returns: (allow-none): the parameter type
8716 * g_action_get_state:
8717 * @action: a #GAction
8719 * Queries the current state of @action.
8721 * If the action is not stateful then %NULL will be returned. If the
8722 * action is stateful then the type of the return value is the type
8723 * given by g_action_get_state_type().
8725 * The return value (if non-%NULL) should be freed with
8726 * g_variant_unref() when it is no longer required.
8728 * Returns: (transfer full): the current state of the action
8734 * g_action_get_state_hint:
8735 * @action: a #GAction
8737 * Requests a hint about the valid range of values for the state of
8740 * If %NULL is returned it either means that the action is not stateful
8741 * or that there is no hint about the valid range of values for the
8742 * state of the action.
8744 * If a #GVariant array is returned then each item in the array is a
8745 * possible value for the state. If a #GVariant pair (ie: two-tuple) is
8746 * returned then the tuple specifies the inclusive lower and upper bound
8747 * of valid values for the state.
8749 * In any case, the information is merely a hint. It may be possible to
8750 * have a state value outside of the hinted range and setting a value
8751 * within the range may fail.
8753 * The return value (if non-%NULL) should be freed with
8754 * g_variant_unref() when it is no longer required.
8756 * Returns: (transfer full): the state range hint
8762 * g_action_get_state_type:
8763 * @action: a #GAction
8765 * Queries the type of the state of @action.
8767 * If the action is stateful (e.g. created with
8768 * g_simple_action_new_stateful()) then this function returns the
8769 * #GVariantType of the state. This is the type of the initial value
8770 * given as the state. All calls to g_action_change_state() must give a
8771 * #GVariant of this type and g_action_get_state() will return a
8772 * #GVariant of the same type.
8774 * If the action is not stateful (e.g. created with g_simple_action_new())
8775 * then this function will return %NULL. In that case, g_action_get_state()
8776 * will return %NULL and you must not call g_action_change_state().
8778 * Returns: (allow-none): the state type, if the action is stateful
8784 * g_action_group_action_added:
8785 * @action_group: a #GActionGroup
8786 * @action_name: the name of an action in the group
8788 * Emits the #GActionGroup::action-added signal on @action_group.
8790 * This function should only be called by #GActionGroup implementations.
8797 * g_action_group_action_enabled_changed:
8798 * @action_group: a #GActionGroup
8799 * @action_name: the name of an action in the group
8800 * @enabled: whether or not the action is now enabled
8802 * Emits the #GActionGroup::action-enabled-changed signal on @action_group.
8804 * This function should only be called by #GActionGroup implementations.
8811 * g_action_group_action_removed:
8812 * @action_group: a #GActionGroup
8813 * @action_name: the name of an action in the group
8815 * Emits the #GActionGroup::action-removed signal on @action_group.
8817 * This function should only be called by #GActionGroup implementations.
8824 * g_action_group_action_state_changed:
8825 * @action_group: a #GActionGroup
8826 * @action_name: the name of an action in the group
8827 * @state: the new state of the named action
8829 * Emits the #GActionGroup::action-state-changed signal on @action_group.
8831 * This function should only be called by #GActionGroup implementations.
8838 * g_action_group_activate_action:
8839 * @action_group: a #GActionGroup
8840 * @action_name: the name of the action to activate
8841 * @parameter: (allow-none): parameters to the activation
8843 * Activate the named action within @action_group.
8845 * If the action is expecting a parameter, then the correct type of
8846 * parameter must be given as @parameter. If the action is expecting no
8847 * parameters then @parameter must be %NULL. See
8848 * g_action_group_get_action_parameter_type().
8855 * g_action_group_change_action_state:
8856 * @action_group: a #GActionGroup
8857 * @action_name: the name of the action to request the change on
8858 * @value: the new state
8860 * Request for the state of the named action within @action_group to be
8861 * changed to @value.
8863 * The action must be stateful and @value must be of the correct type.
8864 * See g_action_group_get_action_state_type().
8866 * This call merely requests a change. The action may refuse to change
8867 * its state or may change its state to something other than @value.
8868 * See g_action_group_get_action_state_hint().
8870 * If the @value GVariant is floating, it is consumed.
8877 * g_action_group_get_action_enabled:
8878 * @action_group: a #GActionGroup
8879 * @action_name: the name of the action to query
8881 * Checks if the named action within @action_group is currently enabled.
8883 * An action must be enabled in order to be activated or in order to
8884 * have its state changed from outside callers.
8886 * Returns: whether or not the action is currently enabled
8892 * g_action_group_get_action_parameter_type:
8893 * @action_group: a #GActionGroup
8894 * @action_name: the name of the action to query
8896 * Queries the type of the parameter that must be given when activating
8897 * the named action within @action_group.
8899 * When activating the action using g_action_group_activate_action(),
8900 * the #GVariant given to that function must be of the type returned
8903 * In the case that this function returns %NULL, you must not give any
8904 * #GVariant, but %NULL instead.
8906 * The parameter type of a particular action will never change but it is
8907 * possible for an action to be removed and for a new action to be added
8908 * with the same name but a different parameter type.
8910 * Returns: the parameter type
8916 * g_action_group_get_action_state:
8917 * @action_group: a #GActionGroup
8918 * @action_name: the name of the action to query
8920 * Queries the current state of the named action within @action_group.
8922 * If the action is not stateful then %NULL will be returned. If the
8923 * action is stateful then the type of the return value is the type
8924 * given by g_action_group_get_action_state_type().
8926 * The return value (if non-%NULL) should be freed with
8927 * g_variant_unref() when it is no longer required.
8929 * Returns: (allow-none): the current state of the action
8935 * g_action_group_get_action_state_hint:
8936 * @action_group: a #GActionGroup
8937 * @action_name: the name of the action to query
8939 * Requests a hint about the valid range of values for the state of the
8940 * named action within @action_group.
8942 * If %NULL is returned it either means that the action is not stateful
8943 * or that there is no hint about the valid range of values for the
8944 * state of the action.
8946 * If a #GVariant array is returned then each item in the array is a
8947 * possible value for the state. If a #GVariant pair (ie: two-tuple) is
8948 * returned then the tuple specifies the inclusive lower and upper bound
8949 * of valid values for the state.
8951 * In any case, the information is merely a hint. It may be possible to
8952 * have a state value outside of the hinted range and setting a value
8953 * within the range may fail.
8955 * The return value (if non-%NULL) should be freed with
8956 * g_variant_unref() when it is no longer required.
8958 * Returns: (transfer full): the state range hint
8964 * g_action_group_get_action_state_type:
8965 * @action_group: a #GActionGroup
8966 * @action_name: the name of the action to query
8968 * Queries the type of the state of the named action within
8971 * If the action is stateful then this function returns the
8972 * #GVariantType of the state. All calls to
8973 * g_action_group_change_action_state() must give a #GVariant of this
8974 * type and g_action_group_get_action_state() will return a #GVariant
8977 * If the action is not stateful then this function will return %NULL.
8978 * In that case, g_action_group_get_action_state() will return %NULL
8979 * and you must not call g_action_group_change_action_state().
8981 * The state type of a particular action will never change but it is
8982 * possible for an action to be removed and for a new action to be added
8983 * with the same name but a different state type.
8985 * Returns: (transfer full): the state type, if the action is stateful
8991 * g_action_group_has_action:
8992 * @action_group: a #GActionGroup
8993 * @action_name: the name of the action to check for
8995 * Checks if the named action exists within @action_group.
8997 * Returns: whether the named action exists
9003 * g_action_group_list_actions:
9004 * @action_group: a #GActionGroup
9006 * Lists the actions contained within @action_group.
9008 * The caller is responsible for freeing the list with g_strfreev() when
9009 * it is no longer required.
9011 * Returns: (transfer full): a %NULL-terminated array of the names of the actions in the groupb
9017 * g_action_group_query_action:
9018 * @action_group: a #GActionGroup
9019 * @action_name: the name of an action in the group
9020 * @enabled: (out): if the action is presently enabled
9021 * @parameter_type: (out) (allow-none): the parameter type, or %NULL if none needed
9022 * @state_type: (out) (allow-none): the state type, or %NULL if stateless
9023 * @state_hint: (out) (allow-none): the state hint, or %NULL if none
9024 * @state: (out) (allow-none): the current state, or %NULL if stateless
9026 * Queries all aspects of the named action within an @action_group.
9028 * This function acquires the information available from
9029 * g_action_group_has_action(), g_action_group_get_action_enabled(),
9030 * g_action_group_get_action_parameter_type(),
9031 * g_action_group_get_action_state_type(),
9032 * g_action_group_get_action_state_hint() and
9033 * g_action_group_get_action_state() with a single function call.
9035 * This provides two main benefits.
9037 * The first is the improvement in efficiency that comes with not having
9038 * to perform repeated lookups of the action in order to discover
9039 * different things about it. The second is that implementing
9040 * #GActionGroup can now be done by only overriding this one virtual
9043 * The interface provides a default implementation of this function that
9044 * calls the individual functions, as required, to fetch the
9045 * information. The interface also provides default implementations of
9046 * those functions that call this function. All implementations,
9047 * therefore, must override either this function or all of the others.
9049 * If the action exists, %TRUE is returned and any of the requested
9050 * fields (as indicated by having a non-%NULL reference passed in) are
9051 * filled. If the action doesn't exist, %FALSE is returned and the
9052 * fields may or may not have been modified.
9054 * Returns: %TRUE if the action exists, else %FALSE
9060 * g_action_map_add_action:
9061 * @action_map: a #GActionMap
9062 * @action: a #GAction
9064 * Adds an action to the @action_map.
9066 * If the action map already contains an action with the same name
9067 * as @action then the old action is dropped from the action map.
9069 * The action map takes its own reference on @action.
9076 * g_action_map_add_action_entries:
9077 * @action_map: a #GActionMap
9078 * @entries: a pointer to the first item in an array of #GActionEntry structs
9079 * @n_entries: the length of @entries, or -1 if @entries is %NULL-terminated
9080 * @user_data: the user data for signal connections
9082 * A convenience function for creating multiple #GSimpleAction instances
9083 * and adding them to a #GActionMap.
9085 * Each action is constructed as per one #GActionEntry.
9088 * <title>Using g_action_map_add_action_entries()</title>
9091 * activate_quit (GSimpleAction *simple,
9092 * GVariant *parameter,
9093 * gpointer user_data)
9099 * activate_print_string (GSimpleAction *simple,
9100 * GVariant *parameter,
9101 * gpointer user_data)
9103 * g_print ("%s\n", g_variant_get_string (parameter, NULL));
9106 * static GActionGroup *
9107 * create_action_group (void)
9109 * const GActionEntry entries[] = {
9110 * { "quit", activate_quit },
9111 * { "print-string", activate_print_string, "s" }
9113 * GSimpleActionGroup *group;
9115 * group = g_simple_action_group_new ();
9116 * g_action_map_add_action_entries (G_ACTION_MAP (group), entries, G_N_ELEMENTS (entries), NULL);
9118 * return G_ACTION_GROUP (group);
9128 * g_action_map_lookup_action:
9129 * @action_map: a #GActionMap
9130 * @action_name: the name of an action
9132 * Looks up the action with the name @action_name in @action_map.
9134 * If no such action exists, returns %NULL.
9136 * Returns: (transfer none): a #GAction, or %NULL
9142 * g_action_map_remove_action:
9143 * @action_map: a #GActionMap
9144 * @action_name: the name of the action
9146 * Removes the named action from the action map.
9148 * If no action of this name is in the map then nothing happens.
9155 * g_app_info_add_supports_type:
9156 * @appinfo: a #GAppInfo.
9157 * @content_type: a string.
9158 * @error: a #GError.
9160 * Adds a content type to the application information to indicate the
9161 * application is capable of opening files with the given content type.
9163 * Returns: %TRUE on success, %FALSE on error.
9168 * g_app_info_can_delete:
9169 * @appinfo: a #GAppInfo
9171 * Obtains the information whether the #GAppInfo can be deleted.
9172 * See g_app_info_delete().
9174 * Returns: %TRUE if @appinfo can be deleted
9180 * g_app_info_can_remove_supports_type:
9181 * @appinfo: a #GAppInfo.
9183 * Checks if a supported content type can be removed from an application.
9185 * Returns: %TRUE if it is possible to remove supported content types from a given @appinfo, %FALSE if not.
9190 * g_app_info_create_from_commandline:
9191 * @commandline: the commandline to use
9192 * @application_name: (allow-none): the application name, or %NULL to use @commandline
9193 * @flags: flags that can specify details of the created #GAppInfo
9194 * @error: a #GError location to store the error occurring, %NULL to ignore.
9196 * Creates a new #GAppInfo from the given information.
9198 * Note that for @commandline, the quoting rules of the Exec key of the
9199 * <ulink url="http://freedesktop.org/Standards/desktop-entry-spec">freedesktop.org Desktop
9200 * Entry Specification</ulink> are applied. For example, if the @commandline contains
9201 * percent-encoded URIs, the percent-character must be doubled in order to prevent it from
9202 * being swallowed by Exec key unquoting. See the specification for exact quoting rules.
9204 * Returns: (transfer full): new #GAppInfo for given command.
9209 * g_app_info_delete:
9210 * @appinfo: a #GAppInfo
9212 * Tries to delete a #GAppInfo.
9214 * On some platforms, there may be a difference between user-defined
9215 * #GAppInfo<!-- -->s which can be deleted, and system-wide ones which
9216 * cannot. See g_app_info_can_delete().
9218 * Virtual: do_delete
9219 * Returns: %TRUE if @appinfo has been deleted
9226 * @appinfo: a #GAppInfo.
9228 * Creates a duplicate of a #GAppInfo.
9230 * Returns: (transfer full): a duplicate of @appinfo.
9236 * @appinfo1: the first #GAppInfo.
9237 * @appinfo2: the second #GAppInfo.
9239 * Checks if two #GAppInfo<!-- -->s are equal.
9241 * Returns: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
9246 * g_app_info_get_all:
9248 * Gets a list of all of the applications currently registered
9251 * For desktop files, this includes applications that have
9252 * <literal>NoDisplay=true</literal> set or are excluded from
9253 * display by means of <literal>OnlyShowIn</literal> or
9254 * <literal>NotShowIn</literal>. See g_app_info_should_show().
9255 * The returned list does not include applications which have
9256 * the <literal>Hidden</literal> key set.
9258 * Returns: (element-type GAppInfo) (transfer full): a newly allocated #GList of references to #GAppInfo<!---->s.
9263 * g_app_info_get_all_for_type:
9264 * @content_type: the content type to find a #GAppInfo for
9266 * Gets a list of all #GAppInfos for a given content type,
9267 * including the recommended and fallback #GAppInfos. See
9268 * g_app_info_get_recommended_for_type() and
9269 * g_app_info_get_fallback_for_type().
9271 * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9276 * g_app_info_get_commandline:
9277 * @appinfo: a #GAppInfo
9279 * Gets the commandline with which the application will be
9282 * Returns: a string containing the @appinfo's commandline, or %NULL if this information is not available
9288 * g_app_info_get_default_for_type:
9289 * @content_type: the content type to find a #GAppInfo for
9290 * @must_support_uris: if %TRUE, the #GAppInfo is expected to support URIs
9292 * Gets the default #GAppInfo for a given content type.
9294 * Returns: (transfer full): #GAppInfo for given @content_type or %NULL on error.
9299 * g_app_info_get_default_for_uri_scheme:
9300 * @uri_scheme: a string containing a URI scheme.
9302 * Gets the default application for handling URIs with
9303 * the given URI scheme. A URI scheme is the initial part
9304 * of the URI, up to but not including the ':', e.g. "http",
9307 * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
9312 * g_app_info_get_description:
9313 * @appinfo: a #GAppInfo.
9315 * Gets a human-readable description of an installed application.
9317 * Returns: a string containing a description of the application @appinfo, or %NULL if none.
9322 * g_app_info_get_display_name:
9323 * @appinfo: a #GAppInfo.
9325 * Gets the display name of the application. The display name is often more
9326 * descriptive to the user than the name itself.
9328 * Returns: the display name of the application for @appinfo, or the name if no display name is available.
9334 * g_app_info_get_executable:
9335 * @appinfo: a #GAppInfo
9337 * Gets the executable's name for the installed application.
9339 * Returns: a string containing the @appinfo's application binaries name
9344 * g_app_info_get_fallback_for_type:
9345 * @content_type: the content type to find a #GAppInfo for
9347 * Gets a list of fallback #GAppInfos for a given content type, i.e.
9348 * those applications which claim to support the given content type
9349 * by MIME type subclassing and not directly.
9351 * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9357 * g_app_info_get_icon:
9358 * @appinfo: a #GAppInfo.
9360 * Gets the icon for the application.
9362 * Returns: (transfer none): the default #GIcon for @appinfo or %NULL if there is no default icon.
9367 * g_app_info_get_id:
9368 * @appinfo: a #GAppInfo.
9370 * Gets the ID of an application. An id is a string that
9371 * identifies the application. The exact format of the id is
9372 * platform dependent. For instance, on Unix this is the
9373 * desktop file id from the xdg menu specification.
9375 * Note that the returned ID may be %NULL, depending on how
9376 * the @appinfo has been constructed.
9378 * Returns: a string containing the application's ID.
9383 * g_app_info_get_name:
9384 * @appinfo: a #GAppInfo.
9386 * Gets the installed name of the application.
9388 * Returns: the name of the application for @appinfo.
9393 * g_app_info_get_recommended_for_type:
9394 * @content_type: the content type to find a #GAppInfo for
9396 * Gets a list of recommended #GAppInfos for a given content type, i.e.
9397 * those applications which claim to support the given content type exactly,
9398 * and not by MIME type subclassing.
9399 * Note that the first application of the list is the last used one, i.e.
9400 * the last one for which g_app_info_set_as_last_used_for_type() has been
9403 * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
9409 * g_app_info_get_supported_types:
9410 * @info: a #GAppInfo that can handle files
9412 * Retrieves the list of content types that @app_info claims to support.
9413 * If this information is not provided by the environment, this function
9414 * will return %NULL.
9415 * This function does not take in consideration associations added with
9416 * g_app_info_add_supports_type(), but only those exported directly by
9419 * Returns: (transfer none) (array zero-terminated=1) (element-type utf8): a list of content types.
9425 * g_app_info_launch:
9426 * @appinfo: a #GAppInfo
9427 * @files: (element-type GFile): a #GList of #GFile objects
9428 * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
9431 * Launches the application. Passes @files to the launched application
9432 * as arguments, using the optional @launch_context to get information
9433 * about the details of the launcher (like what screen it is on).
9434 * On error, @error will be set accordingly.
9436 * To launch the application without arguments pass a %NULL @files list.
9438 * Note that even if the launch is successful the application launched
9439 * can fail to start if it runs into problems during startup. There is
9440 * no way to detect this.
9442 * Some URIs can be changed when passed through a GFile (for instance
9443 * unsupported URIs with strange formats like mailto:), so if you have
9444 * a textual URI you want to pass in as argument, consider using
9445 * g_app_info_launch_uris() instead.
9447 * The launched application inherits the environment of the launching
9448 * process, but it can be modified with g_app_launch_context_setenv() and
9449 * g_app_launch_context_unsetenv().
9451 * On UNIX, this function sets the <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>
9452 * environment variable with the path of the launched desktop file and
9453 * <envar>GIO_LAUNCHED_DESKTOP_FILE_PID</envar> to the process
9454 * id of the launched process. This can be used to ignore
9455 * <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>, should it be inherited
9456 * by further processes. The <envar>DISPLAY</envar> and
9457 * <envar>DESKTOP_STARTUP_ID</envar> environment variables are also
9458 * set, based on information provided in @launch_context.
9460 * Returns: %TRUE on successful launch, %FALSE otherwise.
9465 * g_app_info_launch_default_for_uri:
9466 * @uri: the uri to show
9467 * @launch_context: (allow-none): an optional #GAppLaunchContext.
9468 * @error: a #GError.
9470 * Utility function that launches the default application
9471 * registered to handle the specified uri. Synchronous I/O
9472 * is done on the uri to detect the type of the file if
9475 * Returns: %TRUE on success, %FALSE on error.
9480 * g_app_info_launch_uris:
9481 * @appinfo: a #GAppInfo
9482 * @uris: (element-type utf8): a #GList containing URIs to launch.
9483 * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
9486 * Launches the application. This passes the @uris to the launched application
9487 * as arguments, using the optional @launch_context to get information
9488 * about the details of the launcher (like what screen it is on).
9489 * On error, @error will be set accordingly.
9491 * To launch the application without arguments pass a %NULL @uris list.
9493 * Note that even if the launch is successful the application launched
9494 * can fail to start if it runs into problems during startup. There is
9495 * no way to detect this.
9497 * Returns: %TRUE on successful launch, %FALSE otherwise.
9502 * g_app_info_remove_supports_type:
9503 * @appinfo: a #GAppInfo.
9504 * @content_type: a string.
9505 * @error: a #GError.
9507 * Removes a supported type from an application, if possible.
9509 * Returns: %TRUE on success, %FALSE on error.
9514 * g_app_info_reset_type_associations:
9515 * @content_type: a content type
9517 * Removes all changes to the type associations done by
9518 * g_app_info_set_as_default_for_type(),
9519 * g_app_info_set_as_default_for_extension(),
9520 * g_app_info_add_supports_type() or
9521 * g_app_info_remove_supports_type().
9528 * g_app_info_set_as_default_for_extension:
9529 * @appinfo: a #GAppInfo.
9530 * @extension: a string containing the file extension (without the dot).
9531 * @error: a #GError.
9533 * Sets the application as the default handler for the given file extension.
9535 * Returns: %TRUE on success, %FALSE on error.
9540 * g_app_info_set_as_default_for_type:
9541 * @appinfo: a #GAppInfo.
9542 * @content_type: the content type.
9543 * @error: a #GError.
9545 * Sets the application as the default handler for a given type.
9547 * Returns: %TRUE on success, %FALSE on error.
9552 * g_app_info_set_as_last_used_for_type:
9553 * @appinfo: a #GAppInfo.
9554 * @content_type: the content type.
9555 * @error: a #GError.
9557 * Sets the application as the last used application for a given type.
9558 * This will make the application appear as first in the list returned
9559 * by g_app_info_get_recommended_for_type(), regardless of the default
9560 * application for that content type.
9562 * Returns: %TRUE on success, %FALSE on error.
9567 * g_app_info_should_show:
9568 * @appinfo: a #GAppInfo.
9570 * Checks if the application info should be shown in menus that
9571 * list available applications.
9573 * Returns: %TRUE if the @appinfo should be shown, %FALSE otherwise.
9578 * g_app_info_supports_files:
9579 * @appinfo: a #GAppInfo.
9581 * Checks if the application accepts files as arguments.
9583 * Returns: %TRUE if the @appinfo supports files.
9588 * g_app_info_supports_uris:
9589 * @appinfo: a #GAppInfo.
9591 * Checks if the application supports reading files and directories from URIs.
9593 * Returns: %TRUE if the @appinfo supports URIs.
9598 * g_app_launch_context_get_display:
9599 * @context: a #GAppLaunchContext
9600 * @info: a #GAppInfo
9601 * @files: (element-type GFile): a #GList of #GFile objects
9603 * Gets the display string for the @context. This is used to ensure new
9604 * applications are started on the same display as the launching
9605 * application, by setting the <envar>DISPLAY</envar> environment variable.
9607 * Returns: a display string for the display.
9612 * g_app_launch_context_get_environment:
9613 * @context: a #GAppLaunchContext
9615 * Gets the complete environment variable list to be passed to
9616 * the child process when @context is used to launch an application.
9617 * This is a %NULL-terminated array of strings, where each string has
9618 * the form <literal>KEY=VALUE</literal>.
9620 * Returns: (array zero-terminated=1) (transfer full): the child's environment
9626 * g_app_launch_context_get_startup_notify_id:
9627 * @context: a #GAppLaunchContext
9628 * @info: a #GAppInfo
9629 * @files: (element-type GFile): a #GList of of #GFile objects
9631 * Initiates startup notification for the application and returns the
9632 * <envar>DESKTOP_STARTUP_ID</envar> for the launched operation,
9635 * Startup notification IDs are defined in the <ulink
9636 * url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">
9637 * FreeDesktop.Org Startup Notifications standard</ulink>.
9639 * Returns: a startup notification ID for the application, or %NULL if not supported.
9644 * g_app_launch_context_launch_failed:
9645 * @context: a #GAppLaunchContext.
9646 * @startup_notify_id: the startup notification id that was returned by g_app_launch_context_get_startup_notify_id().
9648 * Called when an application has failed to launch, so that it can cancel
9649 * the application startup notification started in g_app_launch_context_get_startup_notify_id().
9654 * g_app_launch_context_new:
9656 * Creates a new application launch context. This is not normally used,
9657 * instead you instantiate a subclass of this, such as #GdkAppLaunchContext.
9659 * Returns: a #GAppLaunchContext.
9664 * g_app_launch_context_setenv:
9665 * @context: a #GAppLaunchContext
9666 * @variable: the environment variable to set
9667 * @value: the value for to set the variable to.
9669 * Arranges for @variable to be set to @value in the child's
9670 * environment when @context is used to launch an application.
9677 * g_app_launch_context_unsetenv:
9678 * @context: a #GAppLaunchContext
9679 * @variable: the environment variable to remove
9681 * Arranges for @variable to be unset in the child's environment
9682 * when @context is used to launch an application.
9689 * g_application_activate:
9690 * @application: a #GApplication
9692 * Activates the application.
9694 * In essence, this results in the #GApplication::activate signal being
9695 * emitted in the primary instance.
9697 * The application must be registered before calling this function.
9704 * g_application_command_line_get_arguments:
9705 * @cmdline: a #GApplicationCommandLine
9706 * @argc: (out) (allow-none): the length of the arguments array, or %NULL
9708 * Gets the list of arguments that was passed on the command line.
9710 * The strings in the array may contain non-utf8 data.
9712 * The return value is %NULL-terminated and should be freed using
9715 * Returns: (array length=argc) (transfer full): the string array containing the arguments (the argv)
9721 * g_application_command_line_get_cwd:
9722 * @cmdline: a #GApplicationCommandLine
9724 * Gets the working directory of the command line invocation.
9725 * The string may contain non-utf8 data.
9727 * It is possible that the remote application did not send a working
9728 * directory, so this may be %NULL.
9730 * The return value should not be modified or freed and is valid for as
9731 * long as @cmdline exists.
9733 * Returns: the current directory, or %NULL
9739 * g_application_command_line_get_environ:
9740 * @cmdline: a #GApplicationCommandLine
9742 * Gets the contents of the 'environ' variable of the command line
9743 * invocation, as would be returned by g_get_environ(), ie as a
9744 * %NULL-terminated list of strings in the form 'NAME=VALUE'.
9745 * The strings may contain non-utf8 data.
9747 * The remote application usually does not send an environment. Use
9748 * %G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag
9749 * set it is possible that the environment is still not available (due
9750 * to invocation messages from other applications).
9752 * The return value should not be modified or freed and is valid for as
9753 * long as @cmdline exists.
9755 * See g_application_command_line_getenv() if you are only interested
9756 * in the value of a single environment variable.
9758 * Returns: (array zero-terminated=1) (transfer none): the environment strings, or %NULL if they were not sent
9764 * g_application_command_line_get_exit_status:
9765 * @cmdline: a #GApplicationCommandLine
9767 * Gets the exit status of @cmdline. See
9768 * g_application_command_line_set_exit_status() for more information.
9770 * Returns: the exit status
9776 * g_application_command_line_get_is_remote:
9777 * @cmdline: a #GApplicationCommandLine
9779 * Determines if @cmdline represents a remote invocation.
9781 * Returns: %TRUE if the invocation was remote
9787 * g_application_command_line_get_platform_data:
9788 * @cmdline: #GApplicationCommandLine
9790 * Gets the platform data associated with the invocation of @cmdline.
9792 * This is a #GVariant dictionary containing information about the
9793 * context in which the invocation occurred. It typically contains
9794 * information like the current working directory and the startup
9797 * For local invocation, it will be %NULL.
9799 * Returns: (allow-none): the platform data, or %NULL
9805 * g_application_command_line_getenv:
9806 * @cmdline: a #GApplicationCommandLine
9807 * @name: the environment variable to get
9809 * Gets the value of a particular environment variable of the command
9810 * line invocation, as would be returned by g_getenv(). The strings may
9811 * contain non-utf8 data.
9813 * The remote application usually does not send an environment. Use
9814 * %G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag
9815 * set it is possible that the environment is still not available (due
9816 * to invocation messages from other applications).
9818 * The return value should not be modified or freed and is valid for as
9819 * long as @cmdline exists.
9821 * Returns: the value of the variable, or %NULL if unset or unsent
9827 * g_application_command_line_print:
9828 * @cmdline: a #GApplicationCommandLine
9829 * @format: a printf-style format string
9830 * @...: arguments, as per @format
9832 * Formats a message and prints it using the stdout print handler in the
9835 * If @cmdline is a local invocation then this is exactly equivalent to
9836 * g_print(). If @cmdline is remote then this is equivalent to calling
9837 * g_print() in the invoking process.
9844 * g_application_command_line_printerr:
9845 * @cmdline: a #GApplicationCommandLine
9846 * @format: a printf-style format string
9847 * @...: arguments, as per @format
9849 * Formats a message and prints it using the stderr print handler in the
9852 * If @cmdline is a local invocation then this is exactly equivalent to
9853 * g_printerr(). If @cmdline is remote then this is equivalent to
9854 * calling g_printerr() in the invoking process.
9861 * g_application_command_line_set_exit_status:
9862 * @cmdline: a #GApplicationCommandLine
9863 * @exit_status: the exit status
9865 * Sets the exit status that will be used when the invoking process
9868 * The return value of the #GApplication::command-line signal is
9869 * passed to this function when the handler returns. This is the usual
9870 * way of setting the exit status.
9872 * In the event that you want the remote invocation to continue running
9873 * and want to decide on the exit status in the future, you can use this
9874 * call. For the case of a remote invocation, the remote process will
9875 * typically exit when the last reference is dropped on @cmdline. The
9876 * exit status of the remote process will be equal to the last value
9877 * that was set with this function.
9879 * In the case that the commandline invocation is local, the situation
9880 * is slightly more complicated. If the commandline invocation results
9881 * in the mainloop running (ie: because the use-count of the application
9882 * increased to a non-zero value) then the application is considered to
9883 * have been 'successful' in a certain sense, and the exit status is
9884 * always zero. If the application use count is zero, though, the exit
9885 * status of the local #GApplicationCommandLine is used.
9892 * g_application_get_application_id:
9893 * @application: a #GApplication
9895 * Gets the unique identifier for @application.
9897 * Returns: the identifier for @application, owned by @application
9903 * g_application_get_dbus_connection:
9904 * @application: a #GApplication
9906 * Gets the #GDBusConnection being used by the application, or %NULL.
9908 * If #GApplication is using its D-Bus backend then this function will
9909 * return the #GDBusConnection being used for uniqueness and
9910 * communication with the desktop environment and other instances of the
9913 * If #GApplication is not using D-Bus then this function will return
9914 * %NULL. This includes the situation where the D-Bus backend would
9915 * normally be in use but we were unable to connect to the bus.
9917 * This function must not be called before the application has been
9918 * registered. See g_application_get_is_registered().
9920 * Returns: (transfer none): a #GDBusConnection, or %NULL
9926 * g_application_get_dbus_object_path:
9927 * @application: a #GApplication
9929 * Gets the D-Bus object path being used by the application, or %NULL.
9931 * If #GApplication is using its D-Bus backend then this function will
9932 * return the D-Bus object path that #GApplication is using. If the
9933 * application is the primary instance then there is an object published
9934 * at this path. If the application is not the primary instance then
9935 * the result of this function is undefined.
9937 * If #GApplication is not using D-Bus then this function will return
9938 * %NULL. This includes the situation where the D-Bus backend would
9939 * normally be in use but we were unable to connect to the bus.
9941 * This function must not be called before the application has been
9942 * registered. See g_application_get_is_registered().
9944 * Returns: the object path, or %NULL
9950 * g_application_get_default:
9952 * Returns the default #GApplication instance for this process.
9954 * Normally there is only one #GApplication per process and it becomes
9955 * the default when it is created. You can exercise more control over
9956 * this by using g_application_set_default().
9958 * If there is no default application then %NULL is returned.
9960 * Returns: (transfer none): the default application for this process, or %NULL
9966 * g_application_get_flags:
9967 * @application: a #GApplication
9969 * Gets the flags for @application.
9971 * See #GApplicationFlags.
9973 * Returns: the flags for @application
9979 * g_application_get_inactivity_timeout:
9980 * @application: a #GApplication
9982 * Gets the current inactivity timeout for the application.
9984 * This is the amount of time (in milliseconds) after the last call to
9985 * g_application_release() before the application stops running.
9987 * Returns: the timeout, in milliseconds
9993 * g_application_get_is_registered:
9994 * @application: a #GApplication
9996 * Checks if @application is registered.
9998 * An application is registered if g_application_register() has been
9999 * successfully called.
10001 * Returns: %TRUE if @application is registered
10007 * g_application_get_is_remote:
10008 * @application: a #GApplication
10010 * Checks if @application is remote.
10012 * If @application is remote then it means that another instance of
10013 * application already exists (the 'primary' instance). Calls to
10014 * perform actions on @application will result in the actions being
10015 * performed by the primary instance.
10017 * The value of this property cannot be accessed before
10018 * g_application_register() has been called. See
10019 * g_application_get_is_registered().
10021 * Returns: %TRUE if @application is remote
10027 * g_application_hold:
10028 * @application: a #GApplication
10030 * Increases the use count of @application.
10032 * Use this function to indicate that the application has a reason to
10033 * continue to run. For example, g_application_hold() is called by GTK+
10034 * when a toplevel window is on the screen.
10036 * To cancel the hold, call g_application_release().
10041 * g_application_id_is_valid:
10042 * @application_id: a potential application identifier
10044 * Checks if @application_id is a valid application identifier.
10046 * A valid ID is required for calls to g_application_new() and
10047 * g_application_set_application_id().
10049 * For convenience, the restrictions on application identifiers are
10052 * <listitem>Application identifiers must contain only the ASCII characters "[A-Z][a-z][0-9]_-." and must not begin with a digit.</listitem>
10053 * <listitem>Application identifiers must contain at least one '.' (period) character (and thus at least three elements).</listitem>
10054 * <listitem>Application identifiers must not begin or end with a '.' (period) character.</listitem>
10055 * <listitem>Application identifiers must not contain consecutive '.' (period) characters.</listitem>
10056 * <listitem>Application identifiers must not exceed 255 characters.</listitem>
10059 * Returns: %TRUE if @application_id is valid
10064 * g_application_new:
10065 * @application_id: (allow-none): the application id
10066 * @flags: the application flags
10068 * Creates a new #GApplication instance.
10070 * This function calls g_type_init() for you.
10072 * If non-%NULL, the application id must be valid. See
10073 * g_application_id_is_valid().
10075 * If no application ID is given then some features of #GApplication
10076 * (most notably application uniqueness) will be disabled.
10078 * Returns: a new #GApplication instance
10083 * g_application_open:
10084 * @application: a #GApplication
10085 * @files: (array length=n_files): an array of #GFiles to open
10086 * @n_files: the length of the @files array
10087 * @hint: a hint (or ""), but never %NULL
10089 * Opens the given files.
10091 * In essence, this results in the #GApplication::open signal being emitted
10092 * in the primary instance.
10094 * @n_files must be greater than zero.
10096 * @hint is simply passed through to the ::open signal. It is
10097 * intended to be used by applications that have multiple modes for
10098 * opening files (eg: "view" vs "edit", etc). Unless you have a need
10099 * for this functionality, you should use "".
10101 * The application must be registered before calling this function
10102 * and it must have the %G_APPLICATION_HANDLES_OPEN flag set.
10109 * g_application_quit:
10110 * @application: a #GApplication
10112 * Immediately quits the application.
10114 * Upon return to the mainloop, g_application_run() will return,
10115 * calling only the 'shutdown' function before doing so.
10117 * The hold count is ignored.
10119 * The result of calling g_application_run() again after it returns is
10127 * g_application_register:
10128 * @application: a #GApplication
10129 * @cancellable: (allow-none): a #GCancellable, or %NULL
10130 * @error: a pointer to a NULL #GError, or %NULL
10132 * Attempts registration of the application.
10134 * This is the point at which the application discovers if it is the
10135 * primary instance or merely acting as a remote for an already-existing
10136 * primary instance. This is implemented by attempting to acquire the
10137 * application identifier as a unique bus name on the session bus using
10140 * If there is no application ID or if %G_APPLICATION_NON_UNIQUE was
10141 * given, then this process will always become the primary instance.
10143 * Due to the internal architecture of GDBus, method calls can be
10144 * dispatched at any time (even if a main loop is not running). For
10145 * this reason, you must ensure that any object paths that you wish to
10146 * register are registered before calling this function.
10148 * If the application has already been registered then %TRUE is
10149 * returned with no work performed.
10151 * The #GApplication::startup signal is emitted if registration succeeds
10152 * and @application is the primary instance (including the non-unique
10155 * In the event of an error (such as @cancellable being cancelled, or a
10156 * failure to connect to the session bus), %FALSE is returned and @error
10157 * is set appropriately.
10159 * Note: the return value of this function is not an indicator that this
10160 * instance is or is not the primary instance of the application. See
10161 * g_application_get_is_remote() for that.
10163 * Returns: %TRUE if registration succeeded
10169 * g_application_release:
10170 * @application: a #GApplication
10172 * Decrease the use count of @application.
10174 * When the use count reaches zero, the application will stop running.
10176 * Never call this function except to cancel the effect of a previous
10177 * call to g_application_hold().
10182 * g_application_run:
10183 * @application: a #GApplication
10184 * @argc: the argc from main() (or 0 if @argv is %NULL)
10185 * @argv: (array length=argc) (allow-none): the argv from main(), or %NULL
10187 * Runs the application.
10189 * This function is intended to be run from main() and its return value
10190 * is intended to be returned by main(). Although you are expected to pass
10191 * the @argc, @argv parameters from main() to this function, it is possible
10192 * to pass %NULL if @argv is not available or commandline handling is not
10195 * First, the local_command_line() virtual function is invoked.
10196 * This function always runs on the local instance. It gets passed a pointer
10197 * to a %NULL-terminated copy of @argv and is expected to remove the arguments
10198 * that it handled (shifting up remaining arguments). See
10199 * <xref linkend="gapplication-example-cmdline2"/> for an example of
10200 * parsing @argv manually. Alternatively, you may use the #GOptionContext API,
10201 * after setting <literal>argc = g_strv_length (argv);</literal>.
10203 * The last argument to local_command_line() is a pointer to the @status
10204 * variable which can used to set the exit status that is returned from
10205 * g_application_run().
10207 * If local_command_line() returns %TRUE, the command line is expected
10208 * to be completely handled, including possibly registering as the primary
10209 * instance, calling g_application_activate() or g_application_open(), etc.
10211 * If local_command_line() returns %FALSE then the application is registered
10212 * and the #GApplication::command-line signal is emitted in the primary
10213 * instance (which may or may not be this instance). The signal handler
10214 * gets passed a #GApplicationCommandLine object that (among other things)
10215 * contains the remaining commandline arguments that have not been handled
10216 * by local_command_line().
10218 * If the application has the %G_APPLICATION_HANDLES_COMMAND_LINE
10219 * flag set then the default implementation of local_command_line()
10220 * always returns %FALSE immediately, resulting in the commandline
10221 * always being handled in the primary instance.
10223 * Otherwise, the default implementation of local_command_line() tries
10224 * to do a couple of things that are probably reasonable for most
10225 * applications. First, g_application_register() is called to attempt
10226 * to register the application. If that works, then the command line
10227 * arguments are inspected. If no commandline arguments are given, then
10228 * g_application_activate() is called. If commandline arguments are
10229 * given and the %G_APPLICATION_HANDLES_OPEN flag is set then they
10230 * are assumed to be filenames and g_application_open() is called.
10232 * If you need to handle commandline arguments that are not filenames,
10233 * and you don't mind commandline handling to happen in the primary
10234 * instance, you should set %G_APPLICATION_HANDLES_COMMAND_LINE and
10235 * process the commandline arguments in your #GApplication::command-line
10236 * signal handler, either manually or using the #GOptionContext API.
10238 * If you are interested in doing more complicated local handling of the
10239 * commandline then you should implement your own #GApplication subclass
10240 * and override local_command_line(). In this case, you most likely want
10241 * to return %TRUE from your local_command_line() implementation to
10242 * suppress the default handling. See
10243 * <xref linkend="gapplication-example-cmdline2"/> for an example.
10245 * If, after the above is done, the use count of the application is zero
10246 * then the exit status is returned immediately. If the use count is
10247 * non-zero then the default main context is iterated until the use count
10248 * falls to zero, at which point 0 is returned.
10250 * If the %G_APPLICATION_IS_SERVICE flag is set, then the exiting at
10251 * use count of zero is delayed for a while (ie: the instance stays
10252 * around to provide its <emphasis>service</emphasis> to others).
10254 * Returns: the exit status
10260 * g_application_set_action_group:
10261 * @application: a #GApplication
10262 * @action_group: (allow-none): a #GActionGroup, or %NULL
10264 * This used to be how actions were associated with a #GApplication.
10265 * Now there is #GActionMap for that.
10268 * 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.
10273 * g_application_set_application_id:
10274 * @application: a #GApplication
10275 * @application_id: (allow-none): the identifier for @application
10277 * Sets the unique identifier for @application.
10279 * The application id can only be modified if @application has not yet
10282 * If non-%NULL, the application id must be valid. See
10283 * g_application_id_is_valid().
10290 * g_application_set_default:
10291 * @application: (allow-none): the application to set as default, or %NULL
10293 * Sets or unsets the default application for the process, as returned
10294 * by g_application_get_default().
10296 * This function does not take its own reference on @application. If
10297 * @application is destroyed then the default application will revert
10305 * g_application_set_flags:
10306 * @application: a #GApplication
10307 * @flags: the flags for @application
10309 * Sets the flags for @application.
10311 * The flags can only be modified if @application has not yet been
10314 * See #GApplicationFlags.
10321 * g_application_set_inactivity_timeout:
10322 * @application: a #GApplication
10323 * @inactivity_timeout: the timeout, in milliseconds
10325 * Sets the current inactivity timeout for the application.
10327 * This is the amount of time (in milliseconds) after the last call to
10328 * g_application_release() before the application stops running.
10330 * This call has no side effects of its own. The value set here is only
10331 * used for next time g_application_release() drops the use count to
10332 * zero. Any timeouts currently in progress are not impacted.
10339 * g_async_initable_init_async:
10340 * @initable: a #GAsyncInitable.
10341 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10342 * @cancellable: optional #GCancellable object, %NULL to ignore.
10343 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
10344 * @user_data: the data to pass to callback function
10346 * Starts asynchronous initialization of the object implementing the
10347 * interface. This must be done before any real use of the object after
10348 * initial construction. If the object also implements #GInitable you can
10349 * optionally call g_initable_init() instead.
10351 * When the initialization is finished, @callback will be called. You can
10352 * then call g_async_initable_init_finish() to get the result of the
10355 * Implementations may also support cancellation. If @cancellable is not
10356 * %NULL, then initialization can be cancelled by triggering the cancellable
10357 * object from another thread. If the operation was cancelled, the error
10358 * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL, and
10359 * the object doesn't support cancellable initialization, the error
10360 * %G_IO_ERROR_NOT_SUPPORTED will be returned.
10362 * As with #GInitable, if the object is not initialized, or initialization
10363 * returns with an error, then all operations on the object except
10364 * g_object_ref() and g_object_unref() are considered to be invalid, and
10365 * have undefined behaviour. They will often fail with g_critical() or
10366 * g_warning(), but this must not be relied on.
10368 * Implementations of this method must be idempotent: i.e. multiple calls
10369 * to this function with the same argument should return the same results.
10370 * Only the first call initializes the object; further calls return the result
10371 * of the first call. This is so that it's safe to implement the singleton
10372 * pattern in the GObject constructor function.
10374 * For classes that also support the #GInitable interface, the default
10375 * implementation of this method will run the g_initable_init() function
10376 * in a thread, so if you want to support asynchronous initialization via
10377 * threads, just implement the #GAsyncInitable interface without overriding
10378 * any interface methods.
10385 * g_async_initable_init_finish:
10386 * @initable: a #GAsyncInitable.
10387 * @res: a #GAsyncResult.
10388 * @error: a #GError location to store the error occurring, or %NULL to ignore.
10390 * Finishes asynchronous initialization and returns the result.
10391 * See g_async_initable_init_async().
10393 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
10399 * g_async_initable_new_async:
10400 * @object_type: a #GType supporting #GAsyncInitable.
10401 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10402 * @cancellable: optional #GCancellable object, %NULL to ignore.
10403 * @callback: a #GAsyncReadyCallback to call when the initialization is finished
10404 * @user_data: the data to pass to callback function
10405 * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
10406 * @...: the value of the first property, followed by other property value pairs, and ended by %NULL.
10408 * Helper function for constructing #GAsyncInitable object. This is
10409 * similar to g_object_new() but also initializes the object asynchronously.
10411 * When the initialization is finished, @callback will be called. You can
10412 * then call g_async_initable_new_finish() to get the new object and check
10420 * g_async_initable_new_finish:
10421 * @initable: the #GAsyncInitable from the callback
10422 * @res: the #GAsyncResult from the callback
10423 * @error: return location for errors, or %NULL to ignore
10425 * Finishes the async construction for the various g_async_initable_new
10426 * calls, returning the created object or %NULL on error.
10428 * Returns: (transfer full): a newly created #GObject, or %NULL on error. Free with g_object_unref().
10434 * g_async_initable_new_valist_async:
10435 * @object_type: a #GType supporting #GAsyncInitable.
10436 * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
10437 * @var_args: The var args list generated from @first_property_name.
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
10443 * Helper function for constructing #GAsyncInitable object. This is
10444 * similar to g_object_new_valist() but also initializes the object
10447 * When the initialization is finished, @callback will be called. You can
10448 * then call g_async_initable_new_finish() to get the new object and check
10456 * g_async_initable_newv_async:
10457 * @object_type: a #GType supporting #GAsyncInitable.
10458 * @n_parameters: the number of parameters in @parameters
10459 * @parameters: the parameters to use to construct the object
10460 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
10461 * @cancellable: optional #GCancellable object, %NULL to ignore.
10462 * @callback: a #GAsyncReadyCallback to call when the initialization is finished
10463 * @user_data: the data to pass to callback function
10465 * Helper function for constructing #GAsyncInitable object. This is
10466 * similar to g_object_newv() but also initializes the object asynchronously.
10468 * When the initialization is finished, @callback will be called. You can
10469 * then call g_async_initable_new_finish() to get the new object and check
10477 * g_async_result_get_source_object:
10478 * @res: a #GAsyncResult
10480 * Gets the source object from a #GAsyncResult.
10482 * Returns: (transfer full): a new reference to the source object for the @res, or %NULL if there is none.
10487 * g_async_result_get_user_data:
10488 * @res: a #GAsyncResult.
10490 * Gets the user data from a #GAsyncResult.
10492 * Returns: (transfer full): the user data for @res.
10497 * g_buffered_input_stream_fill:
10498 * @stream: a #GBufferedInputStream
10499 * @count: the number of bytes that will be read from the stream
10500 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
10501 * @error: location to store the error occurring, or %NULL to ignore
10503 * Tries to read @count bytes from the stream into the buffer.
10504 * Will block during this read.
10506 * If @count is zero, returns zero and does nothing. A value of @count
10507 * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
10509 * On success, the number of bytes read into the buffer is returned.
10510 * It is not an error if this is not the same as the requested size, as it
10511 * can happen e.g. near the end of a file. Zero is returned on end of file
10512 * (or if @count is zero), but never otherwise.
10514 * If @count is -1 then the attempted read size is equal to the number of
10515 * bytes that are required to fill the buffer.
10517 * If @cancellable is not %NULL, then the operation can be cancelled by
10518 * triggering the cancellable object from another thread. If the operation
10519 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
10520 * operation was partially finished when the operation was cancelled the
10521 * partial result will be returned, without an error.
10523 * On error -1 is returned and @error is set accordingly.
10525 * For the asynchronous, non-blocking, version of this function, see
10526 * g_buffered_input_stream_fill_async().
10528 * Returns: the number of bytes read into @stream's buffer, up to @count, or -1 on error.
10533 * g_buffered_input_stream_fill_async:
10534 * @stream: a #GBufferedInputStream
10535 * @count: the number of bytes that will be read from the stream
10536 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
10537 * @cancellable: (allow-none): optional #GCancellable object
10538 * @callback: (scope async): a #GAsyncReadyCallback
10539 * @user_data: (closure): a #gpointer
10541 * Reads data into @stream's buffer asynchronously, up to @count size.
10542 * @io_priority can be used to prioritize reads. For the synchronous
10543 * version of this function, see g_buffered_input_stream_fill().
10545 * If @count is -1 then the attempted read size is equal to the number
10546 * of bytes that are required to fill the buffer.
10551 * g_buffered_input_stream_fill_finish:
10552 * @stream: a #GBufferedInputStream
10553 * @result: a #GAsyncResult
10554 * @error: a #GError
10556 * Finishes an asynchronous read.
10558 * Returns: a #gssize of the read stream, or %-1 on an error.
10563 * g_buffered_input_stream_get_available:
10564 * @stream: #GBufferedInputStream
10566 * Gets the size of the available data within the stream.
10568 * Returns: size of the available stream.
10573 * g_buffered_input_stream_get_buffer_size:
10574 * @stream: a #GBufferedInputStream
10576 * Gets the size of the input buffer.
10578 * Returns: the current buffer size.
10583 * g_buffered_input_stream_new:
10584 * @base_stream: a #GInputStream
10586 * Creates a new #GInputStream from the given @base_stream, with
10587 * a buffer set to the default size (4 kilobytes).
10589 * Returns: a #GInputStream for the given @base_stream.
10594 * g_buffered_input_stream_new_sized:
10595 * @base_stream: a #GInputStream
10598 * Creates a new #GBufferedInputStream from the given @base_stream,
10599 * with a buffer set to @size.
10601 * Returns: a #GInputStream.
10606 * g_buffered_input_stream_peek:
10607 * @stream: a #GBufferedInputStream
10608 * @buffer: (array length=count) (element-type guint8): a pointer to an allocated chunk of memory
10609 * @offset: a #gsize
10612 * Peeks in the buffer, copying data of size @count into @buffer,
10613 * offset @offset bytes.
10615 * Returns: a #gsize of the number of bytes peeked, or -1 on error.
10620 * g_buffered_input_stream_peek_buffer:
10621 * @stream: a #GBufferedInputStream
10622 * @count: (out): a #gsize to get the number of bytes available in the buffer
10624 * Returns the buffer with the currently available bytes. The returned
10625 * buffer must not be modified and will become invalid when reading from
10626 * the stream or filling the buffer.
10628 * Returns: (array length=count) (element-type guint8) (transfer none): read-only buffer
10633 * g_buffered_input_stream_read_byte:
10634 * @stream: a #GBufferedInputStream
10635 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
10636 * @error: location to store the error occurring, or %NULL to ignore
10638 * Tries to read a single byte from the stream or the buffer. Will block
10639 * during this read.
10641 * On success, the byte read from the stream is returned. On end of stream
10642 * -1 is returned but it's not an exceptional error and @error is not set.
10644 * If @cancellable is not %NULL, then the operation can be cancelled by
10645 * triggering the cancellable object from another thread. If the operation
10646 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
10647 * operation was partially finished when the operation was cancelled the
10648 * partial result will be returned, without an error.
10650 * On error -1 is returned and @error is set accordingly.
10652 * Returns: the byte read from the @stream, or -1 on end of stream or error.
10657 * g_buffered_input_stream_set_buffer_size:
10658 * @stream: a #GBufferedInputStream
10661 * Sets the size of the internal buffer of @stream to @size, or to the
10662 * size of the contents of the buffer. The buffer can never be resized
10663 * smaller than its current contents.
10668 * g_buffered_output_stream_get_auto_grow:
10669 * @stream: a #GBufferedOutputStream.
10671 * Checks if the buffer automatically grows as data is added.
10673 * Returns: %TRUE if the @stream's buffer automatically grows, %FALSE otherwise.
10678 * g_buffered_output_stream_get_buffer_size:
10679 * @stream: a #GBufferedOutputStream.
10681 * Gets the size of the buffer in the @stream.
10683 * Returns: the current size of the buffer.
10688 * g_buffered_output_stream_new:
10689 * @base_stream: a #GOutputStream.
10691 * Creates a new buffered output stream for a base stream.
10693 * Returns: a #GOutputStream for the given @base_stream.
10698 * g_buffered_output_stream_new_sized:
10699 * @base_stream: a #GOutputStream.
10702 * Creates a new buffered output stream with a given buffer size.
10704 * Returns: a #GOutputStream with an internal buffer set to @size.
10709 * g_buffered_output_stream_set_auto_grow:
10710 * @stream: a #GBufferedOutputStream.
10711 * @auto_grow: a #gboolean.
10713 * Sets whether or not the @stream's buffer should automatically grow.
10714 * If @auto_grow is true, then each write will just make the buffer
10715 * larger, and you must manually flush the buffer to actually write out
10716 * the data to the underlying stream.
10721 * g_buffered_output_stream_set_buffer_size:
10722 * @stream: a #GBufferedOutputStream.
10725 * Sets the size of the internal buffer to @size.
10731 * @bus_type: A #GBusType.
10732 * @cancellable: (allow-none): A #GCancellable or %NULL.
10733 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
10734 * @user_data: The data to pass to @callback.
10736 * Asynchronously connects to the message bus specified by @bus_type.
10738 * When the operation is finished, @callback will be invoked. You can
10739 * then call g_bus_get_finish() to get the result of the operation.
10741 * This is a asynchronous failable function. See g_bus_get_sync() for
10742 * the synchronous version.
10749 * g_bus_get_finish:
10750 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_bus_get().
10751 * @error: Return location for error or %NULL.
10753 * Finishes an operation started with g_bus_get().
10755 * The returned object is a singleton, that is, shared with other
10756 * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
10757 * event that you need a private message bus connection, use
10758 * g_dbus_address_get_for_bus_sync() and
10759 * g_dbus_connection_new_for_address().
10761 * Note that the returned #GDBusConnection object will (usually) have
10762 * the #GDBusConnection:exit-on-close property set to %TRUE.
10764 * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
10771 * @bus_type: A #GBusType.
10772 * @cancellable: (allow-none): A #GCancellable or %NULL.
10773 * @error: Return location for error or %NULL.
10775 * Synchronously connects to the message bus specified by @bus_type.
10776 * Note that the returned object may shared with other callers,
10777 * e.g. if two separate parts of a process calls this function with
10778 * the same @bus_type, they will share the same object.
10780 * This is a synchronous failable function. See g_bus_get() and
10781 * g_bus_get_finish() for the asynchronous version.
10783 * The returned object is a singleton, that is, shared with other
10784 * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
10785 * event that you need a private message bus connection, use
10786 * g_dbus_address_get_for_bus_sync() and
10787 * g_dbus_connection_new_for_address().
10789 * Note that the returned #GDBusConnection object will (usually) have
10790 * the #GDBusConnection:exit-on-close property set to %TRUE.
10792 * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
10799 * @bus_type: The type of bus to own a name on.
10800 * @name: The well-known name to own.
10801 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10802 * @bus_acquired_handler: (allow-none): Handler to invoke when connected to the bus of type @bus_type or %NULL.
10803 * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
10804 * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
10805 * @user_data: User data to pass to handlers.
10806 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10808 * Starts acquiring @name on the bus specified by @bus_type and calls
10809 * @name_acquired_handler and @name_lost_handler when the name is
10810 * acquired respectively lost. Callbacks will be invoked in the <link
10811 * linkend="g-main-context-push-thread-default">thread-default main
10812 * loop</link> of the thread you are calling this function from.
10814 * You are guaranteed that one of the @name_acquired_handler and @name_lost_handler
10815 * callbacks will be invoked after calling this function - there are three
10819 * @name_lost_handler with a %NULL connection (if a connection to the bus can't be made).
10820 * </para></listitem>
10822 * @bus_acquired_handler then @name_lost_handler (if the name can't be obtained)
10823 * </para></listitem>
10825 * @bus_acquired_handler then @name_acquired_handler (if the name was obtained).
10826 * </para></listitem>
10828 * When you are done owning the name, just call g_bus_unown_name()
10829 * with the owner id this function returns.
10831 * If the name is acquired or lost (for example another application
10832 * could acquire the name if you allow replacement or the application
10833 * currently owning the name exits), the handlers are also invoked. If the
10834 * #GDBusConnection that is used for attempting to own the name
10835 * closes, then @name_lost_handler is invoked since it is no
10836 * longer possible for other processes to access the process.
10838 * You cannot use g_bus_own_name() several times for the same name (unless
10839 * interleaved with calls to g_bus_unown_name()) - only the first call
10842 * Another guarantee is that invocations of @name_acquired_handler
10843 * and @name_lost_handler are guaranteed to alternate; that
10844 * is, if @name_acquired_handler is invoked then you are
10845 * guaranteed that the next time one of the handlers is invoked, it
10846 * will be @name_lost_handler. The reverse is also true.
10848 * If you plan on exporting objects (using e.g.
10849 * g_dbus_connection_register_object()), note that it is generally too late
10850 * to export the objects in @name_acquired_handler. Instead, you can do this
10851 * in @bus_acquired_handler since you are guaranteed that this will run
10852 * before @name is requested from the bus.
10854 * This behavior makes it very simple to write applications that wants
10855 * to own names and export objects, see <xref linkend="gdbus-owning-names"/>.
10856 * Simply register objects to be exported in @bus_acquired_handler and
10857 * unregister the objects (if any) in @name_lost_handler.
10859 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10865 * g_bus_own_name_on_connection:
10866 * @connection: A #GDBusConnection.
10867 * @name: The well-known name to own.
10868 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10869 * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
10870 * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
10871 * @user_data: User data to pass to handlers.
10872 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10874 * Like g_bus_own_name() but takes a #GDBusConnection instead of a
10877 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10883 * g_bus_own_name_on_connection_with_closures:
10884 * @connection: A #GDBusConnection.
10885 * @name: The well-known name to own.
10886 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10887 * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
10888 * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
10890 * Version of g_bus_own_name_on_connection() using closures instead of callbacks for
10891 * easier binding in other languages.
10893 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10894 * Rename to: g_bus_own_name_on_connection
10900 * g_bus_own_name_with_closures:
10901 * @bus_type: The type of bus to own a name on.
10902 * @name: The well-known name to own.
10903 * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10904 * @bus_acquired_closure: (allow-none): #GClosure to invoke when connected to the bus of type @bus_type or %NULL.
10905 * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
10906 * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
10908 * Version of g_bus_own_name() using closures instead of callbacks for
10909 * easier binding in other languages.
10911 * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10912 * Rename to: g_bus_own_name
10918 * g_bus_unown_name:
10919 * @owner_id: An identifier obtained from g_bus_own_name()
10921 * Stops owning a name.
10928 * g_bus_unwatch_name:
10929 * @watcher_id: An identifier obtained from g_bus_watch_name()
10931 * Stops watching a name.
10938 * g_bus_watch_name:
10939 * @bus_type: The type of bus to watch a name on.
10940 * @name: The name (well-known or unique) to watch.
10941 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
10942 * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
10943 * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
10944 * @user_data: User data to pass to handlers.
10945 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10947 * Starts watching @name on the bus specified by @bus_type and calls
10948 * @name_appeared_handler and @name_vanished_handler when the name is
10949 * known to have a owner respectively known to lose its
10950 * owner. Callbacks will be invoked in the <link
10951 * linkend="g-main-context-push-thread-default">thread-default main
10952 * loop</link> of the thread you are calling this function from.
10954 * You are guaranteed that one of the handlers will be invoked after
10955 * calling this function. When you are done watching the name, just
10956 * call g_bus_unwatch_name() with the watcher id this function
10959 * If the name vanishes or appears (for example the application owning
10960 * the name could restart), the handlers are also invoked. If the
10961 * #GDBusConnection that is used for watching the name disconnects, then
10962 * @name_vanished_handler is invoked since it is no longer
10963 * possible to access the name.
10965 * Another guarantee is that invocations of @name_appeared_handler
10966 * and @name_vanished_handler are guaranteed to alternate; that
10967 * is, if @name_appeared_handler is invoked then you are
10968 * guaranteed that the next time one of the handlers is invoked, it
10969 * will be @name_vanished_handler. The reverse is also true.
10971 * This behavior makes it very simple to write applications that wants
10972 * to take action when a certain name exists, see <xref
10973 * linkend="gdbus-watching-names"/>. Basically, the application
10974 * should create object proxies in @name_appeared_handler and destroy
10975 * them again (if any) in @name_vanished_handler.
10977 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
10983 * g_bus_watch_name_on_connection:
10984 * @connection: A #GDBusConnection.
10985 * @name: The name (well-known or unique) to watch.
10986 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
10987 * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
10988 * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
10989 * @user_data: User data to pass to handlers.
10990 * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10992 * Like g_bus_watch_name() but takes a #GDBusConnection instead of a
10995 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11001 * g_bus_watch_name_on_connection_with_closures:
11002 * @connection: A #GDBusConnection.
11003 * @name: The name (well-known or unique) to watch.
11004 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11005 * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
11006 * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
11008 * Version of g_bus_watch_name_on_connection() using closures instead of callbacks for
11009 * easier binding in other languages.
11011 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11012 * Rename to: g_bus_watch_name_on_connection
11018 * g_bus_watch_name_with_closures:
11019 * @bus_type: The type of bus to watch a name on.
11020 * @name: The name (well-known or unique) to watch.
11021 * @flags: Flags from the #GBusNameWatcherFlags enumeration.
11022 * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
11023 * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
11025 * Version of g_bus_watch_name() using closures instead of callbacks for
11026 * easier binding in other languages.
11028 * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
11029 * Rename to: g_bus_watch_name
11035 * g_cancellable_cancel:
11036 * @cancellable: a #GCancellable object.
11038 * Will set @cancellable to cancelled, and will emit the
11039 * #GCancellable::cancelled signal. (However, see the warning about
11040 * race conditions in the documentation for that signal if you are
11041 * planning to connect to it.)
11043 * This function is thread-safe. In other words, you can safely call
11044 * it from a thread other than the one running the operation that was
11045 * passed the @cancellable.
11047 * The convention within gio is that cancelling an asynchronous
11048 * operation causes it to complete asynchronously. That is, if you
11049 * cancel the operation from the same thread in which it is running,
11050 * then the operation's #GAsyncReadyCallback will not be invoked until
11051 * the application returns to the main loop.
11056 * g_cancellable_connect:
11057 * @cancellable: A #GCancellable.
11058 * @callback: The #GCallback to connect.
11059 * @data: Data to pass to @callback.
11060 * @data_destroy_func: (allow-none): Free function for @data or %NULL.
11062 * Convenience function to connect to the #GCancellable::cancelled
11063 * signal. Also handles the race condition that may happen
11064 * if the cancellable is cancelled right before connecting.
11066 * @callback is called at most once, either directly at the
11067 * time of the connect if @cancellable is already cancelled,
11068 * or when @cancellable is cancelled in some thread.
11070 * @data_destroy_func will be called when the handler is
11071 * disconnected, or immediately if the cancellable is already
11074 * See #GCancellable::cancelled for details on how to use this.
11076 * Returns: The id of the signal handler or 0 if @cancellable has already been cancelled.
11082 * g_cancellable_disconnect:
11083 * @cancellable: (allow-none): A #GCancellable or %NULL.
11084 * @handler_id: Handler id of the handler to be disconnected, or %0.
11086 * Disconnects a handler from a cancellable instance similar to
11087 * g_signal_handler_disconnect(). Additionally, in the event that a
11088 * signal handler is currently running, this call will block until the
11089 * handler has finished. Calling this function from a
11090 * #GCancellable::cancelled signal handler will therefore result in a
11093 * This avoids a race condition where a thread cancels at the
11094 * same time as the cancellable operation is finished and the
11095 * signal handler is removed. See #GCancellable::cancelled for
11096 * details on how to use this.
11098 * If @cancellable is %NULL or @handler_id is %0 this function does
11106 * g_cancellable_get_current:
11108 * Gets the top cancellable from the stack.
11110 * Returns: (transfer none): a #GCancellable from the top of the stack, or %NULL if the stack is empty.
11115 * g_cancellable_get_fd:
11116 * @cancellable: a #GCancellable.
11118 * Gets the file descriptor for a cancellable job. This can be used to
11119 * implement cancellable operations on Unix systems. The returned fd will
11120 * turn readable when @cancellable is cancelled.
11122 * You are not supposed to read from the fd yourself, just check for
11123 * readable status. Reading to unset the readable status is done
11124 * with g_cancellable_reset().
11126 * After a successful return from this function, you should use
11127 * g_cancellable_release_fd() to free up resources allocated for
11128 * the returned file descriptor.
11130 * See also g_cancellable_make_pollfd().
11132 * Returns: A valid file descriptor. %-1 if the file descriptor is not supported, or on errors.
11137 * g_cancellable_is_cancelled:
11138 * @cancellable: (allow-none): a #GCancellable or %NULL
11140 * Checks if a cancellable job has been cancelled.
11142 * Returns: %TRUE if @cancellable is cancelled, FALSE if called with %NULL or if item is not cancelled.
11147 * g_cancellable_make_pollfd:
11148 * @cancellable: (allow-none): a #GCancellable or %NULL
11149 * @pollfd: a pointer to a #GPollFD
11151 * Creates a #GPollFD corresponding to @cancellable; this can be passed
11152 * to g_poll() and used to poll for cancellation. This is useful both
11153 * for unix systems without a native poll and for portability to
11156 * When this function returns %TRUE, you should use
11157 * g_cancellable_release_fd() to free up resources allocated for the
11158 * @pollfd. After a %FALSE return, do not call g_cancellable_release_fd().
11160 * If this function returns %FALSE, either no @cancellable was given or
11161 * resource limits prevent this function from allocating the necessary
11162 * structures for polling. (On Linux, you will likely have reached
11163 * the maximum number of file descriptors.) The suggested way to handle
11164 * these cases is to ignore the @cancellable.
11166 * You are not supposed to read from the fd yourself, just check for
11167 * readable status. Reading to unset the readable status is done
11168 * with g_cancellable_reset().
11170 * Returns: %TRUE if @pollfd was successfully initialized, %FALSE on failure to prepare the cancellable.
11176 * g_cancellable_new:
11178 * Creates a new #GCancellable object.
11180 * Applications that want to start one or more operations
11181 * that should be cancellable should create a #GCancellable
11182 * and pass it to the operations.
11184 * One #GCancellable can be used in multiple consecutive
11185 * operations or in multiple concurrent operations.
11187 * Returns: a #GCancellable.
11192 * g_cancellable_pop_current:
11193 * @cancellable: a #GCancellable object
11195 * Pops @cancellable off the cancellable stack (verifying that @cancellable
11196 * is on the top of the stack).
11201 * g_cancellable_push_current:
11202 * @cancellable: a #GCancellable object
11204 * Pushes @cancellable onto the cancellable stack. The current
11205 * cancellable can then be received using g_cancellable_get_current().
11207 * This is useful when implementing cancellable operations in
11208 * code that does not allow you to pass down the cancellable object.
11210 * This is typically called automatically by e.g. #GFile operations,
11211 * so you rarely have to call this yourself.
11216 * g_cancellable_release_fd:
11217 * @cancellable: a #GCancellable
11219 * Releases a resources previously allocated by g_cancellable_get_fd()
11220 * or g_cancellable_make_pollfd().
11222 * For compatibility reasons with older releases, calling this function
11223 * is not strictly required, the resources will be automatically freed
11224 * when the @cancellable is finalized. However, the @cancellable will
11225 * block scarce file descriptors until it is finalized if this function
11226 * is not called. This can cause the application to run out of file
11227 * descriptors when many #GCancellables are used at the same time.
11234 * g_cancellable_reset:
11235 * @cancellable: a #GCancellable object.
11237 * Resets @cancellable to its uncancelled state.
11239 * If cancellable is currently in use by any cancellable operation
11240 * then the behavior of this function is undefined.
11245 * g_cancellable_set_error_if_cancelled:
11246 * @cancellable: (allow-none): a #GCancellable or %NULL
11247 * @error: #GError to append error state to
11249 * If the @cancellable is cancelled, sets the error to notify
11250 * that the operation was cancelled.
11252 * Returns: %TRUE if @cancellable was cancelled, %FALSE if it was not
11257 * g_cancellable_source_new: (skip)
11258 * @cancellable: (allow-none): a #GCancellable, or %NULL
11260 * Creates a source that triggers if @cancellable is cancelled and
11261 * calls its callback of type #GCancellableSourceFunc. This is
11262 * primarily useful for attaching to another (non-cancellable) source
11263 * with g_source_add_child_source() to add cancellability to it.
11265 * For convenience, you can call this with a %NULL #GCancellable,
11266 * in which case the source will never trigger.
11268 * Returns: (transfer full): the new #GSource.
11274 * g_charset_converter_get_num_fallbacks:
11275 * @converter: a #GCharsetConverter
11277 * Gets the number of fallbacks that @converter has applied so far.
11279 * Returns: the number of fallbacks that @converter has applied
11285 * g_charset_converter_get_use_fallback:
11286 * @converter: a #GCharsetConverter
11288 * Gets the #GCharsetConverter:use-fallback property.
11290 * Returns: %TRUE if fallbacks are used by @converter
11296 * g_charset_converter_new:
11297 * @to_charset: destination charset
11298 * @from_charset: source charset
11299 * @error: #GError for error reporting, or %NULL to ignore.
11301 * Creates a new #GCharsetConverter.
11303 * Returns: a new #GCharsetConverter or %NULL on error.
11309 * g_charset_converter_set_use_fallback:
11310 * @converter: a #GCharsetConverter
11311 * @use_fallback: %TRUE to use fallbacks
11313 * Sets the #GCharsetConverter:use-fallback property.
11320 * g_content_type_can_be_executable:
11321 * @type: a content type string
11323 * Checks if a content type can be executable. Note that for instance
11324 * things like text files can be executables (i.e. scripts and batch files).
11326 * Returns: %TRUE if the file type corresponds to a type that can be executable, %FALSE otherwise.
11331 * g_content_type_equals:
11332 * @type1: a content type string
11333 * @type2: a content type string
11335 * Compares two content types for equality.
11337 * Returns: %TRUE if the two strings are identical or equivalent, %FALSE otherwise.
11342 * g_content_type_from_mime_type:
11343 * @mime_type: a mime type string
11345 * Tries to find a content type based on the mime type name.
11347 * Returns: (allow-none): Newly allocated string with content type or %NULL. Free with g_free()
11353 * g_content_type_get_description:
11354 * @type: a content type string
11356 * Gets the human readable description of the content type.
11358 * Returns: a short description of the content type @type. Free the returned string with g_free()
11363 * g_content_type_get_icon:
11364 * @type: a content type string
11366 * Gets the icon for a content type.
11368 * Returns: (transfer full): #GIcon corresponding to the content type. Free the returned object with g_object_unref()
11373 * g_content_type_get_mime_type:
11374 * @type: a content type string
11376 * Gets the mime type for the content type, if one is registered.
11378 * Returns: (allow-none): the registered mime type for the given @type, or %NULL if unknown.
11383 * g_content_type_guess:
11384 * @filename: (allow-none): a string, or %NULL
11385 * @data: (allow-none) (array length=data_size): a stream of data, or %NULL
11386 * @data_size: the size of @data
11387 * @result_uncertain: (allow-none) (out): return location for the certainty of the result, or %NULL
11389 * Guesses the content type based on example data. If the function is
11390 * uncertain, @result_uncertain will be set to %TRUE. Either @filename
11391 * or @data may be %NULL, in which case the guess will be based solely
11392 * on the other argument.
11394 * Returns: a string indicating a guessed content type for the given data. Free with g_free()
11399 * g_content_type_guess_for_tree:
11400 * @root: the root of the tree to guess a type for
11402 * Tries to guess the type of the tree with root @root, by
11403 * looking at the files it contains. The result is an array
11404 * of content types, with the best guess coming first.
11406 * The types returned all have the form x-content/foo, e.g.
11407 * x-content/audio-cdda (for audio CDs) or x-content/image-dcf
11408 * (for a camera memory card). See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
11409 * specification for more on x-content types.
11411 * This function is useful in the implementation of
11412 * g_mount_guess_content_type().
11414 * Returns: (transfer full) (array zero-terminated=1): an %NULL-terminated array of zero or more content types. Free with g_strfreev()
11420 * g_content_type_is_a:
11421 * @type: a content type string
11422 * @supertype: a content type string
11424 * Determines if @type is a subset of @supertype.
11426 * Returns: %TRUE if @type is a kind of @supertype, %FALSE otherwise.
11431 * g_content_type_is_unknown:
11432 * @type: a content type string
11434 * Checks if the content type is the generic "unknown" type.
11435 * On UNIX this is the "application/octet-stream" mimetype,
11436 * while on win32 it is "*".
11438 * Returns: %TRUE if the type is the unknown type.
11443 * g_content_types_get_registered:
11445 * Gets a list of strings containing all the registered content types
11446 * known to the system. The list and its data should be freed using
11448 * g_list_free_full (list, g_free);
11449 * </programlisting>
11451 * Returns: (element-type utf8) (transfer full): #GList of the registered content types
11456 * g_converter_convert:
11457 * @converter: a #GConverter.
11458 * @inbuf: (array length=inbuf_size) (element-type guint8): the buffer containing the data to convert.
11459 * @inbuf_size: the number of bytes in @inbuf
11460 * @outbuf: a buffer to write converted data in.
11461 * @outbuf_size: the number of bytes in @outbuf, must be at least one
11462 * @flags: a #GConverterFlags controlling the conversion details
11463 * @bytes_read: (out): will be set to the number of bytes read from @inbuf on success
11464 * @bytes_written: (out): will be set to the number of bytes written to @outbuf on success
11465 * @error: location to store the error occurring, or %NULL to ignore
11467 * This is the main operation used when converting data. It is to be called
11468 * multiple times in a loop, and each time it will do some work, i.e.
11469 * producing some output (in @outbuf) or consuming some input (from @inbuf) or
11470 * both. If its not possible to do any work an error is returned.
11472 * Note that a single call may not consume all input (or any input at all).
11473 * Also a call may produce output even if given no input, due to state stored
11474 * in the converter producing output.
11476 * If any data was either produced or consumed, and then an error happens, then
11477 * only the successful conversion is reported and the error is returned on the
11480 * A full conversion loop involves calling this method repeatedly, each time
11481 * giving it new input and space output space. When there is no more input
11482 * data after the data in @inbuf, the flag %G_CONVERTER_INPUT_AT_END must be set.
11483 * The loop will be (unless some error happens) returning %G_CONVERTER_CONVERTED
11484 * each time until all data is consumed and all output is produced, then
11485 * %G_CONVERTER_FINISHED is returned instead. Note, that %G_CONVERTER_FINISHED
11486 * may be returned even if %G_CONVERTER_INPUT_AT_END is not set, for instance
11487 * in a decompression converter where the end of data is detectable from the
11488 * data (and there might even be other data after the end of the compressed data).
11490 * When some data has successfully been converted @bytes_read and is set to
11491 * the number of bytes read from @inbuf, and @bytes_written is set to indicate
11492 * how many bytes was written to @outbuf. If there are more data to output
11493 * or consume (i.e. unless the %G_CONVERTER_INPUT_AT_END is specified) then
11494 * %G_CONVERTER_CONVERTED is returned, and if no more data is to be output
11495 * then %G_CONVERTER_FINISHED is returned.
11497 * On error %G_CONVERTER_ERROR is returned and @error is set accordingly.
11498 * Some errors need special handling:
11500 * %G_IO_ERROR_NO_SPACE is returned if there is not enough space
11501 * to write the resulting converted data, the application should
11502 * call the function again with a larger @outbuf to continue.
11504 * %G_IO_ERROR_PARTIAL_INPUT is returned if there is not enough
11505 * input to fully determine what the conversion should produce,
11506 * and the %G_CONVERTER_INPUT_AT_END flag is not set. This happens for
11507 * example with an incomplete multibyte sequence when converting text,
11508 * or when a regexp matches up to the end of the input (and may match
11509 * further input). It may also happen when @inbuf_size is zero and
11510 * there is no more data to produce.
11512 * When this happens the application should read more input and then
11513 * call the function again. If further input shows that there is no
11514 * more data call the function again with the same data but with
11515 * the %G_CONVERTER_INPUT_AT_END flag set. This may cause the conversion
11516 * to finish as e.g. in the regexp match case (or, to fail again with
11517 * %G_IO_ERROR_PARTIAL_INPUT in e.g. a charset conversion where the
11518 * input is actually partial).
11520 * After g_converter_convert() has returned %G_CONVERTER_FINISHED the
11521 * converter object is in an invalid state where its not allowed
11522 * to call g_converter_convert() anymore. At this time you can only
11523 * free the object or call g_converter_reset() to reset it to the
11526 * If the flag %G_CONVERTER_FLUSH is set then conversion is modified
11527 * to try to write out all internal state to the output. The application
11528 * has to call the function multiple times with the flag set, and when
11529 * the available input has been consumed and all internal state has
11530 * been produced then %G_CONVERTER_FLUSHED (or %G_CONVERTER_FINISHED if
11531 * really at the end) is returned instead of %G_CONVERTER_CONVERTED.
11532 * This is somewhat similar to what happens at the end of the input stream,
11533 * but done in the middle of the data.
11535 * This has different meanings for different conversions. For instance
11536 * in a compression converter it would mean that we flush all the
11537 * compression state into output such that if you uncompress the
11538 * compressed data you get back all the input data. Doing this may
11539 * make the final file larger due to padding though. Another example
11540 * is a regexp conversion, where if you at the end of the flushed data
11541 * have a match, but there is also a potential longer match. In the
11542 * non-flushed case we would ask for more input, but when flushing we
11543 * treat this as the end of input and do the match.
11545 * Flushing is not always possible (like if a charset converter flushes
11546 * at a partial multibyte sequence). Converters are supposed to try
11547 * to produce as much output as possible and then return an error
11548 * (typically %G_IO_ERROR_PARTIAL_INPUT).
11550 * Returns: a #GConverterResult, %G_CONVERTER_ERROR on error.
11556 * g_converter_input_stream_get_converter:
11557 * @converter_stream: a #GConverterInputStream
11559 * Gets the #GConverter that is used by @converter_stream.
11561 * Returns: (transfer none): the converter of the converter input stream
11567 * g_converter_input_stream_new:
11568 * @base_stream: a #GInputStream
11569 * @converter: a #GConverter
11571 * Creates a new converter input stream for the @base_stream.
11573 * Returns: a new #GInputStream.
11578 * g_converter_output_stream_get_converter:
11579 * @converter_stream: a #GConverterOutputStream
11581 * Gets the #GConverter that is used by @converter_stream.
11583 * Returns: (transfer none): the converter of the converter output stream
11589 * g_converter_output_stream_new:
11590 * @base_stream: a #GOutputStream
11591 * @converter: a #GConverter
11593 * Creates a new converter output stream for the @base_stream.
11595 * Returns: a new #GOutputStream.
11600 * g_converter_reset:
11601 * @converter: a #GConverter.
11603 * Resets all internal state in the converter, making it behave
11604 * as if it was just created. If the converter has any internal
11605 * state that would produce output then that output is lost.
11612 * g_credentials_get_native: (skip)
11613 * @credentials: A #GCredentials.
11614 * @native_type: The type of native credentials to get.
11616 * Gets a pointer to native credentials of type @native_type from
11619 * It is a programming error (which will cause an warning to be
11620 * logged) to use this method if there is no #GCredentials support for
11621 * the OS or if @native_type isn't supported by the OS.
11623 * 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.
11629 * g_credentials_get_unix_user:
11630 * @credentials: A #GCredentials
11631 * @error: Return location for error or %NULL.
11633 * Tries to get the UNIX user identifier from @credentials. This
11634 * method is only available on UNIX platforms.
11636 * This operation can fail if #GCredentials is not supported on the
11637 * OS or if the native credentials type does not contain information
11638 * about the UNIX user.
11640 * Returns: The UNIX user identifier or -1 if @error is set.
11646 * g_credentials_is_same_user:
11647 * @credentials: A #GCredentials.
11648 * @other_credentials: A #GCredentials.
11649 * @error: Return location for error or %NULL.
11651 * Checks if @credentials and @other_credentials is the same user.
11653 * This operation can fail if #GCredentials is not supported on the
11656 * Returns: %TRUE if @credentials and @other_credentials has the same user, %FALSE otherwise or if @error is set.
11662 * g_credentials_new:
11664 * Creates a new #GCredentials object with credentials matching the
11665 * the current process.
11667 * Returns: A #GCredentials. Free with g_object_unref().
11673 * g_credentials_set_native:
11674 * @credentials: A #GCredentials.
11675 * @native_type: The type of native credentials to set.
11676 * @native: A pointer to native credentials.
11678 * Copies the native credentials of type @native_type from @native
11679 * into @credentials.
11681 * It is a programming error (which will cause an warning to be
11682 * logged) to use this method if there is no #GCredentials support for
11683 * the OS or if @native_type isn't supported by the OS.
11690 * g_credentials_set_unix_user:
11691 * @credentials: A #GCredentials.
11692 * @uid: The UNIX user identifier to set.
11693 * @error: Return location for error or %NULL.
11695 * Tries to set the UNIX user identifier on @credentials. This method
11696 * is only available on UNIX platforms.
11698 * This operation can fail if #GCredentials is not supported on the
11699 * OS or if the native credentials type does not contain information
11700 * about the UNIX user.
11702 * Returns: %TRUE if @uid was set, %FALSE if error is set.
11708 * g_credentials_to_string:
11709 * @credentials: A #GCredentials object.
11711 * Creates a human-readable textual representation of @credentials
11712 * that can be used in logging and debug messages. The format of the
11713 * returned string may change in future GLib release.
11715 * Returns: A string that should be freed with g_free().
11721 * g_data_input_stream_get_byte_order:
11722 * @stream: a given #GDataInputStream.
11724 * Gets the byte order for the data input stream.
11726 * Returns: the @stream's current #GDataStreamByteOrder.
11731 * g_data_input_stream_get_newline_type:
11732 * @stream: a given #GDataInputStream.
11734 * Gets the current newline type for the @stream.
11736 * Returns: #GDataStreamNewlineType for the given @stream.
11741 * g_data_input_stream_new:
11742 * @base_stream: a #GInputStream.
11744 * Creates a new data input stream for the @base_stream.
11746 * Returns: a new #GDataInputStream.
11751 * g_data_input_stream_read_byte:
11752 * @stream: a given #GDataInputStream.
11753 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11754 * @error: #GError for error reporting.
11756 * Reads an unsigned 8-bit/1-byte value from @stream.
11758 * Returns: an unsigned 8-bit/1-byte value read from the @stream or %0 if an error occurred.
11763 * g_data_input_stream_read_int16:
11764 * @stream: a given #GDataInputStream.
11765 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11766 * @error: #GError for error reporting.
11768 * Reads a 16-bit/2-byte value from @stream.
11770 * In order to get the correct byte order for this read operation,
11771 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11773 * Returns: a signed 16-bit/2-byte value read from @stream or %0 if an error occurred.
11778 * g_data_input_stream_read_int32:
11779 * @stream: a given #GDataInputStream.
11780 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11781 * @error: #GError for error reporting.
11783 * Reads a signed 32-bit/4-byte value from @stream.
11785 * In order to get the correct byte order for this read operation,
11786 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11788 * If @cancellable is not %NULL, then the operation can be cancelled by
11789 * triggering the cancellable object from another thread. If the operation
11790 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11792 * Returns: a signed 32-bit/4-byte value read from the @stream or %0 if an error occurred.
11797 * g_data_input_stream_read_int64:
11798 * @stream: a given #GDataInputStream.
11799 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11800 * @error: #GError for error reporting.
11802 * Reads a 64-bit/8-byte value from @stream.
11804 * In order to get the correct byte order for this read operation,
11805 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11807 * If @cancellable is not %NULL, then the operation can be cancelled by
11808 * triggering the cancellable object from another thread. If the operation
11809 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11811 * Returns: a signed 64-bit/8-byte value read from @stream or %0 if an error occurred.
11816 * g_data_input_stream_read_line:
11817 * @stream: a given #GDataInputStream.
11818 * @length: (out): a #gsize to get the length of the data read in.
11819 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11820 * @error: #GError for error reporting.
11822 * Reads a line from the data input stream. Note that no encoding
11823 * checks or conversion is performed; the input is not guaranteed to
11824 * be UTF-8, and may in fact have embedded NUL characters.
11826 * If @cancellable is not %NULL, then the operation can be cancelled by
11827 * triggering the cancellable object from another thread. If the operation
11828 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11830 * 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.
11835 * g_data_input_stream_read_line_async:
11836 * @stream: a given #GDataInputStream.
11837 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
11838 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11839 * @callback: (scope async): callback to call when the request is satisfied.
11840 * @user_data: (closure): the data to pass to callback function.
11842 * The asynchronous version of g_data_input_stream_read_line(). It is
11843 * an error to have two outstanding calls to this function.
11845 * When the operation is finished, @callback will be called. You
11846 * can then call g_data_input_stream_read_line_finish() to get
11847 * the result of the operation.
11854 * g_data_input_stream_read_line_finish:
11855 * @stream: a given #GDataInputStream.
11856 * @result: the #GAsyncResult that was provided to the callback.
11857 * @length: (out): a #gsize to get the length of the data read in.
11858 * @error: #GError for error reporting.
11860 * Finish an asynchronous call started by
11861 * g_data_input_stream_read_line_async(). Note the warning about
11862 * string encoding in g_data_input_stream_read_line() applies here as
11865 * 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.
11871 * g_data_input_stream_read_line_finish_utf8:
11872 * @stream: a given #GDataInputStream.
11873 * @result: the #GAsyncResult that was provided to the callback.
11874 * @length: (out): a #gsize to get the length of the data read in.
11875 * @error: #GError for error reporting.
11877 * Finish an asynchronous call started by
11878 * g_data_input_stream_read_line_async().
11880 * 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.
11886 * g_data_input_stream_read_line_utf8:
11887 * @stream: a given #GDataInputStream.
11888 * @length: (out): a #gsize to get the length of the data read in.
11889 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11890 * @error: #GError for error reporting.
11892 * Reads a UTF-8 encoded line from the data input stream.
11894 * If @cancellable is not %NULL, then the operation can be cancelled by
11895 * triggering the cancellable object from another thread. If the operation
11896 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11898 * 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.
11904 * g_data_input_stream_read_uint16:
11905 * @stream: a given #GDataInputStream.
11906 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11907 * @error: #GError for error reporting.
11909 * Reads an unsigned 16-bit/2-byte value from @stream.
11911 * In order to get the correct byte order for this read operation,
11912 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11914 * Returns: an unsigned 16-bit/2-byte value read from the @stream or %0 if an error occurred.
11919 * g_data_input_stream_read_uint32:
11920 * @stream: a given #GDataInputStream.
11921 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11922 * @error: #GError for error reporting.
11924 * Reads an unsigned 32-bit/4-byte value from @stream.
11926 * In order to get the correct byte order for this read operation,
11927 * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11929 * If @cancellable is not %NULL, then the operation can be cancelled by
11930 * triggering the cancellable object from another thread. If the operation
11931 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11933 * Returns: an unsigned 32-bit/4-byte value read from the @stream or %0 if an error occurred.
11938 * g_data_input_stream_read_uint64:
11939 * @stream: a given #GDataInputStream.
11940 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11941 * @error: #GError for error reporting.
11943 * Reads an unsigned 64-bit/8-byte value from @stream.
11945 * In order to get the correct byte order for this read operation,
11946 * see g_data_input_stream_get_byte_order().
11948 * If @cancellable is not %NULL, then the operation can be cancelled by
11949 * triggering the cancellable object from another thread. If the operation
11950 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11952 * Returns: an unsigned 64-bit/8-byte read from @stream or %0 if an error occurred.
11957 * g_data_input_stream_read_until:
11958 * @stream: a given #GDataInputStream.
11959 * @stop_chars: characters to terminate the read.
11960 * @length: (out): a #gsize to get the length of the data read in.
11961 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11962 * @error: #GError for error reporting.
11964 * Reads a string from the data input stream, up to the first
11965 * occurrence of any of the stop characters.
11967 * Note that, in contrast to g_data_input_stream_read_until_async(),
11968 * this function consumes the stop character that it finds.
11970 * Don't use this function in new code. Its functionality is
11971 * inconsistent with g_data_input_stream_read_until_async(). Both
11972 * functions will be marked as deprecated in a future release. Use
11973 * g_data_input_stream_read_upto() instead, but note that that function
11974 * does not consume the stop character.
11976 * 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.
11981 * g_data_input_stream_read_until_async:
11982 * @stream: a given #GDataInputStream.
11983 * @stop_chars: characters to terminate the read.
11984 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
11985 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11986 * @callback: (scope async): callback to call when the request is satisfied.
11987 * @user_data: (closure): the data to pass to callback function.
11989 * The asynchronous version of g_data_input_stream_read_until().
11990 * It is an error to have two outstanding calls to this function.
11992 * Note that, in contrast to g_data_input_stream_read_until(),
11993 * this function does not consume the stop character that it finds. You
11994 * must read it for yourself.
11996 * When the operation is finished, @callback will be called. You
11997 * can then call g_data_input_stream_read_until_finish() to get
11998 * the result of the operation.
12000 * Don't use this function in new code. Its functionality is
12001 * inconsistent with g_data_input_stream_read_until(). Both functions
12002 * will be marked as deprecated in a future release. Use
12003 * g_data_input_stream_read_upto_async() instead.
12010 * g_data_input_stream_read_until_finish:
12011 * @stream: a given #GDataInputStream.
12012 * @result: the #GAsyncResult that was provided to the callback.
12013 * @length: (out): a #gsize to get the length of the data read in.
12014 * @error: #GError for error reporting.
12016 * Finish an asynchronous call started by
12017 * g_data_input_stream_read_until_async().
12020 * 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.
12025 * g_data_input_stream_read_upto:
12026 * @stream: a #GDataInputStream
12027 * @stop_chars: characters to terminate the read
12028 * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
12029 * @length: (out): a #gsize to get the length of the data read in
12030 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
12031 * @error: #GError for error reporting
12033 * Reads a string from the data input stream, up to the first
12034 * occurrence of any of the stop characters.
12036 * In contrast to g_data_input_stream_read_until(), this function
12037 * does <emphasis>not</emphasis> consume the stop character. You have
12038 * to use g_data_input_stream_read_byte() to get it before calling
12039 * g_data_input_stream_read_upto() again.
12041 * Note that @stop_chars may contain '\0' if @stop_chars_len is
12044 * 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
12050 * g_data_input_stream_read_upto_async:
12051 * @stream: a #GDataInputStream
12052 * @stop_chars: characters to terminate the read
12053 * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
12054 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
12055 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
12056 * @callback: (scope async): callback to call when the request is satisfied
12057 * @user_data: (closure): the data to pass to callback function
12059 * The asynchronous version of g_data_input_stream_read_upto().
12060 * It is an error to have two outstanding calls to this function.
12062 * In contrast to g_data_input_stream_read_until(), this function
12063 * does <emphasis>not</emphasis> consume the stop character. You have
12064 * to use g_data_input_stream_read_byte() to get it before calling
12065 * g_data_input_stream_read_upto() again.
12067 * Note that @stop_chars may contain '\0' if @stop_chars_len is
12070 * When the operation is finished, @callback will be called. You
12071 * can then call g_data_input_stream_read_upto_finish() to get
12072 * the result of the operation.
12079 * g_data_input_stream_read_upto_finish:
12080 * @stream: a #GDataInputStream
12081 * @result: the #GAsyncResult that was provided to the callback
12082 * @length: (out): a #gsize to get the length of the data read in
12083 * @error: #GError for error reporting
12085 * Finish an asynchronous call started by
12086 * g_data_input_stream_read_upto_async().
12088 * Note that this function does <emphasis>not</emphasis> consume the
12089 * stop character. You have to use g_data_input_stream_read_byte() to
12090 * get it before calling g_data_input_stream_read_upto_async() again.
12092 * 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.
12098 * g_data_input_stream_set_byte_order:
12099 * @stream: a given #GDataInputStream.
12100 * @order: a #GDataStreamByteOrder to set.
12102 * This function sets the byte order for the given @stream. All subsequent
12103 * reads from the @stream will be read in the given @order.
12108 * g_data_input_stream_set_newline_type:
12109 * @stream: a #GDataInputStream.
12110 * @type: the type of new line return as #GDataStreamNewlineType.
12112 * Sets the newline type for the @stream.
12114 * Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read
12115 * chunk ends in "CR" we must read an additional byte to know if this is "CR" or
12116 * "CR LF", and this might block if there is no more data available.
12121 * g_data_output_stream_get_byte_order:
12122 * @stream: a #GDataOutputStream.
12124 * Gets the byte order for the stream.
12126 * Returns: the #GDataStreamByteOrder for the @stream.
12131 * g_data_output_stream_new:
12132 * @base_stream: a #GOutputStream.
12134 * Creates a new data output stream for @base_stream.
12136 * Returns: #GDataOutputStream.
12141 * g_data_output_stream_put_byte:
12142 * @stream: a #GDataOutputStream.
12143 * @data: a #guchar.
12144 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12145 * @error: a #GError, %NULL to ignore.
12147 * Puts a byte into the output stream.
12149 * Returns: %TRUE if @data was successfully added to the @stream.
12154 * g_data_output_stream_put_int16:
12155 * @stream: a #GDataOutputStream.
12156 * @data: a #gint16.
12157 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12158 * @error: a #GError, %NULL to ignore.
12160 * Puts a signed 16-bit integer into the output stream.
12162 * Returns: %TRUE if @data was successfully added to the @stream.
12167 * g_data_output_stream_put_int32:
12168 * @stream: a #GDataOutputStream.
12169 * @data: a #gint32.
12170 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12171 * @error: a #GError, %NULL to ignore.
12173 * Puts a signed 32-bit integer into the output stream.
12175 * Returns: %TRUE if @data was successfully added to the @stream.
12180 * g_data_output_stream_put_int64:
12181 * @stream: a #GDataOutputStream.
12182 * @data: a #gint64.
12183 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12184 * @error: a #GError, %NULL to ignore.
12186 * Puts a signed 64-bit integer into the stream.
12188 * Returns: %TRUE if @data was successfully added to the @stream.
12193 * g_data_output_stream_put_string:
12194 * @stream: a #GDataOutputStream.
12196 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12197 * @error: a #GError, %NULL to ignore.
12199 * Puts a string into the output stream.
12201 * Returns: %TRUE if @string was successfully added to the @stream.
12206 * g_data_output_stream_put_uint16:
12207 * @stream: a #GDataOutputStream.
12208 * @data: a #guint16.
12209 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12210 * @error: a #GError, %NULL to ignore.
12212 * Puts an unsigned 16-bit integer into the output stream.
12214 * Returns: %TRUE if @data was successfully added to the @stream.
12219 * g_data_output_stream_put_uint32:
12220 * @stream: a #GDataOutputStream.
12221 * @data: a #guint32.
12222 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12223 * @error: a #GError, %NULL to ignore.
12225 * Puts an unsigned 32-bit integer into the stream.
12227 * Returns: %TRUE if @data was successfully added to the @stream.
12232 * g_data_output_stream_put_uint64:
12233 * @stream: a #GDataOutputStream.
12234 * @data: a #guint64.
12235 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12236 * @error: a #GError, %NULL to ignore.
12238 * Puts an unsigned 64-bit integer into the stream.
12240 * Returns: %TRUE if @data was successfully added to the @stream.
12245 * g_data_output_stream_set_byte_order:
12246 * @stream: a #GDataOutputStream.
12247 * @order: a %GDataStreamByteOrder.
12249 * Sets the byte order of the data output stream to @order.
12254 * g_dbus_action_group_get:
12255 * @connection: A #GDBusConnection
12256 * @bus_name: the bus name which exports the action group
12257 * @object_path: the object path at which the action group is exported
12259 * Obtains a #GDBusActionGroup for the action group which is exported at
12260 * the given @bus_name and @object_path.
12262 * The thread default main context is taken at the time of this call.
12263 * All signals on the menu model (and any linked models) are reported
12264 * with respect to this context. All calls on the returned menu model
12265 * (and linked models) must also originate from this same context, with
12266 * the thread default main context unchanged.
12268 * This call is non-blocking. The returned action group may or may not
12269 * already be filled in. The correct thing to do is connect the signals
12270 * for the action group to monitor for changes and then to call
12271 * g_action_group_list_actions() to get the initial list.
12273 * Returns: (transfer full): a #GDBusActionGroup
12279 * g_dbus_address_get_for_bus_sync:
12280 * @bus_type: A #GBusType.
12281 * @cancellable: (allow-none): A #GCancellable or %NULL.
12282 * @error: Return location for error or %NULL.
12284 * Synchronously looks up the D-Bus address for the well-known message
12285 * bus instance specified by @bus_type. This may involve using various
12286 * platform specific mechanisms.
12288 * Returns: A valid D-Bus address string for @bus_type or %NULL if @error is set.
12294 * g_dbus_address_get_stream:
12295 * @address: A valid D-Bus address.
12296 * @cancellable: (allow-none): A #GCancellable or %NULL.
12297 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12298 * @user_data: Data to pass to @callback.
12300 * Asynchronously connects to an endpoint specified by @address and
12301 * sets up the connection so it is in a state to run the client-side
12302 * of the D-Bus authentication conversation.
12304 * When the operation is finished, @callback will be invoked. You can
12305 * then call g_dbus_address_get_stream_finish() to get the result of
12308 * This is an asynchronous failable function. See
12309 * g_dbus_address_get_stream_sync() for the synchronous version.
12316 * g_dbus_address_get_stream_finish:
12317 * @res: A #GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream().
12318 * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
12319 * @error: Return location for error or %NULL.
12321 * Finishes an operation started with g_dbus_address_get_stream().
12323 * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
12329 * g_dbus_address_get_stream_sync:
12330 * @address: A valid D-Bus address.
12331 * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
12332 * @cancellable: (allow-none): A #GCancellable or %NULL.
12333 * @error: Return location for error or %NULL.
12335 * Synchronously connects to an endpoint specified by @address and
12336 * sets up the connection so it is in a state to run the client-side
12337 * of the D-Bus authentication conversation.
12339 * This is a synchronous failable function. See
12340 * g_dbus_address_get_stream() for the asynchronous version.
12342 * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
12348 * g_dbus_annotation_info_lookup:
12349 * @annotations: (array zero-terminated=1) (allow-none): A %NULL-terminated array of annotations or %NULL.
12350 * @name: The name of the annotation to look up.
12352 * Looks up the value of an annotation.
12354 * This cost of this function is O(n) in number of annotations.
12356 * Returns: The value or %NULL if not found. Do not free, it is owned by @annotations.
12362 * g_dbus_annotation_info_ref:
12363 * @info: A #GDBusNodeInfo
12365 * If @info is statically allocated does nothing. Otherwise increases
12366 * the reference count.
12368 * Returns: The same @info.
12374 * g_dbus_annotation_info_unref:
12375 * @info: A #GDBusAnnotationInfo.
12377 * If @info is statically allocated, does nothing. Otherwise decreases
12378 * the reference count of @info. When its reference count drops to 0,
12379 * the memory used is freed.
12386 * g_dbus_arg_info_ref:
12387 * @info: A #GDBusArgInfo
12389 * If @info is statically allocated does nothing. Otherwise increases
12390 * the reference count.
12392 * Returns: The same @info.
12398 * g_dbus_arg_info_unref:
12399 * @info: A #GDBusArgInfo.
12401 * If @info is statically allocated, does nothing. Otherwise decreases
12402 * the reference count of @info. When its reference count drops to 0,
12403 * the memory used is freed.
12410 * g_dbus_auth_observer_allow_mechanism:
12411 * @observer: A #GDBusAuthObserver.
12412 * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
12414 * Emits the #GDBusAuthObserver::allow-mechanism signal on @observer.
12416 * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
12422 * g_dbus_auth_observer_authorize_authenticated_peer:
12423 * @observer: A #GDBusAuthObserver.
12424 * @stream: A #GIOStream for the #GDBusConnection.
12425 * @credentials: (allow-none): Credentials received from the peer or %NULL.
12427 * Emits the #GDBusAuthObserver::authorize-authenticated-peer signal on @observer.
12429 * Returns: %TRUE if the peer is authorized, %FALSE if not.
12435 * g_dbus_auth_observer_new:
12437 * Creates a new #GDBusAuthObserver object.
12439 * Returns: A #GDBusAuthObserver. Free with g_object_unref().
12445 * g_dbus_connection_add_filter:
12446 * @connection: A #GDBusConnection.
12447 * @filter_function: A filter function.
12448 * @user_data: User data to pass to @filter_function.
12449 * @user_data_free_func: Function to free @user_data with when filter is removed or %NULL.
12451 * Adds a message filter. Filters are handlers that are run on all
12452 * incoming and outgoing messages, prior to standard dispatch. Filters
12453 * are run in the order that they were added. The same handler can be
12454 * added as a filter more than once, in which case it will be run more
12455 * than once. Filters added during a filter callback won't be run on
12456 * the message being processed. Filter functions are allowed to modify
12457 * and even drop messages.
12459 * Note that filters are run in a dedicated message handling thread so
12460 * they can't block and, generally, can't do anything but signal a
12461 * worker thread. Also note that filters are rarely needed - use API
12462 * such as g_dbus_connection_send_message_with_reply(),
12463 * g_dbus_connection_signal_subscribe() or g_dbus_connection_call() instead.
12465 * If a filter consumes an incoming message the message is not
12466 * dispatched anywhere else - not even the standard dispatch machinery
12467 * (that API such as g_dbus_connection_signal_subscribe() and
12468 * g_dbus_connection_send_message_with_reply() relies on) will see the
12469 * message. Similary, if a filter consumes an outgoing message, the
12470 * message will not be sent to the other peer.
12472 * Returns: A filter identifier that can be used with g_dbus_connection_remove_filter().
12478 * g_dbus_connection_call:
12479 * @connection: A #GDBusConnection.
12480 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12481 * @object_path: Path of remote object.
12482 * @interface_name: D-Bus interface to invoke method on.
12483 * @method_name: The name of the method to invoke.
12484 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12485 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12486 * @flags: Flags from the #GDBusCallFlags enumeration.
12487 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12488 * @cancellable: (allow-none): A #GCancellable or %NULL.
12489 * @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.
12490 * @user_data: The data to pass to @callback.
12492 * Asynchronously invokes the @method_name method on the
12493 * @interface_name D-Bus interface on the remote object at
12494 * @object_path owned by @bus_name.
12496 * If @connection is closed then the operation will fail with
12497 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
12498 * fail with %G_IO_ERROR_CANCELLED. If @parameters contains a value
12499 * not compatible with the D-Bus protocol, the operation fails with
12500 * %G_IO_ERROR_INVALID_ARGUMENT.
12502 * If @reply_type is non-%NULL then the reply will be checked for having this type and an
12503 * error will be raised if it does not match. Said another way, if you give a @reply_type
12504 * then any non-%NULL return value will be of this type.
12506 * If the @parameters #GVariant is floating, it is consumed. This allows
12507 * convenient 'inline' use of g_variant_new(), e.g.:
12509 * g_dbus_connection_call (connection,
12510 * "org.freedesktop.StringThings",
12511 * "/org/freedesktop/StringThings",
12512 * "org.freedesktop.StringThings",
12514 * g_variant_new ("(ss)",
12518 * G_DBUS_CALL_FLAGS_NONE,
12521 * (GAsyncReadyCallback) two_strings_done,
12525 * This is an asynchronous method. When the operation is finished, @callback will be invoked
12526 * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
12527 * of the thread you are calling this method from. You can then call
12528 * g_dbus_connection_call_finish() to get the result of the operation.
12529 * See g_dbus_connection_call_sync() for the synchronous version of this
12532 * If @callback is %NULL then the D-Bus method call message will be sent with
12533 * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
12540 * g_dbus_connection_call_finish:
12541 * @connection: A #GDBusConnection.
12542 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call().
12543 * @error: Return location for error or %NULL.
12545 * Finishes an operation started with g_dbus_connection_call().
12547 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12553 * g_dbus_connection_call_sync:
12554 * @connection: A #GDBusConnection.
12555 * @bus_name: A unique or well-known bus name.
12556 * @object_path: Path of remote object.
12557 * @interface_name: D-Bus interface to invoke method on.
12558 * @method_name: The name of the method to invoke.
12559 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12560 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12561 * @flags: Flags from the #GDBusCallFlags enumeration.
12562 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12563 * @cancellable: (allow-none): A #GCancellable or %NULL.
12564 * @error: Return location for error or %NULL.
12566 * Synchronously invokes the @method_name method on the
12567 * @interface_name D-Bus interface on the remote object at
12568 * @object_path owned by @bus_name.
12570 * If @connection is closed then the operation will fail with
12571 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the
12572 * operation will fail with %G_IO_ERROR_CANCELLED. If @parameters
12573 * contains a value not compatible with the D-Bus protocol, the operation
12574 * fails with %G_IO_ERROR_INVALID_ARGUMENT.
12576 * If @reply_type is non-%NULL then the reply will be checked for having
12577 * this type and an error will be raised if it does not match. Said
12578 * another way, if you give a @reply_type then any non-%NULL return
12579 * value will be of this type.
12581 * If the @parameters #GVariant is floating, it is consumed.
12582 * This allows convenient 'inline' use of g_variant_new(), e.g.:
12584 * g_dbus_connection_call_sync (connection,
12585 * "org.freedesktop.StringThings",
12586 * "/org/freedesktop/StringThings",
12587 * "org.freedesktop.StringThings",
12589 * g_variant_new ("(ss)",
12593 * G_DBUS_CALL_FLAGS_NONE,
12599 * The calling thread is blocked until a reply is received. See
12600 * g_dbus_connection_call() for the asynchronous version of
12603 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12609 * g_dbus_connection_call_with_unix_fd_list:
12610 * @connection: A #GDBusConnection.
12611 * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12612 * @object_path: Path of remote object.
12613 * @interface_name: D-Bus interface to invoke method on.
12614 * @method_name: The name of the method to invoke.
12615 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12616 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12617 * @flags: Flags from the #GDBusCallFlags enumeration.
12618 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12619 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
12620 * @cancellable: (allow-none): A #GCancellable or %NULL.
12621 * @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.
12622 * @user_data: The data to pass to @callback.
12624 * Like g_dbus_connection_call() but also takes a #GUnixFDList object.
12626 * This method is only available on UNIX.
12633 * g_dbus_connection_call_with_unix_fd_list_finish:
12634 * @connection: A #GDBusConnection.
12635 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
12636 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call_with_unix_fd_list().
12637 * @error: Return location for error or %NULL.
12639 * Finishes an operation started with g_dbus_connection_call_with_unix_fd_list().
12641 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12647 * g_dbus_connection_call_with_unix_fd_list_sync:
12648 * @connection: A #GDBusConnection.
12649 * @bus_name: A unique or well-known bus name.
12650 * @object_path: Path of remote object.
12651 * @interface_name: D-Bus interface to invoke method on.
12652 * @method_name: The name of the method to invoke.
12653 * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12654 * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12655 * @flags: Flags from the #GDBusCallFlags enumeration.
12656 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12657 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
12658 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
12659 * @cancellable: (allow-none): A #GCancellable or %NULL.
12660 * @error: Return location for error or %NULL.
12662 * Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects.
12664 * This method is only available on UNIX.
12666 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12672 * g_dbus_connection_close:
12673 * @connection: A #GDBusConnection.
12674 * @cancellable: (allow-none): A #GCancellable or %NULL.
12675 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12676 * @user_data: The data to pass to @callback.
12678 * Closes @connection. Note that this never causes the process to
12679 * exit (this might only happen if the other end of a shared message
12680 * bus connection disconnects, see #GDBusConnection:exit-on-close).
12682 * Once the connection is closed, operations such as sending a message
12683 * will return with the error %G_IO_ERROR_CLOSED. Closing a connection
12684 * will not automatically flush the connection so queued messages may
12685 * be lost. Use g_dbus_connection_flush() if you need such guarantees.
12687 * If @connection is already closed, this method fails with
12688 * %G_IO_ERROR_CLOSED.
12690 * When @connection has been closed, the #GDBusConnection::closed
12691 * signal is emitted in the <link
12692 * linkend="g-main-context-push-thread-default">thread-default main
12693 * loop</link> of the thread that @connection was constructed in.
12695 * This is an asynchronous method. When the operation is finished,
12696 * @callback will be invoked in the <link
12697 * linkend="g-main-context-push-thread-default">thread-default main
12698 * loop</link> of the thread you are calling this method from. You can
12699 * then call g_dbus_connection_close_finish() to get the result of the
12700 * operation. See g_dbus_connection_close_sync() for the synchronous
12708 * g_dbus_connection_close_finish:
12709 * @connection: A #GDBusConnection.
12710 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_close().
12711 * @error: Return location for error or %NULL.
12713 * Finishes an operation started with g_dbus_connection_close().
12715 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12721 * g_dbus_connection_close_sync:
12722 * @connection: A #GDBusConnection.
12723 * @cancellable: (allow-none): A #GCancellable or %NULL.
12724 * @error: Return location for error or %NULL.
12726 * Synchronously closees @connection. The calling thread is blocked
12727 * until this is done. See g_dbus_connection_close() for the
12728 * asynchronous version of this method and more details about what it
12731 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12737 * g_dbus_connection_emit_signal:
12738 * @connection: A #GDBusConnection.
12739 * @destination_bus_name: (allow-none): The unique bus name for the destination for the signal or %NULL to emit to all listeners.
12740 * @object_path: Path of remote object.
12741 * @interface_name: D-Bus interface to emit a signal on.
12742 * @signal_name: The name of the signal to emit.
12743 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
12744 * @error: Return location for error or %NULL.
12748 * If the parameters GVariant is floating, it is consumed.
12750 * This can only fail if @parameters is not compatible with the D-Bus protocol.
12752 * Returns: %TRUE unless @error is set.
12758 * g_dbus_connection_export_action_group:
12759 * @connection: a #GDBusConnection
12760 * @object_path: a D-Bus object path
12761 * @action_group: a #GActionGroup
12762 * @error: a pointer to a %NULL #GError, or %NULL
12764 * Exports @action_group on @connection at @object_path.
12766 * The implemented D-Bus API should be considered private. It is
12767 * subject to change in the future.
12769 * A given object path can only have one action group exported on it.
12770 * If this constraint is violated, the export will fail and 0 will be
12771 * returned (with @error set accordingly).
12773 * You can unexport the action group using
12774 * g_dbus_connection_unexport_action_group() with the return value of
12777 * The thread default main context is taken at the time of this call.
12778 * All incoming action activations and state change requests are
12779 * reported from this context. Any changes on the action group that
12780 * cause it to emit signals must also come from this same context.
12781 * Since incoming action activations and state change requests are
12782 * rather likely to cause changes on the action group, this effectively
12783 * limits a given action group to being exported from only one main
12786 * Returns: the ID of the export (never zero), or 0 in case of failure
12792 * g_dbus_connection_export_menu_model:
12793 * @connection: a #GDBusConnection
12794 * @object_path: a D-Bus object path
12795 * @menu: a #GMenuModel
12796 * @error: return location for an error, or %NULL
12798 * Exports @menu on @connection at @object_path.
12800 * The implemented D-Bus API should be considered private.
12801 * It is subject to change in the future.
12803 * An object path can only have one action group exported on it. If this
12804 * constraint is violated, the export will fail and 0 will be
12805 * returned (with @error set accordingly).
12807 * You can unexport the menu model using
12808 * g_dbus_connection_unexport_menu_model() with the return value of
12811 * Returns: the ID of the export (never zero), or 0 in case of failure
12817 * g_dbus_connection_flush:
12818 * @connection: A #GDBusConnection.
12819 * @cancellable: (allow-none): A #GCancellable or %NULL.
12820 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12821 * @user_data: The data to pass to @callback.
12823 * Asynchronously flushes @connection, that is, writes all queued
12824 * outgoing message to the transport and then flushes the transport
12825 * (using g_output_stream_flush_async()). This is useful in programs
12826 * that wants to emit a D-Bus signal and then exit
12827 * immediately. Without flushing the connection, there is no guarantee
12828 * that the message has been sent to the networking buffers in the OS
12831 * This is an asynchronous method. When the operation is finished,
12832 * @callback will be invoked in the <link
12833 * linkend="g-main-context-push-thread-default">thread-default main
12834 * loop</link> of the thread you are calling this method from. You can
12835 * then call g_dbus_connection_flush_finish() to get the result of the
12836 * operation. See g_dbus_connection_flush_sync() for the synchronous
12844 * g_dbus_connection_flush_finish:
12845 * @connection: A #GDBusConnection.
12846 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_flush().
12847 * @error: Return location for error or %NULL.
12849 * Finishes an operation started with g_dbus_connection_flush().
12851 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12857 * g_dbus_connection_flush_sync:
12858 * @connection: A #GDBusConnection.
12859 * @cancellable: (allow-none): A #GCancellable or %NULL.
12860 * @error: Return location for error or %NULL.
12862 * Synchronously flushes @connection. The calling thread is blocked
12863 * until this is done. See g_dbus_connection_flush() for the
12864 * asynchronous version of this method and more details about what it
12867 * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12873 * g_dbus_connection_get_capabilities:
12874 * @connection: A #GDBusConnection.
12876 * Gets the capabilities negotiated with the remote peer
12878 * Returns: Zero or more flags from the #GDBusCapabilityFlags enumeration.
12884 * g_dbus_connection_get_exit_on_close:
12885 * @connection: A #GDBusConnection.
12887 * Gets whether the process is terminated when @connection is
12888 * closed by the remote peer. See
12889 * #GDBusConnection:exit-on-close for more details.
12891 * Returns: Whether the process is terminated when @connection is closed by the remote peer.
12897 * g_dbus_connection_get_guid:
12898 * @connection: A #GDBusConnection.
12900 * The GUID of the peer performing the role of server when
12901 * authenticating. See #GDBusConnection:guid for more details.
12903 * Returns: The GUID. Do not free this string, it is owned by @connection.
12909 * g_dbus_connection_get_last_serial:
12910 * @connection: A #GDBusConnection.
12912 * Retrieves the last serial number assigned to a #GDBusMessage on
12913 * the current thread. This includes messages sent via both low-level
12914 * API such as g_dbus_connection_send_message() as well as
12915 * high-level API such as g_dbus_connection_emit_signal(),
12916 * g_dbus_connection_call() or g_dbus_proxy_call().
12918 * Returns: the last used serial or zero when no message has been sent within the current thread.
12924 * g_dbus_connection_get_peer_credentials:
12925 * @connection: A #GDBusConnection.
12927 * Gets the credentials of the authenticated peer. This will always
12928 * return %NULL unless @connection acted as a server
12929 * (e.g. %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed)
12930 * when set up and the client passed credentials as part of the
12931 * authentication process.
12933 * In a message bus setup, the message bus is always the server and
12934 * each application is a client. So this method will always return
12935 * %NULL for message bus clients.
12937 * Returns: (transfer none): A #GCredentials or %NULL if not available. Do not free this object, it is owned by @connection.
12943 * g_dbus_connection_get_stream:
12944 * @connection: a #GDBusConnection
12946 * Gets the underlying stream used for IO.
12948 * While the #GDBusConnection is active, it will interact with this
12949 * stream from a worker thread, so it is not safe to interact with
12950 * the stream directly.
12952 * Returns: (transfer none): the stream used for IO
12958 * g_dbus_connection_get_unique_name:
12959 * @connection: A #GDBusConnection.
12961 * Gets the unique name of @connection as assigned by the message
12962 * bus. This can also be used to figure out if @connection is a
12963 * message bus connection.
12965 * Returns: The unique name or %NULL if @connection is not a message bus connection. Do not free this string, it is owned by @connection.
12971 * g_dbus_connection_is_closed:
12972 * @connection: A #GDBusConnection.
12974 * Gets whether @connection is closed.
12976 * Returns: %TRUE if the connection is closed, %FALSE otherwise.
12982 * g_dbus_connection_new:
12983 * @stream: A #GIOStream.
12984 * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
12985 * @flags: Flags describing how to make the connection.
12986 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
12987 * @cancellable: (allow-none): A #GCancellable or %NULL.
12988 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12989 * @user_data: The data to pass to @callback.
12991 * Asynchronously sets up a D-Bus connection for exchanging D-Bus messages
12992 * with the end represented by @stream.
12994 * If @stream is a #GSocketConnection, then the corresponding #GSocket
12995 * will be put into non-blocking mode.
12997 * The D-Bus connection will interact with @stream from a worker thread.
12998 * As a result, the caller should not interact with @stream after this
12999 * method has been called, except by calling g_object_unref() on it.
13001 * If @observer is not %NULL it may be used to control the
13002 * authentication process.
13004 * When the operation is finished, @callback will be invoked. You can
13005 * then call g_dbus_connection_new_finish() to get the result of the
13008 * This is a asynchronous failable constructor. See
13009 * g_dbus_connection_new_sync() for the synchronous
13017 * g_dbus_connection_new_finish:
13018 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
13019 * @error: Return location for error or %NULL.
13021 * Finishes an operation started with g_dbus_connection_new().
13023 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13029 * g_dbus_connection_new_for_address:
13030 * @address: A D-Bus address.
13031 * @flags: Flags describing how to make the connection.
13032 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13033 * @cancellable: (allow-none): A #GCancellable or %NULL.
13034 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
13035 * @user_data: The data to pass to @callback.
13037 * Asynchronously connects and sets up a D-Bus client connection for
13038 * exchanging D-Bus messages with an endpoint specified by @address
13039 * which must be in the D-Bus address format.
13041 * This constructor can only be used to initiate client-side
13042 * connections - use g_dbus_connection_new() if you need to act as the
13043 * server. In particular, @flags cannot contain the
13044 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
13045 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
13047 * When the operation is finished, @callback will be invoked. You can
13048 * then call g_dbus_connection_new_finish() to get the result of the
13051 * If @observer is not %NULL it may be used to control the
13052 * authentication process.
13054 * This is a asynchronous failable constructor. See
13055 * g_dbus_connection_new_for_address_sync() for the synchronous
13063 * g_dbus_connection_new_for_address_finish:
13064 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
13065 * @error: Return location for error or %NULL.
13067 * Finishes an operation started with g_dbus_connection_new_for_address().
13069 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13075 * g_dbus_connection_new_for_address_sync:
13076 * @address: A D-Bus address.
13077 * @flags: Flags describing how to make the connection.
13078 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13079 * @cancellable: (allow-none): A #GCancellable or %NULL.
13080 * @error: Return location for error or %NULL.
13082 * Synchronously connects and sets up a D-Bus client connection for
13083 * exchanging D-Bus messages with an endpoint specified by @address
13084 * which must be in the D-Bus address format.
13086 * This constructor can only be used to initiate client-side
13087 * connections - use g_dbus_connection_new_sync() if you need to act
13088 * as the server. In particular, @flags cannot contain the
13089 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
13090 * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
13092 * This is a synchronous failable constructor. See
13093 * g_dbus_connection_new_for_address() for the asynchronous version.
13095 * If @observer is not %NULL it may be used to control the
13096 * authentication process.
13098 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13104 * g_dbus_connection_new_sync:
13105 * @stream: A #GIOStream.
13106 * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
13107 * @flags: Flags describing how to make the connection.
13108 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13109 * @cancellable: (allow-none): A #GCancellable or %NULL.
13110 * @error: Return location for error or %NULL.
13112 * Synchronously sets up a D-Bus connection for exchanging D-Bus messages
13113 * with the end represented by @stream.
13115 * If @stream is a #GSocketConnection, then the corresponding #GSocket
13116 * will be put into non-blocking mode.
13118 * The D-Bus connection will interact with @stream from a worker thread.
13119 * As a result, the caller should not interact with @stream after this
13120 * method has been called, except by calling g_object_unref() on it.
13122 * If @observer is not %NULL it may be used to control the
13123 * authentication process.
13125 * This is a synchronous failable constructor. See
13126 * g_dbus_connection_new() for the asynchronous version.
13128 * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13134 * g_dbus_connection_register_object:
13135 * @connection: A #GDBusConnection.
13136 * @object_path: The object path to register at.
13137 * @interface_info: Introspection data for the interface.
13138 * @vtable: (allow-none): A #GDBusInterfaceVTable to call into or %NULL.
13139 * @user_data: (allow-none): Data to pass to functions in @vtable.
13140 * @user_data_free_func: Function to call when the object path is unregistered.
13141 * @error: Return location for error or %NULL.
13143 * Registers callbacks for exported objects at @object_path with the
13144 * D-Bus interface that is described in @interface_info.
13146 * Calls to functions in @vtable (and @user_data_free_func) will
13147 * happen in the <link linkend="g-main-context-push-thread-default">thread-default main
13148 * loop</link> of the thread you are calling this method from.
13150 * Note that all #GVariant values passed to functions in @vtable will match
13151 * the signature given in @interface_info - if a remote caller passes
13152 * incorrect values, the <literal>org.freedesktop.DBus.Error.InvalidArgs</literal>
13153 * is returned to the remote caller.
13155 * Additionally, if the remote caller attempts to invoke methods or
13156 * access properties not mentioned in @interface_info the
13157 * <literal>org.freedesktop.DBus.Error.UnknownMethod</literal> resp.
13158 * <literal>org.freedesktop.DBus.Error.InvalidArgs</literal> errors
13159 * are returned to the caller.
13161 * It is considered a programming error if the
13162 * #GDBusInterfaceGetPropertyFunc function in @vtable returns a
13163 * #GVariant of incorrect type.
13165 * If an existing callback is already registered at @object_path and
13166 * @interface_name, then @error is set to #G_IO_ERROR_EXISTS.
13168 * GDBus automatically implements the standard D-Bus interfaces
13169 * org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable
13170 * and org.freedesktop.Peer, so you don't have to implement those for
13171 * the objects you export. You <emphasis>can</emphasis> implement
13172 * org.freedesktop.DBus.Properties yourself, e.g. to handle getting
13173 * and setting of properties asynchronously.
13175 * Note that the reference count on @interface_info will be
13176 * incremented by 1 (unless allocated statically, e.g. if the
13177 * reference count is -1, see g_dbus_interface_info_ref()) for as long
13178 * as the object is exported. Also note that @vtable will be copied.
13180 * See <xref linkend="gdbus-server"/> for an example of how to use this method.
13182 * Returns: 0 if @error is set, otherwise a registration id (never 0) that can be used with g_dbus_connection_unregister_object() .
13188 * g_dbus_connection_register_subtree:
13189 * @connection: A #GDBusConnection.
13190 * @object_path: The object path to register the subtree at.
13191 * @vtable: A #GDBusSubtreeVTable to enumerate, introspect and dispatch nodes in the subtree.
13192 * @flags: Flags used to fine tune the behavior of the subtree.
13193 * @user_data: Data to pass to functions in @vtable.
13194 * @user_data_free_func: Function to call when the subtree is unregistered.
13195 * @error: Return location for error or %NULL.
13197 * Registers a whole subtree of <quote>dynamic</quote> objects.
13199 * The @enumerate and @introspection functions in @vtable are used to
13200 * convey, to remote callers, what nodes exist in the subtree rooted
13203 * When handling remote calls into any node in the subtree, first the
13204 * @enumerate function is used to check if the node exists. If the node exists
13205 * or the #G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is set
13206 * the @introspection function is used to check if the node supports the
13207 * requested method. If so, the @dispatch function is used to determine
13208 * where to dispatch the call. The collected #GDBusInterfaceVTable and
13209 * #gpointer will be used to call into the interface vtable for processing
13212 * All calls into user-provided code will be invoked in the <link
13213 * linkend="g-main-context-push-thread-default">thread-default main
13214 * loop</link> of the thread you are calling this method from.
13216 * If an existing subtree is already registered at @object_path or
13217 * then @error is set to #G_IO_ERROR_EXISTS.
13219 * Note that it is valid to register regular objects (using
13220 * g_dbus_connection_register_object()) in a subtree registered with
13221 * g_dbus_connection_register_subtree() - if so, the subtree handler
13222 * is tried as the last resort. One way to think about a subtree
13223 * handler is to consider it a <quote>fallback handler</quote>
13224 * for object paths not registered via g_dbus_connection_register_object()
13225 * or other bindings.
13227 * Note that @vtable will be copied so you cannot change it after
13230 * See <xref linkend="gdbus-subtree-server"/> for an example of how to use this method.
13232 * Returns: 0 if @error is set, otherwise a subtree registration id (never 0) that can be used with g_dbus_connection_unregister_subtree() .
13238 * g_dbus_connection_remove_filter:
13239 * @connection: a #GDBusConnection
13240 * @filter_id: an identifier obtained from g_dbus_connection_add_filter()
13242 * Removes a filter.
13249 * g_dbus_connection_send_message:
13250 * @connection: A #GDBusConnection.
13251 * @message: A #GDBusMessage
13252 * @flags: Flags affecting how the message is sent.
13253 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13254 * @error: Return location for error or %NULL.
13256 * Asynchronously sends @message to the peer represented by @connection.
13258 * Unless @flags contain the
13259 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13260 * will be assigned by @connection and set on @message via
13261 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13262 * serial number used will be written to this location prior to
13263 * submitting the message to the underlying transport.
13265 * If @connection is closed then the operation will fail with
13266 * %G_IO_ERROR_CLOSED. If @message is not well-formed,
13267 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13269 * See <xref linkend="gdbus-server"/> and <xref
13270 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13271 * low-level API to send and receive UNIX file descriptors.
13273 * Note that @message must be unlocked, unless @flags contain the
13274 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13276 * Returns: %TRUE if the message was well-formed and queued for transmission, %FALSE if @error is set.
13282 * g_dbus_connection_send_message_with_reply:
13283 * @connection: A #GDBusConnection.
13284 * @message: A #GDBusMessage.
13285 * @flags: Flags affecting how the message is sent.
13286 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13287 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13288 * @cancellable: (allow-none): A #GCancellable or %NULL.
13289 * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
13290 * @user_data: The data to pass to @callback.
13292 * Asynchronously sends @message to the peer represented by @connection.
13294 * Unless @flags contain the
13295 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13296 * will be assigned by @connection and set on @message via
13297 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13298 * serial number used will be written to this location prior to
13299 * submitting the message to the underlying transport.
13301 * If @connection is closed then the operation will fail with
13302 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13303 * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
13304 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13306 * This is an asynchronous method. When the operation is finished, @callback will be invoked
13307 * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
13308 * of the thread you are calling this method from. You can then call
13309 * g_dbus_connection_send_message_with_reply_finish() to get the result of the operation.
13310 * See g_dbus_connection_send_message_with_reply_sync() for the synchronous version.
13312 * Note that @message must be unlocked, unless @flags contain the
13313 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13315 * See <xref linkend="gdbus-server"/> and <xref
13316 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13317 * low-level API to send and receive UNIX file descriptors.
13324 * g_dbus_connection_send_message_with_reply_finish:
13325 * @connection: a #GDBusConnection
13326 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_send_message_with_reply().
13327 * @error: Return location for error or %NULL.
13329 * Finishes an operation started with g_dbus_connection_send_message_with_reply().
13331 * Note that @error is only set if a local in-process error
13332 * occurred. That is to say that the returned #GDBusMessage object may
13333 * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
13334 * g_dbus_message_to_gerror() to transcode this to a #GError.
13336 * See <xref linkend="gdbus-server"/> and <xref
13337 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13338 * low-level API to send and receive UNIX file descriptors.
13340 * Returns: (transfer full): A locked #GDBusMessage or %NULL if @error is set.
13346 * g_dbus_connection_send_message_with_reply_sync:
13347 * @connection: A #GDBusConnection.
13348 * @message: A #GDBusMessage.
13349 * @flags: Flags affecting how the message is sent.
13350 * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13351 * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13352 * @cancellable: (allow-none): A #GCancellable or %NULL.
13353 * @error: Return location for error or %NULL.
13355 * Synchronously sends @message to the peer represented by @connection
13356 * and blocks the calling thread until a reply is received or the
13357 * timeout is reached. See g_dbus_connection_send_message_with_reply()
13358 * for the asynchronous version of this method.
13360 * Unless @flags contain the
13361 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13362 * will be assigned by @connection and set on @message via
13363 * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13364 * serial number used will be written to this location prior to
13365 * submitting the message to the underlying transport.
13367 * If @connection is closed then the operation will fail with
13368 * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13369 * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
13370 * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13372 * Note that @error is only set if a local in-process error
13373 * occurred. That is to say that the returned #GDBusMessage object may
13374 * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
13375 * g_dbus_message_to_gerror() to transcode this to a #GError.
13377 * See <xref linkend="gdbus-server"/> and <xref
13378 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13379 * low-level API to send and receive UNIX file descriptors.
13381 * Note that @message must be unlocked, unless @flags contain the
13382 * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13384 * Returns: (transfer full): A locked #GDBusMessage that is the reply to @message or %NULL if @error is set.
13390 * g_dbus_connection_set_exit_on_close:
13391 * @connection: A #GDBusConnection.
13392 * @exit_on_close: Whether the process should be terminated when @connection is closed by the remote peer.
13394 * Sets whether the process should be terminated when @connection is
13395 * closed by the remote peer. See #GDBusConnection:exit-on-close for
13398 * Note that this function should be used with care. Most modern UNIX
13399 * desktops tie the notion of a user session the session bus, and expect
13400 * all of a users applications to quit when their bus connection goes away.
13401 * If you are setting @exit_on_close to %FALSE for the shared session
13402 * bus connection, you should make sure that your application exits
13403 * when the user session ends.
13410 * g_dbus_connection_signal_subscribe:
13411 * @connection: A #GDBusConnection.
13412 * @sender: (allow-none): Sender name to match on (unique or well-known name) or %NULL to listen from all senders.
13413 * @interface_name: (allow-none): D-Bus interface name to match on or %NULL to match on all interfaces.
13414 * @member: (allow-none): D-Bus signal name to match on or %NULL to match on all signals.
13415 * @object_path: (allow-none): Object path to match on or %NULL to match on all object paths.
13416 * @arg0: (allow-none): Contents of first string argument to match on or %NULL to match on all kinds of arguments.
13417 * @flags: Flags describing how to subscribe to the signal (currently unused).
13418 * @callback: Callback to invoke when there is a signal matching the requested data.
13419 * @user_data: User data to pass to @callback.
13420 * @user_data_free_func: (allow-none): Function to free @user_data with when subscription is removed or %NULL.
13422 * Subscribes to signals on @connection and invokes @callback with a
13423 * whenever the signal is received. Note that @callback
13424 * will be invoked in the <link
13425 * linkend="g-main-context-push-thread-default">thread-default main
13426 * loop</link> of the thread you are calling this method from.
13428 * If @connection is not a message bus connection, @sender must be
13431 * If @sender is a well-known name note that @callback is invoked with
13432 * the unique name for the owner of @sender, not the well-known name
13433 * as one would expect. This is because the message bus rewrites the
13434 * name. As such, to avoid certain race conditions, users should be
13435 * tracking the name owner of the well-known name and use that when
13436 * processing the received signal.
13438 * Returns: A subscription identifier that can be used with g_dbus_connection_signal_unsubscribe().
13444 * g_dbus_connection_signal_unsubscribe:
13445 * @connection: A #GDBusConnection.
13446 * @subscription_id: A subscription id obtained from g_dbus_connection_signal_subscribe().
13448 * Unsubscribes from signals.
13455 * g_dbus_connection_start_message_processing:
13456 * @connection: A #GDBusConnection.
13458 * If @connection was created with
13459 * %G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method
13460 * starts processing messages. Does nothing on if @connection wasn't
13461 * created with this flag or if the method has already been called.
13468 * g_dbus_connection_unexport_action_group:
13469 * @connection: a #GDBusConnection
13470 * @export_id: the ID from g_dbus_connection_export_action_group()
13472 * Reverses the effect of a previous call to
13473 * g_dbus_connection_export_action_group().
13475 * It is an error to call this function with an ID that wasn't returned
13476 * from g_dbus_connection_export_action_group() or to call it with the
13477 * same ID more than once.
13484 * g_dbus_connection_unexport_menu_model:
13485 * @connection: a #GDBusConnection
13486 * @export_id: the ID from g_dbus_connection_export_menu_model()
13488 * Reverses the effect of a previous call to
13489 * g_dbus_connection_export_menu_model().
13491 * It is an error to call this function with an ID that wasn't returned
13492 * from g_dbus_connection_export_menu_model() or to call it with the
13493 * same ID more than once.
13500 * g_dbus_connection_unregister_object:
13501 * @connection: A #GDBusConnection.
13502 * @registration_id: A registration id obtained from g_dbus_connection_register_object().
13504 * Unregisters an object.
13506 * Returns: %TRUE if the object was unregistered, %FALSE otherwise.
13512 * g_dbus_connection_unregister_subtree:
13513 * @connection: A #GDBusConnection.
13514 * @registration_id: A subtree registration id obtained from g_dbus_connection_register_subtree().
13516 * Unregisters a subtree.
13518 * Returns: %TRUE if the subtree was unregistered, %FALSE otherwise.
13524 * g_dbus_error_encode_gerror:
13525 * @error: A #GError.
13527 * Creates a D-Bus error name to use for @error. If @error matches
13528 * a registered error (cf. g_dbus_error_register_error()), the corresponding
13529 * D-Bus error name will be returned.
13531 * Otherwise the a name of the form
13532 * <literal>org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE</literal>
13533 * will be used. This allows other GDBus applications to map the error
13534 * on the wire back to a #GError using g_dbus_error_new_for_dbus_error().
13536 * This function is typically only used in object mappings to put a
13537 * #GError on the wire. Regular applications should not use it.
13539 * Returns: A D-Bus error name (never %NULL). Free with g_free().
13545 * g_dbus_error_get_remote_error:
13546 * @error: A #GError.
13548 * Gets the D-Bus error name used for @error, if any.
13550 * This function is guaranteed to return a D-Bus error name for all
13551 * #GError<!-- -->s returned from functions handling remote method
13552 * calls (e.g. g_dbus_connection_call_finish()) unless
13553 * g_dbus_error_strip_remote_error() has been used on @error.
13555 * Returns: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
13561 * g_dbus_error_is_remote_error:
13562 * @error: A #GError.
13564 * Checks if @error represents an error received via D-Bus from a remote peer. If so,
13565 * use g_dbus_error_get_remote_error() to get the name of the error.
13567 * Returns: %TRUE if @error represents an error from a remote peer, %FALSE otherwise.
13573 * g_dbus_error_new_for_dbus_error:
13574 * @dbus_error_name: D-Bus error name.
13575 * @dbus_error_message: D-Bus error message.
13577 * Creates a #GError based on the contents of @dbus_error_name and
13578 * @dbus_error_message.
13580 * Errors registered with g_dbus_error_register_error() will be looked
13581 * up using @dbus_error_name and if a match is found, the error domain
13582 * and code is used. Applications can use g_dbus_error_get_remote_error()
13583 * to recover @dbus_error_name.
13585 * If a match against a registered error is not found and the D-Bus
13586 * error name is in a form as returned by g_dbus_error_encode_gerror()
13587 * the error domain and code encoded in the name is used to
13588 * create the #GError. Also, @dbus_error_name is added to the error message
13589 * such that it can be recovered with g_dbus_error_get_remote_error().
13591 * Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR
13592 * in the #G_IO_ERROR error domain is returned. Also, @dbus_error_name is
13593 * added to the error message such that it can be recovered with
13594 * g_dbus_error_get_remote_error().
13596 * In all three cases, @dbus_error_name can always be recovered from the
13597 * returned #GError using the g_dbus_error_get_remote_error() function
13598 * (unless g_dbus_error_strip_remote_error() hasn't been used on the returned error).
13600 * This function is typically only used in object mappings to prepare
13601 * #GError instances for applications. Regular applications should not use
13604 * Returns: An allocated #GError. Free with g_error_free().
13610 * g_dbus_error_register_error:
13611 * @error_domain: A #GQuark for a error domain.
13612 * @error_code: An error code.
13613 * @dbus_error_name: A D-Bus error name.
13615 * Creates an association to map between @dbus_error_name and
13616 * #GError<!-- -->s specified by @error_domain and @error_code.
13618 * This is typically done in the routine that returns the #GQuark for
13621 * Returns: %TRUE if the association was created, %FALSE if it already exists.
13627 * g_dbus_error_register_error_domain:
13628 * @error_domain_quark_name: The error domain name.
13629 * @quark_volatile: A pointer where to store the #GQuark.
13630 * @entries: A pointer to @num_entries #GDBusErrorEntry struct items.
13631 * @num_entries: Number of items to register.
13633 * Helper function for associating a #GError error domain with D-Bus error names.
13640 * g_dbus_error_set_dbus_error:
13641 * @error: A pointer to a #GError or %NULL.
13642 * @dbus_error_name: D-Bus error name.
13643 * @dbus_error_message: D-Bus error message.
13644 * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
13645 * @...: Arguments for @format.
13647 * Does nothing if @error is %NULL. Otherwise sets *@error to
13648 * a new #GError created with g_dbus_error_new_for_dbus_error()
13649 * with @dbus_error_message prepend with @format (unless %NULL).
13656 * g_dbus_error_set_dbus_error_valist:
13657 * @error: A pointer to a #GError or %NULL.
13658 * @dbus_error_name: D-Bus error name.
13659 * @dbus_error_message: D-Bus error message.
13660 * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
13661 * @var_args: Arguments for @format.
13663 * Like g_dbus_error_set_dbus_error() but intended for language bindings.
13670 * g_dbus_error_strip_remote_error:
13671 * @error: A #GError.
13673 * Looks for extra information in the error message used to recover
13674 * the D-Bus error name and strips it if found. If stripped, the
13675 * message field in @error will correspond exactly to what was
13676 * received on the wire.
13678 * This is typically used when presenting errors to the end user.
13680 * Returns: %TRUE if information was stripped, %FALSE otherwise.
13686 * g_dbus_error_unregister_error:
13687 * @error_domain: A #GQuark for a error domain.
13688 * @error_code: An error code.
13689 * @dbus_error_name: A D-Bus error name.
13691 * Destroys an association previously set up with g_dbus_error_register_error().
13693 * Returns: %TRUE if the association was destroyed, %FALSE if it wasn't found.
13699 * g_dbus_generate_guid:
13701 * Generate a D-Bus GUID that can be used with
13702 * e.g. g_dbus_connection_new().
13704 * See the D-Bus specification regarding what strings are valid D-Bus
13705 * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
13707 * Returns: A valid D-Bus GUID. Free with g_free().
13713 * g_dbus_gvalue_to_gvariant:
13714 * @gvalue: A #GValue to convert to a #GVariant.
13715 * @type: A #GVariantType.
13717 * Converts a #GValue to a #GVariant of the type indicated by the @type parameter.
13719 * The conversion is using the following rules:
13720 * <table frame='all'>
13721 * <title>#GValue / #GVariant conversion rules</title>
13722 * <tgroup cols='2' align='left' colsep='1' rowsep='1'>
13725 * <entry>If the #GType for @gvalue is...</entry>
13726 * <entry>... then @type must be</entry>
13731 * <entry>#G_TYPE_STRING</entry>
13732 * <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>
13735 * <entry>#G_TYPE_STRV</entry>
13736 * <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>
13739 * <entry>#G_TYPE_BOOLEAN</entry>
13740 * <entry><link linkend="G-VARIANT-TYPE-BOOLEAN:CAPS">'b'</link></entry>
13743 * <entry>#G_TYPE_UCHAR</entry>
13744 * <entry><link linkend="G-VARIANT-TYPE-BYTE:CAPS">'y'</link></entry>
13747 * <entry>#G_TYPE_INT</entry>
13748 * <entry><link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link> or <link linkend="G-VARIANT-TYPE-INT16:CAPS">'n'</link></entry>
13751 * <entry>#G_TYPE_UINT</entry>
13752 * <entry><link linkend="G-VARIANT-TYPE-UINT32:CAPS">'u'</link> or <link linkend="G-VARIANT-TYPE-UINT16:CAPS">'q'</link></entry>
13755 * <entry>#G_TYPE_INT64</entry>
13756 * <entry><link linkend="G-VARIANT-TYPE-INT64:CAPS">'x'</link></entry>
13759 * <entry>#G_TYPE_UINT64</entry>
13760 * <entry><link linkend="G-VARIANT-TYPE-UINT64:CAPS">'t'</link></entry>
13763 * <entry>#G_TYPE_DOUBLE</entry>
13764 * <entry><link linkend="G-VARIANT-TYPE-DOUBLE:CAPS">'d'</link></entry>
13767 * <entry>#G_TYPE_VARIANT</entry>
13768 * <entry>Any #GVariantType</entry>
13773 * This can fail if e.g. @gvalue is of type #G_TYPE_STRING and @type
13774 * is <link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link>. It will
13775 * also fail for any #GType (including e.g. #G_TYPE_OBJECT and
13776 * #G_TYPE_BOXED derived-types) not in the table above.
13778 * Note that if @gvalue is of type #G_TYPE_VARIANT and its value is
13779 * %NULL, the <emphasis>empty</emphasis> #GVariant instance (never
13780 * %NULL) for @type is returned (e.g. 0 for scalar types, the empty
13781 * string for string types, <literal>'/'</literal> for object path
13782 * types, the empty array for any array type and so on).
13784 * See the g_dbus_gvariant_to_gvalue() function for how to convert a
13785 * #GVariant to a #GValue.
13787 * Returns: A #GVariant (never floating) of #GVariantType @type holding the data from @gvalue or %NULL in case of failure. Free with g_variant_unref().
13793 * g_dbus_gvariant_to_gvalue:
13794 * @value: A #GVariant.
13795 * @out_gvalue: (out): Return location pointing to a zero-filled (uninitialized) #GValue.
13797 * Converts a #GVariant to a #GValue. If @value is floating, it is consumed.
13799 * The rules specified in the g_dbus_gvalue_to_gvariant() function are
13800 * used - this function is essentially its reverse form.
13802 * The conversion never fails - a valid #GValue is always returned in
13810 * g_dbus_interface_dup_object:
13811 * @interface_: An exported D-Bus interface.
13813 * Gets the #GDBusObject that @interface_ belongs to, if any.
13815 * Returns: (transfer full): A #GDBusObject or %NULL. The returned reference should be freed with g_object_unref().
13817 * Rename to: g_dbus_interface_get_object
13822 * g_dbus_interface_get_info:
13823 * @interface_: An exported D-Bus interface.
13825 * Gets D-Bus introspection information for the D-Bus interface
13826 * implemented by @interface_.
13828 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
13834 * g_dbus_interface_get_object: (skip)
13835 * @interface_: An exported D-Bus interface.
13837 * Gets the #GDBusObject that @interface_ belongs to, if any.
13839 * <warning>It is not safe to use the returned object if @interface_
13840 * or the returned object is being used from other threads. See
13841 * g_dbus_interface_dup_object() for a thread-safe
13842 * alternative.</warning>
13844 * Returns: (transfer none): A #GDBusObject or %NULL. The returned reference belongs to @interface_ and should not be freed.
13850 * g_dbus_interface_info_cache_build:
13851 * @info: A #GDBusInterfaceInfo.
13853 * Builds a lookup-cache to speed up
13854 * g_dbus_interface_info_lookup_method(),
13855 * g_dbus_interface_info_lookup_signal() and
13856 * g_dbus_interface_info_lookup_property().
13858 * If this has already been called with @info, the existing cache is
13859 * used and its use count is increased.
13861 * Note that @info cannot be modified until
13862 * g_dbus_interface_info_cache_release() is called.
13869 * g_dbus_interface_info_cache_release:
13870 * @info: A GDBusInterfaceInfo
13872 * Decrements the usage count for the cache for @info built by
13873 * g_dbus_interface_info_cache_build() (if any) and frees the
13874 * resources used by the cache if the usage count drops to zero.
13881 * g_dbus_interface_info_generate_xml:
13882 * @info: A #GDBusNodeInfo
13883 * @indent: Indentation level.
13884 * @string_builder: (out): A #GString to to append XML data to.
13886 * Appends an XML representation of @info (and its children) to @string_builder.
13888 * This function is typically used for generating introspection XML
13889 * documents at run-time for handling the
13890 * <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>
13898 * g_dbus_interface_info_lookup_method:
13899 * @info: A #GDBusInterfaceInfo.
13900 * @name: A D-Bus method name (typically in CamelCase)
13902 * Looks up information about a method.
13904 * This cost of this function is O(n) in number of methods unless
13905 * g_dbus_interface_info_cache_build() has been used on @info.
13907 * Returns: (transfer none): A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info.
13913 * g_dbus_interface_info_lookup_property:
13914 * @info: A #GDBusInterfaceInfo.
13915 * @name: A D-Bus property name (typically in CamelCase).
13917 * Looks up information about a property.
13919 * This cost of this function is O(n) in number of properties unless
13920 * g_dbus_interface_info_cache_build() has been used on @info.
13922 * Returns: (transfer none): A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info.
13928 * g_dbus_interface_info_lookup_signal:
13929 * @info: A #GDBusInterfaceInfo.
13930 * @name: A D-Bus signal name (typically in CamelCase)
13932 * Looks up information about a signal.
13934 * This cost of this function is O(n) in number of signals unless
13935 * g_dbus_interface_info_cache_build() has been used on @info.
13937 * Returns: (transfer none): A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info.
13943 * g_dbus_interface_info_ref:
13944 * @info: A #GDBusInterfaceInfo
13946 * If @info is statically allocated does nothing. Otherwise increases
13947 * the reference count.
13949 * Returns: The same @info.
13955 * g_dbus_interface_info_unref:
13956 * @info: A #GDBusInterfaceInfo.
13958 * If @info is statically allocated, does nothing. Otherwise decreases
13959 * the reference count of @info. When its reference count drops to 0,
13960 * the memory used is freed.
13967 * g_dbus_interface_set_object:
13968 * @interface_: An exported D-Bus interface.
13969 * @object: (allow-none): A #GDBusObject or %NULL.
13971 * Sets the #GDBusObject for @interface_ to @object.
13973 * Note that @interface_ will hold a weak reference to @object.
13980 * g_dbus_interface_skeleton_export:
13981 * @interface_: The D-Bus interface to export.
13982 * @connection: A #GDBusConnection to export @interface_ on.
13983 * @object_path: The path to export the interface at.
13984 * @error: Return location for error or %NULL.
13986 * Exports @interface_ at @object_path on @connection.
13988 * This can be called multiple times to export the same @interface_
13989 * onto multiple connections however the @object_path provided must be
13990 * the same for all connections.
13992 * Use g_dbus_interface_skeleton_unexport() to unexport the object.
13994 * Returns: %TRUE if the interface was exported on @connection, otherwise %FALSE with @error set.
14000 * g_dbus_interface_skeleton_flush:
14001 * @interface_: A #GDBusInterfaceSkeleton.
14003 * If @interface_ has outstanding changes, request for these changes to be
14004 * emitted immediately.
14006 * For example, an exported D-Bus interface may queue up property
14007 * changes and emit the
14008 * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
14009 * signal later (e.g. in an idle handler). This technique is useful
14010 * for collapsing multiple property changes into one.
14017 * g_dbus_interface_skeleton_get_connection:
14018 * @interface_: A #GDBusInterfaceSkeleton.
14020 * Gets the first connection that @interface_ is exported on, if any.
14022 * Returns: (transfer none): A #GDBusConnection or %NULL if @interface_ is not exported anywhere. Do not free, the object belongs to @interface_.
14028 * g_dbus_interface_skeleton_get_connections:
14029 * @interface_: A #GDBusInterfaceSkeleton.
14031 * Gets a list of the connections that @interface_ is exported on.
14033 * 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().
14039 * g_dbus_interface_skeleton_get_flags:
14040 * @interface_: A #GDBusInterfaceSkeleton.
14042 * Gets the #GDBusInterfaceSkeletonFlags that describes what the behavior
14045 * Returns: One or more flags from the #GDBusInterfaceSkeletonFlags enumeration.
14051 * g_dbus_interface_skeleton_get_info:
14052 * @interface_: A #GDBusInterfaceSkeleton.
14054 * Gets D-Bus introspection information for the D-Bus interface
14055 * implemented by @interface_.
14057 * Returns: (transfer none): A #GDBusInterfaceInfo (never %NULL). Do not free.
14063 * g_dbus_interface_skeleton_get_object_path:
14064 * @interface_: A #GDBusInterfaceSkeleton.
14066 * Gets the object path that @interface_ is exported on, if any.
14068 * Returns: A string owned by @interface_ or %NULL if @interface_ is not exported anywhere. Do not free, the string belongs to @interface_.
14074 * g_dbus_interface_skeleton_get_properties:
14075 * @interface_: A #GDBusInterfaceSkeleton.
14077 * Gets all D-Bus properties for @interface_.
14079 * Returns: (transfer full): A #GVariant of type <link linkend="G-VARIANT-TYPE-VARDICT:CAPS">'a{sv}'</link>. Free with g_variant_unref().
14085 * g_dbus_interface_skeleton_get_vtable: (skip)
14086 * @interface_: A #GDBusInterfaceSkeleton.
14088 * Gets the interface vtable for the D-Bus interface implemented by
14089 * @interface_. The returned function pointers should expect @interface_
14090 * itself to be passed as @user_data.
14092 * Returns: A #GDBusInterfaceVTable (never %NULL).
14098 * g_dbus_interface_skeleton_has_connection:
14099 * @interface_: A #GDBusInterfaceSkeleton.
14100 * @connection: A #GDBusConnection.
14102 * Checks if @interface_ is export on @connection.
14104 * Returns: %TRUE if @interface_ is exported on @connection, %FALSE otherwise.
14110 * g_dbus_interface_skeleton_set_flags:
14111 * @interface_: A #GDBusInterfaceSkeleton.
14112 * @flags: Flags from the #GDBusInterfaceSkeletonFlags enumeration.
14114 * Sets flags describing what the behavior of @skeleton should be.
14121 * g_dbus_interface_skeleton_unexport:
14122 * @interface_: A #GDBusInterfaceSkeleton.
14124 * Stops exporting @interface_ on all connections it is exported on.
14126 * To unexport @interface_ from only a single connection, use
14127 * g_dbus_interface_skeleton_unexport_from_connection()
14134 * g_dbus_interface_skeleton_unexport_from_connection:
14135 * @interface_: A #GDBusInterfaceSkeleton.
14136 * @connection: A #GDBusConnection.
14138 * Stops exporting @interface_ on @connection.
14140 * To stop exporting on all connections the interface is exported on,
14141 * use g_dbus_interface_skeleton_unexport().
14148 * g_dbus_is_address:
14149 * @string: A string.
14151 * Checks if @string is a D-Bus address.
14153 * This doesn't check if @string is actually supported by #GDBusServer
14154 * or #GDBusConnection - use g_dbus_is_supported_address() to do more
14157 * Returns: %TRUE if @string is a valid D-Bus address, %FALSE otherwise.
14164 * @string: The string to check.
14166 * Checks if @string is a D-Bus GUID.
14168 * See the D-Bus specification regarding what strings are valid D-Bus
14169 * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
14171 * Returns: %TRUE if @string is a guid, %FALSE otherwise.
14177 * g_dbus_is_interface_name:
14178 * @string: The string to check.
14180 * Checks if @string is a valid D-Bus interface name.
14182 * Returns: %TRUE if valid, %FALSE otherwise.
14188 * g_dbus_is_member_name:
14189 * @string: The string to check.
14191 * Checks if @string is a valid D-Bus member (e.g. signal or method) name.
14193 * Returns: %TRUE if valid, %FALSE otherwise.
14200 * @string: The string to check.
14202 * Checks if @string is a valid D-Bus bus name (either unique or well-known).
14204 * Returns: %TRUE if valid, %FALSE otherwise.
14210 * g_dbus_is_supported_address:
14211 * @string: A string.
14212 * @error: Return location for error or %NULL.
14214 * Like g_dbus_is_address() but also checks if the library suppors the
14215 * transports in @string and that key/value pairs for each transport
14218 * Returns: %TRUE if @string is a valid D-Bus address that is supported by this library, %FALSE if @error is set.
14224 * g_dbus_is_unique_name:
14225 * @string: The string to check.
14227 * Checks if @string is a valid D-Bus unique bus name.
14229 * Returns: %TRUE if valid, %FALSE otherwise.
14235 * g_dbus_menu_model_get:
14236 * @connection: a #GDBusConnection
14237 * @bus_name: the bus name which exports the menu model
14238 * @object_path: the object path at which the menu model is exported
14240 * Obtains a #GDBusMenuModel for the menu model which is exported
14241 * at the given @bus_name and @object_path.
14243 * The thread default main context is taken at the time of this call.
14244 * All signals on the menu model (and any linked models) are reported
14245 * with respect to this context. All calls on the returned menu model
14246 * (and linked models) must also originate from this same context, with
14247 * the thread default main context unchanged.
14249 * Returns: (transfer full): a #GDBusMenuModel object. Free with g_object_unref().
14255 * g_dbus_message_bytes_needed:
14256 * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
14257 * @blob_len: The length of @blob (must be at least 16).
14258 * @error: Return location for error or %NULL.
14260 * Utility function to calculate how many bytes are needed to
14261 * completely deserialize the D-Bus message stored at @blob.
14263 * 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).
14269 * g_dbus_message_copy:
14270 * @message: A #GDBusMessage.
14271 * @error: Return location for error or %NULL.
14273 * Copies @message. The copy is a deep copy and the returned
14274 * #GDBusMessage is completely identical except that it is guaranteed
14275 * to not be locked.
14277 * This operation can fail if e.g. @message contains file descriptors
14278 * and the per-process or system-wide open files limit is reached.
14280 * Returns: (transfer full): A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
14286 * g_dbus_message_get_arg0:
14287 * @message: A #GDBusMessage.
14289 * Convenience to get the first item in the body of @message.
14291 * Returns: The string item or %NULL if the first item in the body of @message is not a string.
14297 * g_dbus_message_get_body:
14298 * @message: A #GDBusMessage.
14300 * Gets the body of a message.
14302 * Returns: A #GVariant or %NULL if the body is empty. Do not free, it is owned by @message.
14308 * g_dbus_message_get_byte_order:
14309 * @message: A #GDBusMessage.
14311 * Gets the byte order of @message.
14313 * Returns: The byte order.
14318 * g_dbus_message_get_destination:
14319 * @message: A #GDBusMessage.
14321 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14323 * Returns: The value.
14329 * g_dbus_message_get_error_name:
14330 * @message: A #GDBusMessage.
14332 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
14334 * Returns: The value.
14340 * g_dbus_message_get_flags:
14341 * @message: A #GDBusMessage.
14343 * Gets the flags for @message.
14345 * Returns: Flags that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
14351 * g_dbus_message_get_header:
14352 * @message: A #GDBusMessage.
14353 * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
14355 * Gets a header field on @message.
14357 * Returns: A #GVariant with the value if the header was found, %NULL otherwise. Do not free, it is owned by @message.
14363 * g_dbus_message_get_header_fields:
14364 * @message: A #GDBusMessage.
14366 * Gets an array of all header fields on @message that are set.
14368 * 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().
14374 * g_dbus_message_get_interface:
14375 * @message: A #GDBusMessage.
14377 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
14379 * Returns: The value.
14385 * g_dbus_message_get_locked:
14386 * @message: A #GDBusMessage.
14388 * Checks whether @message is locked. To monitor changes to this
14389 * value, conncet to the #GObject::notify signal to listen for changes
14390 * on the #GDBusMessage:locked property.
14392 * Returns: %TRUE if @message is locked, %FALSE otherwise.
14398 * g_dbus_message_get_member:
14399 * @message: A #GDBusMessage.
14401 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
14403 * Returns: The value.
14409 * g_dbus_message_get_message_type:
14410 * @message: A #GDBusMessage.
14412 * Gets the type of @message.
14414 * Returns: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
14420 * g_dbus_message_get_num_unix_fds:
14421 * @message: A #GDBusMessage.
14423 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
14425 * Returns: The value.
14431 * g_dbus_message_get_path:
14432 * @message: A #GDBusMessage.
14434 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
14436 * Returns: The value.
14442 * g_dbus_message_get_reply_serial:
14443 * @message: A #GDBusMessage.
14445 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
14447 * Returns: The value.
14453 * g_dbus_message_get_sender:
14454 * @message: A #GDBusMessage.
14456 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
14458 * Returns: The value.
14464 * g_dbus_message_get_serial:
14465 * @message: A #GDBusMessage.
14467 * Gets the serial for @message.
14469 * Returns: A #guint32.
14475 * g_dbus_message_get_signature:
14476 * @message: A #GDBusMessage.
14478 * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
14480 * Returns: The value.
14486 * g_dbus_message_get_unix_fd_list:
14487 * @message: A #GDBusMessage.
14489 * Gets the UNIX file descriptors associated with @message, if any.
14491 * This method is only available on UNIX.
14493 * Returns: (transfer none): A #GUnixFDList or %NULL if no file descriptors are associated. Do not free, this object is owned by @message.
14499 * g_dbus_message_lock:
14500 * @message: A #GDBusMessage.
14502 * If @message is locked, does nothing. Otherwise locks the message.
14509 * g_dbus_message_new:
14511 * Creates a new empty #GDBusMessage.
14513 * Returns: A #GDBusMessage. Free with g_object_unref().
14519 * g_dbus_message_new_from_blob:
14520 * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
14521 * @blob_len: The length of @blob.
14522 * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
14523 * @error: Return location for error or %NULL.
14525 * Creates a new #GDBusMessage from the data stored at @blob. The byte
14526 * order that the message was in can be retrieved using
14527 * g_dbus_message_get_byte_order().
14529 * Returns: A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
14535 * g_dbus_message_new_method_call:
14536 * @name: (allow-none): A valid D-Bus name or %NULL.
14537 * @path: A valid object path.
14538 * @interface_: (allow-none): A valid D-Bus interface name or %NULL.
14539 * @method: A valid method name.
14541 * Creates a new #GDBusMessage for a method call.
14543 * Returns: A #GDBusMessage. Free with g_object_unref().
14549 * g_dbus_message_new_method_error:
14550 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14551 * @error_name: A valid D-Bus error name.
14552 * @error_message_format: The D-Bus error message in a printf() format.
14553 * @...: Arguments for @error_message_format.
14555 * Creates a new #GDBusMessage that is an error reply to @method_call_message.
14557 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14563 * g_dbus_message_new_method_error_literal:
14564 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14565 * @error_name: A valid D-Bus error name.
14566 * @error_message: The D-Bus error message.
14568 * Creates a new #GDBusMessage that is an error reply to @method_call_message.
14570 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14576 * g_dbus_message_new_method_error_valist:
14577 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14578 * @error_name: A valid D-Bus error name.
14579 * @error_message_format: The D-Bus error message in a printf() format.
14580 * @var_args: Arguments for @error_message_format.
14582 * Like g_dbus_message_new_method_error() but intended for language bindings.
14584 * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14590 * g_dbus_message_new_method_reply:
14591 * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14593 * Creates a new #GDBusMessage that is a reply to @method_call_message.
14595 * Returns: (transfer full): #GDBusMessage. Free with g_object_unref().
14601 * g_dbus_message_new_signal:
14602 * @path: A valid object path.
14603 * @interface_: A valid D-Bus interface name.
14604 * @signal: A valid signal name.
14606 * Creates a new #GDBusMessage for a signal emission.
14608 * Returns: A #GDBusMessage. Free with g_object_unref().
14614 * g_dbus_message_print:
14615 * @message: A #GDBusMessage.
14616 * @indent: Indentation level.
14618 * Produces a human-readable multi-line description of @message.
14620 * The contents of the description has no ABI guarantees, the contents
14621 * and formatting is subject to change at any time. Typical output
14622 * looks something like this:
14624 * Type: method-call
14625 * Flags: none
14629 * path -> objectpath '/org/gtk/GDBus/TestObject'
14630 * interface -> 'org.gtk.GDBus.TestInterface'
14631 * member -> 'GimmeStdout'
14632 * destination -> ':1.146'
14634 * UNIX File Descriptors:
14636 * </programlisting>
14639 * Type: method-return
14640 * Flags: no-reply-expected
14642 * Serial: 477
14644 * reply-serial -> uint32 4
14645 * destination -> ':1.159'
14646 * sender -> ':1.146'
14647 * num-unix-fds -> uint32 1
14649 * UNIX File Descriptors:
14650 * fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635
14651 * </programlisting>
14653 * Returns: A string that should be freed with g_free().
14659 * g_dbus_message_set_body:
14660 * @message: A #GDBusMessage.
14661 * @body: Either %NULL or a #GVariant that is a tuple.
14663 * Sets the body @message. As a side-effect the
14664 * %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the
14665 * type string of @body (or cleared if @body is %NULL).
14667 * If @body is floating, @message assumes ownership of @body.
14674 * g_dbus_message_set_byte_order:
14675 * @message: A #GDBusMessage.
14676 * @byte_order: The byte order.
14678 * Sets the byte order of @message.
14683 * g_dbus_message_set_destination:
14684 * @message: A #GDBusMessage.
14685 * @value: The value to set.
14687 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14694 * g_dbus_message_set_error_name:
14695 * @message: A #GDBusMessage.
14696 * @value: The value to set.
14698 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
14705 * g_dbus_message_set_flags:
14706 * @message: A #GDBusMessage.
14707 * @flags: Flags for @message that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
14709 * Sets the flags to set on @message.
14716 * g_dbus_message_set_header:
14717 * @message: A #GDBusMessage.
14718 * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
14719 * @value: (allow-none): A #GVariant to set the header field or %NULL to clear the header field.
14721 * Sets a header field on @message.
14723 * If @value is floating, @message assumes ownership of @value.
14730 * g_dbus_message_set_interface:
14731 * @message: A #GDBusMessage.
14732 * @value: The value to set.
14734 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
14741 * g_dbus_message_set_member:
14742 * @message: A #GDBusMessage.
14743 * @value: The value to set.
14745 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
14752 * g_dbus_message_set_message_type:
14753 * @message: A #GDBusMessage.
14754 * @type: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
14756 * Sets @message to be of @type.
14763 * g_dbus_message_set_num_unix_fds:
14764 * @message: A #GDBusMessage.
14765 * @value: The value to set.
14767 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
14774 * g_dbus_message_set_path:
14775 * @message: A #GDBusMessage.
14776 * @value: The value to set.
14778 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
14785 * g_dbus_message_set_reply_serial:
14786 * @message: A #GDBusMessage.
14787 * @value: The value to set.
14789 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
14796 * g_dbus_message_set_sender:
14797 * @message: A #GDBusMessage.
14798 * @value: The value to set.
14800 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
14807 * g_dbus_message_set_serial:
14808 * @message: A #GDBusMessage.
14809 * @serial: A #guint32.
14811 * Sets the serial for @message.
14818 * g_dbus_message_set_signature:
14819 * @message: A #GDBusMessage.
14820 * @value: The value to set.
14822 * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
14829 * g_dbus_message_set_unix_fd_list:
14830 * @message: A #GDBusMessage.
14831 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
14833 * Sets the UNIX file descriptors associated with @message. As a
14834 * side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header
14835 * field is set to the number of fds in @fd_list (or cleared if
14836 * @fd_list is %NULL).
14838 * This method is only available on UNIX.
14845 * g_dbus_message_to_blob:
14846 * @message: A #GDBusMessage.
14847 * @out_size: Return location for size of generated blob.
14848 * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
14849 * @error: Return location for error.
14851 * Serializes @message to a blob. The byte order returned by
14852 * g_dbus_message_get_byte_order() will be used.
14854 * 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().
14860 * g_dbus_message_to_gerror:
14861 * @message: A #GDBusMessage.
14862 * @error: The #GError to set.
14864 * If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR does
14865 * nothing and returns %FALSE.
14867 * Otherwise this method encodes the error in @message as a #GError
14868 * using g_dbus_error_set_dbus_error() using the information in the
14869 * %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as
14870 * well as the first string item in @message's body.
14872 * Returns: %TRUE if @error was set, %FALSE otherwise.
14878 * g_dbus_method_info_ref:
14879 * @info: A #GDBusMethodInfo
14881 * If @info is statically allocated does nothing. Otherwise increases
14882 * the reference count.
14884 * Returns: The same @info.
14890 * g_dbus_method_info_unref:
14891 * @info: A #GDBusMethodInfo.
14893 * If @info is statically allocated, does nothing. Otherwise decreases
14894 * the reference count of @info. When its reference count drops to 0,
14895 * the memory used is freed.
14902 * g_dbus_method_invocation_get_connection:
14903 * @invocation: A #GDBusMethodInvocation.
14905 * Gets the #GDBusConnection the method was invoked on.
14907 * Returns: (transfer none): A #GDBusConnection. Do not free, it is owned by @invocation.
14913 * g_dbus_method_invocation_get_interface_name:
14914 * @invocation: A #GDBusMethodInvocation.
14916 * Gets the name of the D-Bus interface the method was invoked on.
14918 * Returns: A string. Do not free, it is owned by @invocation.
14924 * g_dbus_method_invocation_get_message:
14925 * @invocation: A #GDBusMethodInvocation.
14927 * Gets the #GDBusMessage for the method invocation. This is useful if
14928 * you need to use low-level protocol features, such as UNIX file
14929 * descriptor passing, that cannot be properly expressed in the
14932 * See <xref linkend="gdbus-server"/> and <xref
14933 * linkend="gdbus-unix-fd-client"/> for an example of how to use this
14934 * low-level API to send and receive UNIX file descriptors.
14936 * Returns: (transfer none): #GDBusMessage. Do not free, it is owned by @invocation.
14942 * g_dbus_method_invocation_get_method_info:
14943 * @invocation: A #GDBusMethodInvocation.
14945 * Gets information about the method call, if any.
14947 * Returns: A #GDBusMethodInfo or %NULL. Do not free, it is owned by @invocation.
14953 * g_dbus_method_invocation_get_method_name:
14954 * @invocation: A #GDBusMethodInvocation.
14956 * Gets the name of the method that was invoked.
14958 * Returns: A string. Do not free, it is owned by @invocation.
14964 * g_dbus_method_invocation_get_object_path:
14965 * @invocation: A #GDBusMethodInvocation.
14967 * Gets the object path the method was invoked on.
14969 * Returns: A string. Do not free, it is owned by @invocation.
14975 * g_dbus_method_invocation_get_parameters:
14976 * @invocation: A #GDBusMethodInvocation.
14978 * Gets the parameters of the method invocation. If there are no input
14979 * parameters then this will return a GVariant with 0 children rather than NULL.
14981 * Returns: (transfer none): A #GVariant tuple. Do not unref this because it is owned by @invocation.
14987 * g_dbus_method_invocation_get_sender:
14988 * @invocation: A #GDBusMethodInvocation.
14990 * Gets the bus name that invoked the method.
14992 * Returns: A string. Do not free, it is owned by @invocation.
14998 * g_dbus_method_invocation_get_user_data: (skip)
14999 * @invocation: A #GDBusMethodInvocation.
15001 * Gets the @user_data #gpointer passed to g_dbus_connection_register_object().
15003 * Returns: A #gpointer.
15009 * g_dbus_method_invocation_return_dbus_error:
15010 * @invocation: (transfer full): A #GDBusMethodInvocation.
15011 * @error_name: A valid D-Bus error name.
15012 * @error_message: A valid D-Bus error message.
15014 * Finishes handling a D-Bus method call by returning an error.
15016 * This method will free @invocation, you cannot use it afterwards.
15023 * g_dbus_method_invocation_return_error:
15024 * @invocation: (transfer full): A #GDBusMethodInvocation.
15025 * @domain: A #GQuark for the #GError error domain.
15026 * @code: The error code.
15027 * @format: printf()-style format.
15028 * @...: Parameters for @format.
15030 * Finishes handling a D-Bus method call by returning an error.
15032 * See g_dbus_error_encode_gerror() for details about what error name
15033 * will be returned on the wire. In a nutshell, if the given error is
15034 * registered using g_dbus_error_register_error() the name given
15035 * during registration is used. Otherwise, a name of the form
15036 * <literal>org.gtk.GDBus.UnmappedGError.Quark...</literal> is
15037 * used. This provides transparent mapping of #GError between
15038 * applications using GDBus.
15040 * If you are writing an application intended to be portable,
15041 * <emphasis>always</emphasis> register errors with g_dbus_error_register_error()
15042 * or use g_dbus_method_invocation_return_dbus_error().
15044 * This method will free @invocation, you cannot use it afterwards.
15051 * g_dbus_method_invocation_return_error_literal:
15052 * @invocation: (transfer full): A #GDBusMethodInvocation.
15053 * @domain: A #GQuark for the #GError error domain.
15054 * @code: The error code.
15055 * @message: The error message.
15057 * Like g_dbus_method_invocation_return_error() but without printf()-style formatting.
15059 * This method will free @invocation, you cannot use it afterwards.
15066 * g_dbus_method_invocation_return_error_valist:
15067 * @invocation: (transfer full): A #GDBusMethodInvocation.
15068 * @domain: A #GQuark for the #GError error domain.
15069 * @code: The error code.
15070 * @format: printf()-style format.
15071 * @var_args: #va_list of parameters for @format.
15073 * Like g_dbus_method_invocation_return_error() but intended for
15074 * language bindings.
15076 * This method will free @invocation, you cannot use it afterwards.
15083 * g_dbus_method_invocation_return_gerror:
15084 * @invocation: (transfer full): A #GDBusMethodInvocation.
15085 * @error: A #GError.
15087 * Like g_dbus_method_invocation_return_error() but takes a #GError
15088 * instead of the error domain, error code and message.
15090 * This method will free @invocation, you cannot use it afterwards.
15097 * g_dbus_method_invocation_return_value:
15098 * @invocation: (transfer full): A #GDBusMethodInvocation.
15099 * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15101 * Finishes handling a D-Bus method call by returning @parameters.
15102 * If the @parameters GVariant is floating, it is consumed.
15104 * It is an error if @parameters is not of the right format.
15106 * This method will free @invocation, you cannot use it afterwards.
15113 * g_dbus_method_invocation_return_value_with_unix_fd_list:
15114 * @invocation: (transfer full): A #GDBusMethodInvocation.
15115 * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15116 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15118 * Like g_dbus_method_invocation_return_value() but also takes a #GUnixFDList.
15120 * This method is only available on UNIX.
15122 * This method will free @invocation, you cannot use it afterwards.
15129 * g_dbus_method_invocation_take_error: (skip)
15130 * @invocation: (transfer full): A #GDBusMethodInvocation.
15131 * @error: (transfer full): A #GError.
15133 * Like g_dbus_method_invocation_return_gerror() but takes ownership
15134 * of @error so the caller does not need to free it.
15136 * This method will free @invocation, you cannot use it afterwards.
15143 * g_dbus_node_info_generate_xml:
15144 * @info: A #GDBusNodeInfo.
15145 * @indent: Indentation level.
15146 * @string_builder: (out): A #GString to to append XML data to.
15148 * Appends an XML representation of @info (and its children) to @string_builder.
15150 * This function is typically used for generating introspection XML documents at run-time for
15151 * handling the <literal>org.freedesktop.DBus.Introspectable.Introspect</literal> method.
15158 * g_dbus_node_info_lookup_interface:
15159 * @info: A #GDBusNodeInfo.
15160 * @name: A D-Bus interface name.
15162 * Looks up information about an interface.
15164 * This cost of this function is O(n) in number of interfaces.
15166 * Returns: (transfer none): A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info.
15172 * g_dbus_node_info_new_for_xml:
15173 * @xml_data: Valid D-Bus introspection XML.
15174 * @error: Return location for error.
15176 * Parses @xml_data and returns a #GDBusNodeInfo representing the data.
15178 * Note that this routine is using a
15179 * <link linkend="glib-Simple-XML-Subset-Parser.description">GMarkup</link>-based
15180 * parser that only accepts a subset of valid XML documents.
15182 * Returns: A #GDBusNodeInfo structure or %NULL if @error is set. Free with g_dbus_node_info_unref().
15188 * g_dbus_node_info_ref:
15189 * @info: A #GDBusNodeInfo
15191 * If @info is statically allocated does nothing. Otherwise increases
15192 * the reference count.
15194 * Returns: The same @info.
15200 * g_dbus_node_info_unref:
15201 * @info: A #GDBusNodeInfo.
15203 * If @info is statically allocated, does nothing. Otherwise decreases
15204 * the reference count of @info. When its reference count drops to 0,
15205 * the memory used is freed.
15212 * g_dbus_object_get_interface:
15213 * @object: A #GDBusObject.
15214 * @interface_name: A D-Bus interface name.
15216 * Gets the D-Bus interface with name @interface_name associated with
15219 * Returns: (transfer full): %NULL if not found, otherwise a #GDBusInterface that must be freed with g_object_unref().
15225 * g_dbus_object_get_interfaces:
15226 * @object: A #GDBusObject.
15228 * Gets the D-Bus interfaces associated with @object.
15230 * 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().
15236 * g_dbus_object_get_object_path:
15237 * @object: A #GDBusObject.
15239 * Gets the object path for @object.
15241 * Returns: A string owned by @object. Do not free.
15247 * g_dbus_object_manager_client_get_connection:
15248 * @manager: A #GDBusObjectManagerClient
15250 * Gets the #GDBusConnection used by @manager.
15252 * Returns: (transfer none): A #GDBusConnection object. Do not free, the object belongs to @manager.
15258 * g_dbus_object_manager_client_get_flags:
15259 * @manager: A #GDBusObjectManagerClient
15261 * Gets the flags that @manager was constructed with.
15263 * Returns: Zero of more flags from the #GDBusObjectManagerClientFlags enumeration.
15269 * g_dbus_object_manager_client_get_name:
15270 * @manager: A #GDBusObjectManagerClient
15272 * Gets the name that @manager is for.
15274 * Returns: A unique or well-known name. Do not free, the string belongs to @manager.
15280 * g_dbus_object_manager_client_get_name_owner:
15281 * @manager: A #GDBusObjectManagerClient.
15283 * The unique name that owns the name that @manager is for or %NULL if
15284 * no-one currently owns that name. You can connect to the
15285 * #GObject::notify signal to track changes to the
15286 * #GDBusObjectManagerClient:name-owner property.
15288 * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
15294 * g_dbus_object_manager_client_new:
15295 * @connection: A #GDBusConnection.
15296 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15297 * @name: The owner of the control object (unique or well-known name).
15298 * @object_path: The object path of the control object.
15299 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15300 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15301 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15302 * @cancellable: (allow-none): A #GCancellable or %NULL
15303 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
15304 * @user_data: The data to pass to @callback.
15306 * Asynchronously creates a new #GDBusObjectManagerClient object.
15308 * This is an asynchronous failable constructor. When the result is
15309 * ready, @callback will be invoked in the
15310 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15311 * of the thread you are calling this method from. You can
15312 * then call g_dbus_object_manager_client_new_finish() to get the result. See
15313 * g_dbus_object_manager_client_new_sync() for the synchronous version.
15320 * g_dbus_object_manager_client_new_finish:
15321 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new().
15322 * @error: Return location for error or %NULL.
15324 * Finishes an operation started with g_dbus_object_manager_client_new().
15326 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15332 * g_dbus_object_manager_client_new_for_bus:
15333 * @bus_type: A #GBusType.
15334 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15335 * @name: The owner of the control object (unique or well-known name).
15336 * @object_path: The object path of the control object.
15337 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15338 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15339 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15340 * @cancellable: (allow-none): A #GCancellable or %NULL
15341 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
15342 * @user_data: The data to pass to @callback.
15344 * Like g_dbus_object_manager_client_new() but takes a #GBusType instead of a
15345 * #GDBusConnection.
15347 * This is an asynchronous failable constructor. When the result is
15348 * ready, @callback will be invoked in the
15349 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15350 * of the thread you are calling this method from. You can
15351 * then call g_dbus_object_manager_client_new_for_bus_finish() to get the result. See
15352 * g_dbus_object_manager_client_new_for_bus_sync() for the synchronous version.
15359 * g_dbus_object_manager_client_new_for_bus_finish:
15360 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus().
15361 * @error: Return location for error or %NULL.
15363 * Finishes an operation started with g_dbus_object_manager_client_new_for_bus().
15365 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15371 * g_dbus_object_manager_client_new_for_bus_sync:
15372 * @bus_type: A #GBusType.
15373 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15374 * @name: The owner of the control object (unique or well-known name).
15375 * @object_path: The object path of the control object.
15376 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15377 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15378 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15379 * @cancellable: (allow-none): A #GCancellable or %NULL
15380 * @error: Return location for error or %NULL.
15382 * Like g_dbus_object_manager_client_new_sync() but takes a #GBusType instead
15383 * of a #GDBusConnection.
15385 * This is a synchronous failable constructor - the calling thread is
15386 * blocked until a reply is received. See g_dbus_object_manager_client_new_for_bus()
15387 * for the asynchronous version.
15389 * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15395 * g_dbus_object_manager_client_new_sync:
15396 * @connection: A #GDBusConnection.
15397 * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15398 * @name: The owner of the control object (unique or well-known name).
15399 * @object_path: The object path of the control object.
15400 * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15401 * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15402 * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15403 * @cancellable: (allow-none): A #GCancellable or %NULL
15404 * @error: Return location for error or %NULL.
15406 * Creates a new #GDBusObjectManagerClient object.
15408 * This is a synchronous failable constructor - the calling thread is
15409 * blocked until a reply is received. See g_dbus_object_manager_client_new()
15410 * for the asynchronous version.
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_get_interface:
15419 * @manager: A #GDBusObjectManager.
15420 * @object_path: Object path to lookup.
15421 * @interface_name: D-Bus interface name to lookup.
15423 * Gets the interface proxy for @interface_name at @object_path, if
15426 * Returns: (transfer full): A #GDBusInterface instance or %NULL. Free with g_object_unref().
15432 * g_dbus_object_manager_get_object:
15433 * @manager: A #GDBusObjectManager.
15434 * @object_path: Object path to lookup.
15436 * Gets the #GDBusObjectProxy at @object_path, if any.
15438 * Returns: (transfer full): A #GDBusObject or %NULL. Free with g_object_unref().
15444 * g_dbus_object_manager_get_object_path:
15445 * @manager: A #GDBusObjectManager.
15447 * Gets the object path that @manager is for.
15449 * Returns: A string owned by @manager. Do not free.
15455 * g_dbus_object_manager_get_objects:
15456 * @manager: A #GDBusObjectManager.
15458 * Gets all #GDBusObject objects known to @manager.
15460 * 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().
15466 * g_dbus_object_manager_server_export:
15467 * @manager: A #GDBusObjectManagerServer.
15468 * @object: A #GDBusObjectSkeleton.
15470 * Exports @object on @manager.
15472 * If there is already a #GDBusObject exported at the object path,
15473 * then the old object is removed.
15475 * The object path for @object must be in the hierarchy rooted by the
15476 * object path for @manager.
15478 * Note that @manager will take a reference on @object for as long as
15486 * g_dbus_object_manager_server_export_uniquely:
15487 * @manager: A #GDBusObjectManagerServer.
15488 * @object: An object.
15490 * Like g_dbus_object_manager_server_export() but appends a string of
15491 * the form <literal>_N</literal> (with N being a natural number) to
15492 * @object<!-- -->'s object path if an object with the given path
15493 * already exists. As such, the #GDBusObjectProxy:g-object-path property
15494 * of @object may be modified.
15501 * g_dbus_object_manager_server_get_connection:
15502 * @manager: A #GDBusObjectManagerServer
15504 * Gets the #GDBusConnection used by @manager.
15506 * 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().
15512 * g_dbus_object_manager_server_is_exported:
15513 * @manager: A #GDBusObjectManagerServer.
15514 * @object: An object.
15516 * Returns whether @object is currently exported on @manager.
15518 * Returns: %TRUE if @object is exported
15524 * g_dbus_object_manager_server_new:
15525 * @object_path: The object path to export the manager object at.
15527 * Creates a new #GDBusObjectManagerServer object.
15529 * The returned server isn't yet exported on any connection. To do so,
15530 * use g_dbus_object_manager_server_set_connection(). Normally you
15531 * want to export all of your objects before doing so to avoid <ulink
15532 * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">InterfacesAdded</ulink>
15533 * signals being emitted.
15535 * Returns: A #GDBusObjectManagerServer object. Free with g_object_unref().
15541 * g_dbus_object_manager_server_set_connection:
15542 * @manager: A #GDBusObjectManagerServer.
15543 * @connection: (allow-none): A #GDBusConnection or %NULL.
15545 * Exports all objects managed by @manager on @connection. If
15546 * @connection is %NULL, stops exporting objects.
15551 * g_dbus_object_manager_server_unexport:
15552 * @manager: A #GDBusObjectManagerServer.
15553 * @object_path: An object path.
15555 * If @manager has an object at @path, removes the object. Otherwise
15558 * Note that @object_path must be in the hierarchy rooted by the
15559 * object path for @manager.
15561 * Returns: %TRUE if object at @object_path was removed, %FALSE otherwise.
15567 * g_dbus_object_proxy_get_connection:
15568 * @proxy: a #GDBusObjectProxy
15570 * Gets the connection that @proxy is for.
15572 * Returns: (transfer none): A #GDBusConnection. Do not free, the object is owned by @proxy.
15578 * g_dbus_object_proxy_new:
15579 * @connection: a #GDBusConnection
15580 * @object_path: the object path
15582 * Creates a new #GDBusObjectProxy for the given connection and
15585 * Returns: a new #GDBusObjectProxy
15591 * g_dbus_object_skeleton_add_interface:
15592 * @object: A #GDBusObjectSkeleton.
15593 * @interface_: A #GDBusInterfaceSkeleton.
15595 * Adds @interface_ to @object.
15597 * If @object already contains a #GDBusInterfaceSkeleton with the same
15598 * interface name, it is removed before @interface_ is added.
15600 * Note that @object takes its own reference on @interface_ and holds
15601 * it until removed.
15608 * g_dbus_object_skeleton_flush:
15609 * @object: A #GDBusObjectSkeleton.
15611 * This method simply calls g_dbus_interface_skeleton_flush() on all
15612 * interfaces belonging to @object. See that method for when flushing
15620 * g_dbus_object_skeleton_new:
15621 * @object_path: An object path.
15623 * Creates a new #GDBusObjectSkeleton.
15625 * Returns: A #GDBusObjectSkeleton. Free with g_object_unref().
15631 * g_dbus_object_skeleton_remove_interface:
15632 * @object: A #GDBusObjectSkeleton.
15633 * @interface_: A #GDBusInterfaceSkeleton.
15635 * Removes @interface_ from @object.
15642 * g_dbus_object_skeleton_remove_interface_by_name:
15643 * @object: A #GDBusObjectSkeleton.
15644 * @interface_name: A D-Bus interface name.
15646 * Removes the #GDBusInterface with @interface_name from @object.
15648 * If no D-Bus interface of the given interface exists, this function
15656 * g_dbus_object_skeleton_set_object_path:
15657 * @object: A #GDBusObjectSkeleton.
15658 * @object_path: A valid D-Bus object path.
15660 * Sets the object path for @object.
15667 * g_dbus_property_info_ref:
15668 * @info: A #GDBusPropertyInfo
15670 * If @info is statically allocated does nothing. Otherwise increases
15671 * the reference count.
15673 * Returns: The same @info.
15679 * g_dbus_property_info_unref:
15680 * @info: A #GDBusPropertyInfo.
15682 * If @info is statically allocated, does nothing. Otherwise decreases
15683 * the reference count of @info. When its reference count drops to 0,
15684 * the memory used is freed.
15691 * g_dbus_proxy_call:
15692 * @proxy: A #GDBusProxy.
15693 * @method_name: Name of method to invoke.
15694 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15695 * @flags: Flags from the #GDBusCallFlags enumeration.
15696 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15697 * @cancellable: (allow-none): A #GCancellable or %NULL.
15698 * @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.
15699 * @user_data: The data to pass to @callback.
15701 * Asynchronously invokes the @method_name method on @proxy.
15703 * If @method_name contains any dots, then @name is split into interface and
15704 * method name parts. This allows using @proxy for invoking methods on
15705 * other interfaces.
15707 * If the #GDBusConnection associated with @proxy is closed then
15708 * the operation will fail with %G_IO_ERROR_CLOSED. If
15709 * @cancellable is canceled, the operation will fail with
15710 * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
15711 * compatible with the D-Bus protocol, the operation fails with
15712 * %G_IO_ERROR_INVALID_ARGUMENT.
15714 * If the @parameters #GVariant is floating, it is consumed. This allows
15715 * convenient 'inline' use of g_variant_new(), e.g.:
15717 * g_dbus_proxy_call (proxy,
15719 * g_variant_new ("(ss)",
15722 * G_DBUS_CALL_FLAGS_NONE,
15725 * (GAsyncReadyCallback) two_strings_done,
15729 * If @proxy has an expected interface (see
15730 * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
15731 * then the return value is checked against the return type.
15733 * This is an asynchronous method. When the operation is finished,
15734 * @callback will be invoked in the
15735 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15736 * of the thread you are calling this method from.
15737 * You can then call g_dbus_proxy_call_finish() to get the result of
15738 * the operation. See g_dbus_proxy_call_sync() for the synchronous
15739 * version of this method.
15741 * If @callback is %NULL then the D-Bus method call message will be sent with
15742 * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
15749 * g_dbus_proxy_call_finish:
15750 * @proxy: A #GDBusProxy.
15751 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call().
15752 * @error: Return location for error or %NULL.
15754 * Finishes an operation started with g_dbus_proxy_call().
15756 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15762 * g_dbus_proxy_call_sync:
15763 * @proxy: A #GDBusProxy.
15764 * @method_name: Name of method to invoke.
15765 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15766 * @flags: Flags from the #GDBusCallFlags enumeration.
15767 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15768 * @cancellable: (allow-none): A #GCancellable or %NULL.
15769 * @error: Return location for error or %NULL.
15771 * Synchronously invokes the @method_name method on @proxy.
15773 * If @method_name contains any dots, then @name is split into interface and
15774 * method name parts. This allows using @proxy for invoking methods on
15775 * other interfaces.
15777 * If the #GDBusConnection associated with @proxy is disconnected then
15778 * the operation will fail with %G_IO_ERROR_CLOSED. If
15779 * @cancellable is canceled, the operation will fail with
15780 * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
15781 * compatible with the D-Bus protocol, the operation fails with
15782 * %G_IO_ERROR_INVALID_ARGUMENT.
15784 * If the @parameters #GVariant is floating, it is consumed. This allows
15785 * convenient 'inline' use of g_variant_new(), e.g.:
15787 * g_dbus_proxy_call_sync (proxy,
15789 * g_variant_new ("(ss)",
15792 * G_DBUS_CALL_FLAGS_NONE,
15798 * The calling thread is blocked until a reply is received. See
15799 * g_dbus_proxy_call() for the asynchronous version of this
15802 * If @proxy has an expected interface (see
15803 * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
15804 * then the return value is checked against the return type.
15806 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15812 * g_dbus_proxy_call_with_unix_fd_list:
15813 * @proxy: A #GDBusProxy.
15814 * @method_name: Name of method to invoke.
15815 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15816 * @flags: Flags from the #GDBusCallFlags enumeration.
15817 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15818 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15819 * @cancellable: (allow-none): A #GCancellable or %NULL.
15820 * @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.
15821 * @user_data: The data to pass to @callback.
15823 * Like g_dbus_proxy_call() but also takes a #GUnixFDList object.
15825 * This method is only available on UNIX.
15832 * g_dbus_proxy_call_with_unix_fd_list_finish:
15833 * @proxy: A #GDBusProxy.
15834 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
15835 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call_with_unix_fd_list().
15836 * @error: Return location for error or %NULL.
15838 * Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list().
15840 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15846 * g_dbus_proxy_call_with_unix_fd_list_sync:
15847 * @proxy: A #GDBusProxy.
15848 * @method_name: Name of method to invoke.
15849 * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15850 * @flags: Flags from the #GDBusCallFlags enumeration.
15851 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15852 * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15853 * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
15854 * @cancellable: (allow-none): A #GCancellable or %NULL.
15855 * @error: Return location for error or %NULL.
15857 * Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects.
15859 * This method is only available on UNIX.
15861 * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15867 * g_dbus_proxy_get_cached_property:
15868 * @proxy: A #GDBusProxy.
15869 * @property_name: Property name.
15871 * Looks up the value for a property from the cache. This call does no
15874 * If @proxy has an expected interface (see
15875 * #GDBusProxy:g-interface-info) and @property_name is referenced by
15876 * it, then @value is checked against the type of the property.
15878 * 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().
15884 * g_dbus_proxy_get_cached_property_names:
15885 * @proxy: A #GDBusProxy.
15887 * Gets the names of all cached properties on @proxy.
15889 * Returns: (transfer full): A %NULL-terminated array of strings or %NULL if @proxy has no cached properties. Free the returned array with g_strfreev().
15895 * g_dbus_proxy_get_connection:
15896 * @proxy: A #GDBusProxy.
15898 * Gets the connection @proxy is for.
15900 * Returns: (transfer none): A #GDBusConnection owned by @proxy. Do not free.
15906 * g_dbus_proxy_get_default_timeout:
15907 * @proxy: A #GDBusProxy.
15909 * Gets the timeout to use if -1 (specifying default timeout) is
15910 * passed as @timeout_msec in the g_dbus_proxy_call() and
15911 * g_dbus_proxy_call_sync() functions.
15913 * See the #GDBusProxy:g-default-timeout property for more details.
15915 * Returns: Timeout to use for @proxy.
15921 * g_dbus_proxy_get_flags:
15922 * @proxy: A #GDBusProxy.
15924 * Gets the flags that @proxy was constructed with.
15926 * Returns: Flags from the #GDBusProxyFlags enumeration.
15932 * g_dbus_proxy_get_interface_info:
15933 * @proxy: A #GDBusProxy
15935 * Returns the #GDBusInterfaceInfo, if any, specifying the interface
15936 * that @proxy conforms to. See the #GDBusProxy:g-interface-info
15937 * property for more details.
15939 * Returns: A #GDBusInterfaceInfo or %NULL. Do not unref the returned object, it is owned by @proxy.
15945 * g_dbus_proxy_get_interface_name:
15946 * @proxy: A #GDBusProxy.
15948 * Gets the D-Bus interface name @proxy is for.
15950 * Returns: A string owned by @proxy. Do not free.
15956 * g_dbus_proxy_get_name:
15957 * @proxy: A #GDBusProxy.
15959 * Gets the name that @proxy was constructed for.
15961 * Returns: A string owned by @proxy. Do not free.
15967 * g_dbus_proxy_get_name_owner:
15968 * @proxy: A #GDBusProxy.
15970 * The unique name that owns the name that @proxy is for or %NULL if
15971 * no-one currently owns that name. You may connect to the
15972 * #GObject::notify signal to track changes to the
15973 * #GDBusProxy:g-name-owner property.
15975 * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
15981 * g_dbus_proxy_get_object_path:
15982 * @proxy: A #GDBusProxy.
15984 * Gets the object path @proxy is for.
15986 * Returns: A string owned by @proxy. Do not free.
15992 * g_dbus_proxy_new:
15993 * @connection: A #GDBusConnection.
15994 * @flags: Flags used when constructing the proxy.
15995 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
15996 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
15997 * @object_path: An object path.
15998 * @interface_name: A D-Bus interface name.
15999 * @cancellable: (allow-none): A #GCancellable or %NULL.
16000 * @callback: Callback function to invoke when the proxy is ready.
16001 * @user_data: User data to pass to @callback.
16003 * Creates a proxy for accessing @interface_name on the remote object
16004 * at @object_path owned by @name at @connection and asynchronously
16005 * loads D-Bus properties unless the
16006 * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. Connect to
16007 * the #GDBusProxy::g-properties-changed signal to get notified about
16008 * property changes.
16010 * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
16011 * match rules for signals. Connect to the #GDBusProxy::g-signal signal
16012 * to handle signals from the remote object.
16014 * If @name is a well-known name and the
16015 * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
16016 * owner currently exists, the message bus will be requested to launch
16017 * a name owner for the name.
16019 * This is a failable asynchronous constructor - when the proxy is
16020 * ready, @callback will be invoked and you can use
16021 * g_dbus_proxy_new_finish() to get the result.
16023 * See g_dbus_proxy_new_sync() and for a synchronous version of this constructor.
16025 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16032 * g_dbus_proxy_new_finish:
16033 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new().
16034 * @error: Return location for error or %NULL.
16036 * Finishes creating a #GDBusProxy.
16038 * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
16044 * g_dbus_proxy_new_for_bus:
16045 * @bus_type: A #GBusType.
16046 * @flags: Flags used when constructing the proxy.
16047 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16048 * @name: A bus name (well-known or unique).
16049 * @object_path: An object path.
16050 * @interface_name: A D-Bus interface name.
16051 * @cancellable: (allow-none): A #GCancellable or %NULL.
16052 * @callback: Callback function to invoke when the proxy is ready.
16053 * @user_data: User data to pass to @callback.
16055 * Like g_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
16057 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16064 * g_dbus_proxy_new_for_bus_finish:
16065 * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new_for_bus().
16066 * @error: Return location for error or %NULL.
16068 * Finishes creating a #GDBusProxy.
16070 * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
16076 * g_dbus_proxy_new_for_bus_sync:
16077 * @bus_type: A #GBusType.
16078 * @flags: Flags used when constructing the proxy.
16079 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16080 * @name: A bus name (well-known or unique).
16081 * @object_path: An object path.
16082 * @interface_name: A D-Bus interface name.
16083 * @cancellable: (allow-none): A #GCancellable or %NULL.
16084 * @error: Return location for error or %NULL.
16086 * Like g_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
16088 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16090 * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16096 * g_dbus_proxy_new_sync:
16097 * @connection: A #GDBusConnection.
16098 * @flags: Flags used when constructing the proxy.
16099 * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16100 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
16101 * @object_path: An object path.
16102 * @interface_name: A D-Bus interface name.
16103 * @cancellable: (allow-none): A #GCancellable or %NULL.
16104 * @error: (allow-none): Return location for error or %NULL.
16106 * Creates a proxy for accessing @interface_name on the remote object
16107 * at @object_path owned by @name at @connection and synchronously
16108 * loads D-Bus properties unless the
16109 * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used.
16111 * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
16112 * match rules for signals. Connect to the #GDBusProxy::g-signal signal
16113 * to handle signals from the remote object.
16115 * If @name is a well-known name and the
16116 * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
16117 * owner currently exists, the message bus will be requested to launch
16118 * a name owner for the name.
16120 * This is a synchronous failable constructor. See g_dbus_proxy_new()
16121 * and g_dbus_proxy_new_finish() for the asynchronous version.
16123 * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16125 * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16131 * g_dbus_proxy_set_cached_property:
16132 * @proxy: A #GDBusProxy
16133 * @property_name: Property name.
16134 * @value: (allow-none): Value for the property or %NULL to remove it from the cache.
16136 * If @value is not %NULL, sets the cached value for the property with
16137 * name @property_name to the value in @value.
16139 * If @value is %NULL, then the cached value is removed from the
16142 * If @proxy has an expected interface (see
16143 * #GDBusProxy:g-interface-info) and @property_name is referenced by
16144 * it, then @value is checked against the type of the property.
16146 * If the @value #GVariant is floating, it is consumed. This allows
16147 * convenient 'inline' use of g_variant_new(), e.g.
16149 * g_dbus_proxy_set_cached_property (proxy,
16151 * g_variant_new ("(si)",
16156 * Normally you will not need to use this method since @proxy is
16157 * tracking changes using the
16158 * <literal>org.freedesktop.DBus.Properties.PropertiesChanged</literal>
16159 * D-Bus signal. However, for performance reasons an object may decide
16160 * to not use this signal for some properties and instead use a
16161 * proprietary out-of-band mechanism to transmit changes.
16163 * As a concrete example, consider an object with a property
16164 * <literal>ChatroomParticipants</literal> which is an array of
16165 * strings. Instead of transmitting the same (long) array every time
16166 * the property changes, it is more efficient to only transmit the
16167 * delta using e.g. signals <literal>ChatroomParticipantJoined(String
16168 * name)</literal> and <literal>ChatroomParticipantParted(String
16176 * g_dbus_proxy_set_default_timeout:
16177 * @proxy: A #GDBusProxy.
16178 * @timeout_msec: Timeout in milliseconds.
16180 * Sets the timeout to use if -1 (specifying default timeout) is
16181 * passed as @timeout_msec in the g_dbus_proxy_call() and
16182 * g_dbus_proxy_call_sync() functions.
16184 * See the #GDBusProxy:g-default-timeout property for more details.
16191 * g_dbus_proxy_set_interface_info:
16192 * @proxy: A #GDBusProxy
16193 * @info: (allow-none): Minimum interface this proxy conforms to or %NULL to unset.
16195 * Ensure that interactions with @proxy conform to the given
16196 * interface. See the #GDBusProxy:g-interface-info property for more
16204 * g_dbus_server_get_client_address:
16205 * @server: A #GDBusServer.
16207 * Gets a D-Bus address string that can be used by clients to connect
16210 * Returns: A D-Bus address string. Do not free, the string is owned by @server.
16216 * g_dbus_server_get_flags:
16217 * @server: A #GDBusServer.
16219 * Gets the flags for @server.
16221 * Returns: A set of flags from the #GDBusServerFlags enumeration.
16227 * g_dbus_server_get_guid:
16228 * @server: A #GDBusServer.
16230 * Gets the GUID for @server.
16232 * Returns: A D-Bus GUID. Do not free this string, it is owned by @server.
16238 * g_dbus_server_is_active:
16239 * @server: A #GDBusServer.
16241 * Gets whether @server is active.
16243 * Returns: %TRUE if server is active, %FALSE otherwise.
16249 * g_dbus_server_new_sync:
16250 * @address: A D-Bus address.
16251 * @flags: Flags from the #GDBusServerFlags enumeration.
16252 * @guid: A D-Bus GUID.
16253 * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
16254 * @cancellable: (allow-none): A #GCancellable or %NULL.
16255 * @error: Return location for server or %NULL.
16257 * Creates a new D-Bus server that listens on the first address in
16258 * @address that works.
16260 * Once constructed, you can use g_dbus_server_get_client_address() to
16261 * get a D-Bus address string that clients can use to connect.
16263 * Connect to the #GDBusServer::new-connection signal to handle
16264 * incoming connections.
16266 * The returned #GDBusServer isn't active - you have to start it with
16267 * g_dbus_server_start().
16269 * See <xref linkend="gdbus-peer-to-peer"/> for how #GDBusServer can
16272 * This is a synchronous failable constructor. See
16273 * g_dbus_server_new() for the asynchronous version.
16275 * Returns: A #GDBusServer or %NULL if @error is set. Free with g_object_unref().
16281 * g_dbus_server_start:
16282 * @server: A #GDBusServer.
16291 * g_dbus_server_stop:
16292 * @server: A #GDBusServer.
16301 * g_dbus_signal_info_ref:
16302 * @info: A #GDBusSignalInfo
16304 * If @info is statically allocated does nothing. Otherwise increases
16305 * the reference count.
16307 * Returns: The same @info.
16313 * g_dbus_signal_info_unref:
16314 * @info: A #GDBusSignalInfo.
16316 * If @info is statically allocated, does nothing. Otherwise decreases
16317 * the reference count of @info. When its reference count drops to 0,
16318 * the memory used is freed.
16325 * g_desktop_app_info_get_categories:
16326 * @info: a #GDesktopAppInfo
16328 * Gets the categories from the desktop file.
16330 * Returns: The unparsed Categories key from the desktop file; i.e. no attempt is made to split it by ';' or validate it.
16335 * g_desktop_app_info_get_filename:
16336 * @info: a #GDesktopAppInfo
16338 * When @info was created from a known filename, return it. In some
16339 * situations such as the #GDesktopAppInfo returned from
16340 * g_desktop_app_info_new_from_keyfile(), this function will return %NULL.
16342 * Returns: The full path to the file for @info, or %NULL if not known.
16348 * g_desktop_app_info_get_generic_name:
16349 * @info: a #GDesktopAppInfo
16351 * Gets the generic name from the destkop file.
16353 * Returns: The value of the GenericName key
16358 * g_desktop_app_info_get_is_hidden:
16359 * @info: a #GDesktopAppInfo.
16361 * A desktop file is hidden if the Hidden key in it is
16364 * Returns: %TRUE if hidden, %FALSE otherwise.
16369 * g_desktop_app_info_get_keywords:
16370 * @info: a #GDesktopAppInfo
16372 * Gets the keywords from the desktop file.
16374 * Returns: (transfer none): The value of the Keywords key
16380 * g_desktop_app_info_get_nodisplay:
16381 * @info: a #GDesktopAppInfo
16383 * Gets the value of the NoDisplay key, which helps determine if the
16384 * application info should be shown in menus. See
16385 * #G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().
16387 * Returns: The value of the NoDisplay key
16393 * g_desktop_app_info_get_show_in:
16394 * @info: a #GDesktopAppInfo
16395 * @desktop_env: a string specifying a desktop name
16397 * Checks if the application info should be shown in menus that list available
16398 * applications for a specific name of the desktop, based on the
16399 * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys.
16401 * If @desktop_env is %NULL, then the name of the desktop set with
16402 * g_desktop_app_info_set_desktop_env() is used.
16404 * Note that g_app_info_should_show() for @info will include this check (with
16405 * %NULL for @desktop_env) as well as additional checks.
16407 * Returns: %TRUE if the @info should be shown in @desktop_env according to the <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys, %FALSE otherwise.
16413 * g_desktop_app_info_get_startup_wm_class:
16414 * @app_info: a #GDesktopAppInfo that supports startup notify
16416 * Retrieves the StartupWMClass field from @app_info. This represents the
16417 * WM_CLASS property of the main window of the application, if launched through
16420 * Returns: (transfer none): the startup WM class, or %NULL if none is set in the desktop file.
16426 * g_desktop_app_info_launch_uris_as_manager:
16427 * @appinfo: a #GDesktopAppInfo
16428 * @uris: (element-type utf8): List of URIs
16429 * @launch_context: a #GAppLaunchContext
16430 * @spawn_flags: #GSpawnFlags, used for each process
16431 * @user_setup: (scope call): a #GSpawnChildSetupFunc, used once for each process.
16432 * @user_setup_data: (closure user_setup): User data for @user_setup
16433 * @pid_callback: (scope call): Callback for child processes
16434 * @pid_callback_data: (closure pid_callback): User data for @callback
16435 * @error: return location for a #GError, or %NULL
16437 * This function performs the equivalent of g_app_info_launch_uris(),
16438 * but is intended primarily for operating system components that
16439 * launch applications. Ordinary applications should use
16440 * g_app_info_launch_uris().
16442 * In contrast to g_app_info_launch_uris(), all processes created will
16443 * always be run directly as children as if by the UNIX fork()/exec()
16446 * This guarantee allows additional control over the exact environment
16447 * of the child processes, which is provided via a setup function
16448 * @user_setup, as well as the process identifier of each child process
16449 * via @pid_callback. See g_spawn_async() for more information about the
16450 * semantics of the @user_setup function.
16452 * Returns: %TRUE on successful launch, %FALSE otherwise.
16457 * g_desktop_app_info_lookup_get_default_for_uri_scheme:
16458 * @lookup: a #GDesktopAppInfoLookup
16459 * @uri_scheme: a string containing a URI scheme.
16461 * Gets the default application for launching applications
16462 * using this URI scheme for a particular GDesktopAppInfoLookup
16465 * The GDesktopAppInfoLookup interface and this function is used
16466 * to implement g_app_info_get_default_for_uri_scheme() backends
16467 * in a GIO module. There is no reason for applications to use it
16468 * directly. Applications should use g_app_info_get_default_for_uri_scheme().
16470 * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
16471 * Deprecated: The #GDesktopAppInfoLookup interface is deprecated and unused by gio.
16476 * g_desktop_app_info_new:
16477 * @desktop_id: the desktop file id
16479 * Creates a new #GDesktopAppInfo based on a desktop file id.
16481 * A desktop file id is the basename of the desktop file, including the
16482 * .desktop extension. GIO is looking for a desktop file with this name
16483 * in the <filename>applications</filename> subdirectories of the XDG data
16484 * directories (i.e. the directories specified in the
16485 * <envar>XDG_DATA_HOME</envar> and <envar>XDG_DATA_DIRS</envar> environment
16486 * variables). GIO also supports the prefix-to-subdirectory mapping that is
16487 * described in the <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Menu Spec</ulink>
16488 * (i.e. a desktop id of kde-foo.desktop will match
16489 * <filename>/usr/share/applications/kde/foo.desktop</filename>).
16491 * Returns: a new #GDesktopAppInfo, or %NULL if no desktop file with that id
16496 * g_desktop_app_info_new_from_filename:
16497 * @filename: the path of a desktop file, in the GLib filename encoding
16499 * Creates a new #GDesktopAppInfo.
16501 * Returns: a new #GDesktopAppInfo or %NULL on error.
16506 * g_desktop_app_info_new_from_keyfile:
16507 * @key_file: an opened #GKeyFile
16509 * Creates a new #GDesktopAppInfo.
16511 * Returns: a new #GDesktopAppInfo or %NULL on error.
16517 * g_desktop_app_info_set_desktop_env:
16518 * @desktop_env: a string specifying what desktop this is
16520 * Sets the name of the desktop that the application is running in.
16521 * This is used by g_app_info_should_show() and
16522 * g_desktop_app_info_get_show_in() to evaluate the
16523 * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal>
16524 * desktop entry fields.
16526 * The <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Desktop
16527 * Menu specification</ulink> recognizes the following:
16529 * <member>GNOME</member>
16530 * <member>KDE</member>
16531 * <member>ROX</member>
16532 * <member>XFCE</member>
16533 * <member>LXDE</member>
16534 * <member>Unity</member>
16535 * <member>Old</member>
16538 * Should be called only once; subsequent calls are ignored.
16543 * g_drive_can_eject:
16544 * @drive: a #GDrive.
16546 * Checks if a drive can be ejected.
16548 * Returns: %TRUE if the @drive can be ejected, %FALSE otherwise.
16553 * g_drive_can_poll_for_media:
16554 * @drive: a #GDrive.
16556 * Checks if a drive can be polled for media changes.
16558 * Returns: %TRUE if the @drive can be polled for media changes, %FALSE otherwise.
16563 * g_drive_can_start:
16564 * @drive: a #GDrive.
16566 * Checks if a drive can be started.
16568 * Returns: %TRUE if the @drive can be started, %FALSE otherwise.
16574 * g_drive_can_start_degraded:
16575 * @drive: a #GDrive.
16577 * Checks if a drive can be started degraded.
16579 * Returns: %TRUE if the @drive can be started degraded, %FALSE otherwise.
16585 * g_drive_can_stop:
16586 * @drive: a #GDrive.
16588 * Checks if a drive can be stopped.
16590 * Returns: %TRUE if the @drive can be stopped, %FALSE otherwise.
16597 * @drive: a #GDrive.
16598 * @flags: flags affecting the unmount if required for eject
16599 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16600 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16601 * @user_data: user data to pass to @callback
16603 * Asynchronously ejects a drive.
16605 * When the operation is finished, @callback will be called.
16606 * You can then call g_drive_eject_finish() to obtain the
16607 * result of the operation.
16609 * Deprecated: 2.22: Use g_drive_eject_with_operation() instead.
16614 * g_drive_eject_finish:
16615 * @drive: a #GDrive.
16616 * @result: a #GAsyncResult.
16617 * @error: a #GError, or %NULL
16619 * Finishes ejecting a drive.
16621 * Returns: %TRUE if the drive has been ejected successfully, %FALSE otherwise.
16622 * Deprecated: 2.22: Use g_drive_eject_with_operation_finish() instead.
16627 * g_drive_eject_with_operation:
16628 * @drive: a #GDrive.
16629 * @flags: flags affecting the unmount if required for eject
16630 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16631 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16632 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16633 * @user_data: user data passed to @callback.
16635 * Ejects a drive. This is an asynchronous operation, and is
16636 * finished by calling g_drive_eject_with_operation_finish() with the @drive
16637 * and #GAsyncResult data returned in the @callback.
16644 * g_drive_eject_with_operation_finish:
16645 * @drive: a #GDrive.
16646 * @result: a #GAsyncResult.
16647 * @error: a #GError location to store the error occurring, or %NULL to ignore.
16649 * Finishes ejecting a drive. If any errors occurred during the operation,
16650 * @error will be set to contain the errors and %FALSE will be returned.
16652 * Returns: %TRUE if the drive was successfully ejected. %FALSE otherwise.
16658 * g_drive_enumerate_identifiers:
16659 * @drive: a #GDrive
16661 * Gets the kinds of identifiers that @drive has.
16662 * Use g_drive_get_identifier() to obtain the identifiers
16665 * Returns: (transfer full) (array zero-terminated=1): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
16670 * g_drive_get_icon:
16671 * @drive: a #GDrive.
16673 * Gets the icon for @drive.
16675 * Returns: (transfer full): #GIcon for the @drive. Free the returned object with g_object_unref().
16680 * g_drive_get_identifier:
16681 * @drive: a #GDrive
16682 * @kind: the kind of identifier to return
16684 * Gets the identifier of the given kind for @drive.
16686 * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GDrive doesn't have this kind of identifier.
16691 * g_drive_get_name:
16692 * @drive: a #GDrive.
16694 * Gets the name of @drive.
16696 * Returns: a string containing @drive's name. The returned string should be freed when no longer needed.
16701 * g_drive_get_sort_key:
16702 * @drive: A #GDrive.
16704 * Gets the sort key for @drive, if any.
16706 * Returns: Sorting key for @drive or %NULL if no such key is available.
16712 * g_drive_get_start_stop_type:
16713 * @drive: a #GDrive.
16715 * Gets a hint about how a drive can be started/stopped.
16717 * Returns: A value from the #GDriveStartStopType enumeration.
16723 * g_drive_get_volumes:
16724 * @drive: a #GDrive.
16726 * Get a list of mountable volumes for @drive.
16728 * The returned list should be freed with g_list_free(), after
16729 * its elements have been unreffed with g_object_unref().
16731 * Returns: (element-type GVolume) (transfer full): #GList containing any #GVolume objects on the given @drive.
16736 * g_drive_has_media:
16737 * @drive: a #GDrive.
16739 * Checks if the @drive has media. Note that the OS may not be polling
16740 * the drive for media changes; see g_drive_is_media_check_automatic()
16741 * for more details.
16743 * Returns: %TRUE if @drive has media, %FALSE otherwise.
16748 * g_drive_has_volumes:
16749 * @drive: a #GDrive.
16751 * Check if @drive has any mountable volumes.
16753 * Returns: %TRUE if the @drive contains volumes, %FALSE otherwise.
16758 * g_drive_is_media_check_automatic:
16759 * @drive: a #GDrive.
16761 * Checks if @drive is capabable of automatically detecting media changes.
16763 * Returns: %TRUE if the @drive is capabable of automatically detecting media changes, %FALSE otherwise.
16768 * g_drive_is_media_removable:
16769 * @drive: a #GDrive.
16771 * Checks if the @drive supports removable media.
16773 * Returns: %TRUE if @drive supports removable media, %FALSE otherwise.
16778 * g_drive_poll_for_media:
16779 * @drive: a #GDrive.
16780 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16781 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16782 * @user_data: user data to pass to @callback
16784 * Asynchronously polls @drive to see if media has been inserted or removed.
16786 * When the operation is finished, @callback will be called.
16787 * You can then call g_drive_poll_for_media_finish() to obtain the
16788 * result of the operation.
16793 * g_drive_poll_for_media_finish:
16794 * @drive: a #GDrive.
16795 * @result: a #GAsyncResult.
16796 * @error: a #GError, or %NULL
16798 * Finishes an operation started with g_drive_poll_for_media() on a drive.
16800 * Returns: %TRUE if the drive has been poll_for_mediaed successfully, %FALSE otherwise.
16806 * @drive: a #GDrive.
16807 * @flags: flags affecting the start operation.
16808 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16809 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16810 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16811 * @user_data: user data to pass to @callback
16813 * Asynchronously starts a drive.
16815 * When the operation is finished, @callback will be called.
16816 * You can then call g_drive_start_finish() to obtain the
16817 * result of the operation.
16824 * g_drive_start_finish:
16825 * @drive: a #GDrive.
16826 * @result: a #GAsyncResult.
16827 * @error: a #GError, or %NULL
16829 * Finishes starting a drive.
16831 * Returns: %TRUE if the drive has been started successfully, %FALSE otherwise.
16838 * @drive: a #GDrive.
16839 * @flags: flags affecting the unmount if required for stopping.
16840 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16841 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16842 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16843 * @user_data: user data to pass to @callback
16845 * Asynchronously stops a drive.
16847 * When the operation is finished, @callback will be called.
16848 * You can then call g_drive_stop_finish() to obtain the
16849 * result of the operation.
16856 * g_drive_stop_finish:
16857 * @drive: a #GDrive.
16858 * @result: a #GAsyncResult.
16859 * @error: a #GError, or %NULL
16861 * Finishes stopping a drive.
16863 * Returns: %TRUE if the drive has been stopped successfully, %FALSE otherwise.
16869 * g_emblem_get_icon:
16870 * @emblem: a #GEmblem from which the icon should be extracted.
16872 * Gives back the icon from @emblem.
16874 * Returns: (transfer none): a #GIcon. The returned object belongs to the emblem and should not be modified or freed.
16880 * g_emblem_get_origin:
16881 * @emblem: a #GEmblem
16883 * Gets the origin of the emblem.
16885 * Returns: (transfer none): the origin of the emblem
16892 * @icon: a GIcon containing the icon.
16894 * Creates a new emblem for @icon.
16896 * Returns: a new #GEmblem.
16902 * g_emblem_new_with_origin:
16903 * @icon: a GIcon containing the icon.
16904 * @origin: a GEmblemOrigin enum defining the emblem's origin
16906 * Creates a new emblem for @icon.
16908 * Returns: a new #GEmblem.
16914 * g_emblemed_icon_add_emblem:
16915 * @emblemed: a #GEmblemedIcon
16916 * @emblem: a #GEmblem
16918 * Adds @emblem to the #GList of #GEmblem <!-- -->s.
16925 * g_emblemed_icon_clear_emblems:
16926 * @emblemed: a #GEmblemedIcon
16928 * Removes all the emblems from @icon.
16935 * g_emblemed_icon_get_emblems:
16936 * @emblemed: a #GEmblemedIcon
16938 * Gets the list of emblems for the @icon.
16940 * Returns: (element-type Gio.Emblem) (transfer none): a #GList of #GEmblem <!-- -->s that is owned by @emblemed
16946 * g_emblemed_icon_get_icon:
16947 * @emblemed: a #GEmblemedIcon
16949 * Gets the main icon for @emblemed.
16951 * Returns: (transfer none): a #GIcon that is owned by @emblemed
16957 * g_emblemed_icon_new:
16959 * @emblem: (allow-none): a #GEmblem, or %NULL
16961 * Creates a new emblemed icon for @icon with the emblem @emblem.
16963 * Returns: (transfer full) (type GEmblemedIcon): a new #GIcon
16969 * g_file_append_to:
16970 * @file: input #GFile.
16971 * @flags: a set of #GFileCreateFlags.
16972 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16973 * @error: a #GError, or %NULL
16975 * Gets an output stream for appending data to the file. If
16976 * the file doesn't already exist it is created.
16978 * By default files created are generally readable by everyone,
16979 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
16980 * will be made readable only to the current user, to the level that
16981 * is supported on the target filesystem.
16983 * If @cancellable is not %NULL, then the operation can be cancelled by
16984 * triggering the cancellable object from another thread. If the operation
16985 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
16987 * Some file systems don't allow all file names, and may
16988 * return an %G_IO_ERROR_INVALID_FILENAME error.
16989 * If the file is a directory the %G_IO_ERROR_IS_DIRECTORY error will be
16990 * returned. Other errors are possible too, and depend on what kind of
16991 * filesystem the file is on.
16993 * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
16998 * g_file_append_to_async:
16999 * @file: input #GFile.
17000 * @flags: a set of #GFileCreateFlags.
17001 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
17002 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17003 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17004 * @user_data: (closure): the data to pass to callback function
17006 * Asynchronously opens @file for appending.
17008 * For more details, see g_file_append_to() which is
17009 * the synchronous version of this call.
17011 * When the operation is finished, @callback will be called. You can then call
17012 * g_file_append_to_finish() to get the result of the operation.
17017 * g_file_append_to_finish:
17018 * @file: input #GFile.
17019 * @res: #GAsyncResult
17020 * @error: a #GError, or %NULL
17022 * Finishes an asynchronous file append operation started with
17023 * g_file_append_to_async().
17025 * Returns: (transfer full): a valid #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
17030 * g_file_attribute_info_list_add:
17031 * @list: a #GFileAttributeInfoList.
17032 * @name: the name of the attribute to add.
17033 * @type: the #GFileAttributeType for the attribute.
17034 * @flags: #GFileAttributeInfoFlags for the attribute.
17036 * Adds a new attribute with @name to the @list, setting
17037 * its @type and @flags.
17042 * g_file_attribute_info_list_dup:
17043 * @list: a #GFileAttributeInfoList to duplicate.
17045 * Makes a duplicate of a file attribute info list.
17047 * Returns: a copy of the given @list.
17052 * g_file_attribute_info_list_lookup:
17053 * @list: a #GFileAttributeInfoList.
17054 * @name: the name of the attribute to lookup.
17056 * Gets the file attribute with the name @name from @list.
17058 * Returns: a #GFileAttributeInfo for the @name, or %NULL if an attribute isn't found.
17063 * g_file_attribute_info_list_new:
17065 * Creates a new file attribute info list.
17067 * Returns: a #GFileAttributeInfoList.
17072 * g_file_attribute_info_list_ref:
17073 * @list: a #GFileAttributeInfoList to reference.
17075 * References a file attribute info list.
17077 * Returns: #GFileAttributeInfoList or %NULL on error.
17082 * g_file_attribute_info_list_unref:
17083 * @list: The #GFileAttributeInfoList to unreference.
17085 * Removes a reference from the given @list. If the reference count
17086 * falls to zero, the @list is deleted.
17091 * g_file_attribute_matcher_enumerate_namespace:
17092 * @matcher: a #GFileAttributeMatcher.
17093 * @ns: a string containing a file attribute namespace.
17095 * Checks if the matcher will match all of the keys in a given namespace.
17096 * This will always return %TRUE if a wildcard character is in use (e.g. if
17097 * matcher was created with "standard::*" and @ns is "standard", or if matcher was created
17098 * using "*" and namespace is anything.)
17100 * TODO: this is awkwardly worded.
17102 * Returns: %TRUE if the matcher matches all of the entries in the given @ns, %FALSE otherwise.
17107 * g_file_attribute_matcher_enumerate_next:
17108 * @matcher: a #GFileAttributeMatcher.
17110 * Gets the next matched attribute from a #GFileAttributeMatcher.
17112 * Returns: a string containing the next attribute or %NULL if no more attribute exist.
17117 * g_file_attribute_matcher_matches:
17118 * @matcher: a #GFileAttributeMatcher.
17119 * @attribute: a file attribute key.
17121 * Checks if an attribute will be matched by an attribute matcher. If
17122 * the matcher was created with the "*" matching string, this function
17123 * will always return %TRUE.
17125 * Returns: %TRUE if @attribute matches @matcher. %FALSE otherwise.
17130 * g_file_attribute_matcher_matches_only:
17131 * @matcher: a #GFileAttributeMatcher.
17132 * @attribute: a file attribute key.
17134 * Checks if a attribute matcher only matches a given attribute. Always
17135 * returns %FALSE if "*" was used when creating the matcher.
17137 * Returns: %TRUE if the matcher only matches @attribute. %FALSE otherwise.
17142 * g_file_attribute_matcher_new:
17143 * @attributes: an attribute string to match.
17145 * Creates a new file attribute matcher, which matches attributes
17146 * against a given string. #GFileAttributeMatcher<!-- -->s are reference
17147 * counted structures, and are created with a reference count of 1. If
17148 * the number of references falls to 0, the #GFileAttributeMatcher is
17149 * automatically destroyed.
17151 * The @attribute string should be formatted with specific keys separated
17152 * from namespaces with a double colon. Several "namespace::key" strings may be
17153 * concatenated with a single comma (e.g. "standard::type,standard::is-hidden").
17154 * The wildcard "*" may be used to match all keys and namespaces, or
17155 * "namespace::*" will match all keys in a given namespace.
17157 * Examples of strings to use:
17159 * <title>File Attribute Matcher strings and results</title>
17160 * <tgroup cols='2' align='left'><thead>
17161 * <row><entry> Matcher String </entry><entry> Matches </entry></row></thead>
17163 * <row><entry>"*"</entry><entry>matches all attributes.</entry></row>
17164 * <row><entry>"standard::is-hidden"</entry><entry>matches only the key is-hidden in the standard namespace.</entry></row>
17165 * <row><entry>"standard::type,unix::*"</entry><entry>matches the type key in the standard namespace and
17166 * all keys in the unix namespace.</entry></row>
17167 * </tbody></tgroup>
17170 * Returns: a #GFileAttributeMatcher.
17175 * g_file_attribute_matcher_ref:
17176 * @matcher: a #GFileAttributeMatcher.
17178 * References a file attribute matcher.
17180 * Returns: a #GFileAttributeMatcher.
17185 * g_file_attribute_matcher_subtract:
17186 * @matcher: Matcher to subtract from
17187 * @subtract: The matcher to subtract
17189 * Subtracts all attributes of @subtract from @matcher and returns
17190 * a matcher that supports those attributes.
17192 * Note that currently it is not possible to remove a single
17193 * attribute when the @matcher matches the whole namespace - or remove
17194 * a namespace or attribute when the matcher matches everything. This
17195 * is a limitation of the current implementation, but may be fixed
17198 * Returns: A file attribute matcher matching all attributes of @matcher that are not matched by @subtract
17203 * g_file_attribute_matcher_to_string:
17204 * @matcher: (allow-none): a #GFileAttributeMatcher.
17206 * Prints what the matcher is matching against. The format will be
17207 * equal to the format passed to g_file_attribute_matcher_new().
17208 * The output however, might not be identical, as the matcher may
17209 * decide to use a different order or omit needless parts.
17211 * Returns: a string describing the attributes the matcher matches against or %NULL if @matcher was %NULL.
17217 * g_file_attribute_matcher_unref:
17218 * @matcher: a #GFileAttributeMatcher.
17220 * Unreferences @matcher. If the reference count falls below 1,
17221 * the @matcher is automatically freed.
17227 * @source: input #GFile.
17228 * @destination: destination #GFile
17229 * @flags: set of #GFileCopyFlags
17230 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17231 * @progress_callback: (allow-none) (scope call): function to callback with progress information, or %NULL if progress information is not needed
17232 * @progress_callback_data: (closure): user data to pass to @progress_callback
17233 * @error: #GError to set on error, or %NULL
17235 * Copies the file @source to the location specified by @destination.
17236 * Can not handle recursive copies of directories.
17238 * If the flag #G_FILE_COPY_OVERWRITE is specified an already
17239 * existing @destination file is overwritten.
17241 * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
17242 * will be copied as symlinks, otherwise the target of the
17243 * @source symlink will be copied.
17245 * If @cancellable is not %NULL, then the operation can be cancelled by
17246 * triggering the cancellable object from another thread. If the operation
17247 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17249 * If @progress_callback is not %NULL, then the operation can be monitored by
17250 * setting this to a #GFileProgressCallback function. @progress_callback_data
17251 * will be passed to this function. It is guaranteed that this callback will
17252 * be called after all data has been transferred with the total number of bytes
17253 * copied during the operation.
17255 * If the @source file does not exist then the G_IO_ERROR_NOT_FOUND
17256 * error is returned, independent on the status of the @destination.
17258 * If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then the
17259 * error G_IO_ERROR_EXISTS is returned.
17261 * If trying to overwrite a file over a directory the G_IO_ERROR_IS_DIRECTORY
17262 * error is returned. If trying to overwrite a directory with a directory the
17263 * G_IO_ERROR_WOULD_MERGE error is returned.
17265 * If the source is a directory and the target does not exist, or
17266 * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then the
17267 * G_IO_ERROR_WOULD_RECURSE error is returned.
17269 * If you are interested in copying the #GFile object itself (not the on-disk
17270 * file), see g_file_dup().
17272 * Returns: %TRUE on success, %FALSE otherwise.
17277 * g_file_copy_async: (skip)
17278 * @source: input #GFile.
17279 * @destination: destination #GFile
17280 * @flags: set of #GFileCopyFlags
17281 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17282 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17283 * @progress_callback: (allow-none): function to callback with progress information, or %NULL if progress information is not needed
17284 * @progress_callback_data: (closure): user data to pass to @progress_callback
17285 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17286 * @user_data: the data to pass to callback function
17288 * Copies the file @source to the location specified by @destination
17289 * asynchronously. For details of the behaviour, see g_file_copy().
17291 * If @progress_callback is not %NULL, then that function that will be called
17292 * just like in g_file_copy(), however the callback will run in the main loop,
17293 * not in the thread that is doing the I/O operation.
17295 * When the operation is finished, @callback will be called. You can then call
17296 * g_file_copy_finish() to get the result of the operation.
17301 * g_file_copy_attributes:
17302 * @source: a #GFile with attributes.
17303 * @destination: a #GFile to copy attributes to.
17304 * @flags: a set of #GFileCopyFlags.
17305 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17306 * @error: a #GError, %NULL to ignore.
17308 * Copies the file attributes from @source to @destination.
17310 * Normally only a subset of the file attributes are copied,
17311 * those that are copies in a normal file copy operation
17312 * (which for instance does not include e.g. owner). However
17313 * if #G_FILE_COPY_ALL_METADATA is specified in @flags, then
17314 * all the metadata that is possible to copy is copied. This
17315 * is useful when implementing move by copy + delete source.
17317 * Returns: %TRUE if the attributes were copied successfully, %FALSE otherwise.
17322 * g_file_copy_finish:
17323 * @file: input #GFile.
17324 * @res: a #GAsyncResult.
17325 * @error: a #GError, or %NULL
17327 * Finishes copying the file started with
17328 * g_file_copy_async().
17330 * Returns: a %TRUE on success, %FALSE on error.
17336 * @file: input #GFile.
17337 * @flags: a set of #GFileCreateFlags.
17338 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17339 * @error: a #GError, or %NULL
17341 * Creates a new file and returns an output stream for writing to it.
17342 * The file must not already exist.
17344 * By default files created are generally readable by everyone,
17345 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17346 * will be made readable only to the current user, to the level that
17347 * is supported on the target filesystem.
17349 * If @cancellable is not %NULL, then the operation can be cancelled by
17350 * triggering the cancellable object from another thread. If the operation
17351 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17353 * If a file or directory with this name already exists the G_IO_ERROR_EXISTS
17354 * error will be returned.
17355 * Some file systems don't allow all file names, and may
17356 * return an G_IO_ERROR_INVALID_FILENAME error, and if the name
17357 * is to long G_IO_ERROR_FILENAME_TOO_LONG will be returned.
17358 * Other errors are possible too, and depend on what kind of
17359 * filesystem the file is on.
17361 * Returns: (transfer full): a #GFileOutputStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
17366 * g_file_create_async:
17367 * @file: input #GFile.
17368 * @flags: a set of #GFileCreateFlags.
17369 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
17370 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17371 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17372 * @user_data: (closure): the data to pass to callback function
17374 * Asynchronously creates a new file and returns an output stream for writing to it.
17375 * The file must not already exist.
17377 * For more details, see g_file_create() which is
17378 * the synchronous version of this call.
17380 * When the operation is finished, @callback will be called. You can then call
17381 * g_file_create_finish() to get the result of the operation.
17386 * g_file_create_finish:
17387 * @file: input #GFile.
17388 * @res: a #GAsyncResult.
17389 * @error: a #GError, or %NULL
17391 * Finishes an asynchronous file create operation started with
17392 * g_file_create_async().
17394 * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
17399 * g_file_create_readwrite:
17401 * @flags: a set of #GFileCreateFlags
17402 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17403 * @error: return location for a #GError, or %NULL
17405 * Creates a new file and returns a stream for reading and writing to it.
17406 * The file must not already exist.
17408 * By default files created are generally readable by everyone,
17409 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17410 * will be made readable only to the current user, to the level that
17411 * is supported on the target filesystem.
17413 * If @cancellable is not %NULL, then the operation can be cancelled by
17414 * triggering the cancellable object from another thread. If the operation
17415 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17417 * If a file or directory with this name already exists the %G_IO_ERROR_EXISTS
17418 * error will be returned. Some file systems don't allow all file names,
17419 * and may return an %G_IO_ERROR_INVALID_FILENAME error, and if the name
17420 * is too long, %G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors
17421 * are possible too, and depend on what kind of filesystem the file is on.
17423 * Note that in many non-local file cases read and write streams are not
17424 * supported, so make sure you really need to do read and write streaming,
17425 * rather than just opening for reading or writing.
17427 * Returns: (transfer full): a #GFileIOStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
17433 * g_file_create_readwrite_async:
17434 * @file: input #GFile
17435 * @flags: a set of #GFileCreateFlags
17436 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17437 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17438 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17439 * @user_data: (closure): the data to pass to callback function
17441 * Asynchronously creates a new file and returns a stream for reading and
17442 * writing to it. The file must not already exist.
17444 * For more details, see g_file_create_readwrite() which is
17445 * the synchronous version of this call.
17447 * When the operation is finished, @callback will be called. You can then
17448 * call g_file_create_readwrite_finish() to get the result of the operation.
17455 * g_file_create_readwrite_finish:
17456 * @file: input #GFile
17457 * @res: a #GAsyncResult
17458 * @error: a #GError, or %NULL
17460 * Finishes an asynchronous file create operation started with
17461 * g_file_create_readwrite_async().
17463 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
17470 * @file: input #GFile.
17471 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17472 * @error: a #GError, or %NULL
17474 * Deletes a file. If the @file is a directory, it will only be deleted if it
17477 * If @cancellable is not %NULL, then the operation can be cancelled by
17478 * triggering the cancellable object from another thread. If the operation
17479 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17481 * Virtual: delete_file
17482 * Returns: %TRUE if the file was deleted. %FALSE otherwise.
17487 * g_file_descriptor_based_get_fd:
17488 * @fd_based: a #GFileDescriptorBased.
17490 * Gets the underlying file descriptor.
17492 * Returns: The file descriptor
17499 * @file: input #GFile.
17501 * Duplicates a #GFile handle. This operation does not duplicate
17502 * the actual file or directory represented by the #GFile; see
17503 * g_file_copy() if attempting to copy a file.
17505 * This call does no blocking i/o.
17507 * Returns: (transfer full): a new #GFile that is a duplicate of the given #GFile.
17512 * g_file_eject_mountable:
17513 * @file: input #GFile.
17514 * @flags: flags affecting the operation
17515 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17516 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
17517 * @user_data: (closure): the data to pass to callback function
17519 * Starts an asynchronous eject on a mountable.
17520 * When this operation has completed, @callback will be called with
17521 * @user_user data, and the operation can be finalized with
17522 * g_file_eject_mountable_finish().
17524 * If @cancellable is not %NULL, then the operation can be cancelled by
17525 * triggering the cancellable object from another thread. If the operation
17526 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17528 * Deprecated: 2.22: Use g_file_eject_mountable_with_operation() instead.
17533 * g_file_eject_mountable_finish:
17534 * @file: input #GFile.
17535 * @result: a #GAsyncResult.
17536 * @error: a #GError, or %NULL
17538 * Finishes an asynchronous eject operation started by
17539 * g_file_eject_mountable().
17541 * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
17542 * Deprecated: 2.22: Use g_file_eject_mountable_with_operation_finish() instead.
17547 * g_file_eject_mountable_with_operation:
17548 * @file: input #GFile.
17549 * @flags: flags affecting the operation
17550 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
17551 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17552 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
17553 * @user_data: (closure): the data to pass to callback function
17555 * Starts an asynchronous eject on a mountable.
17556 * When this operation has completed, @callback will be called with
17557 * @user_user data, and the operation can be finalized with
17558 * g_file_eject_mountable_with_operation_finish().
17560 * If @cancellable is not %NULL, then the operation can be cancelled by
17561 * triggering the cancellable object from another thread. If the operation
17562 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17569 * g_file_eject_mountable_with_operation_finish:
17570 * @file: input #GFile.
17571 * @result: a #GAsyncResult.
17572 * @error: a #GError, or %NULL
17574 * Finishes an asynchronous eject operation started by
17575 * g_file_eject_mountable_with_operation().
17577 * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
17583 * g_file_enumerate_children:
17584 * @file: input #GFile.
17585 * @attributes: an attribute query string.
17586 * @flags: a set of #GFileQueryInfoFlags.
17587 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17588 * @error: #GError for error reporting.
17590 * Gets the requested information about the files in a directory. The result
17591 * is a #GFileEnumerator object that will give out #GFileInfo objects for
17592 * all the files in the directory.
17594 * The @attributes value is a string that specifies the file attributes that
17595 * should be gathered. It is not an error if it's not possible to read a particular
17596 * requested attribute from a file - it just won't be set. @attributes should
17597 * be a comma-separated list of attributes or attribute wildcards. The wildcard "*"
17598 * means all attributes, and a wildcard like "standard::*" means all attributes in the standard
17599 * namespace. An example attribute query be "standard::*,owner::user".
17600 * The standard attributes are available as defines, like #G_FILE_ATTRIBUTE_STANDARD_NAME.
17602 * If @cancellable is not %NULL, then the operation can be cancelled by
17603 * triggering the cancellable object from another thread. If the operation
17604 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17606 * If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
17607 * If the file is not a directory, the G_FILE_ERROR_NOTDIR error will be returned.
17608 * Other errors are possible too.
17610 * Returns: (transfer full): A #GFileEnumerator if successful, %NULL on error. Free the returned object with g_object_unref().
17615 * g_file_enumerate_children_async:
17616 * @file: input #GFile.
17617 * @attributes: an attribute query string.
17618 * @flags: a set of #GFileQueryInfoFlags.
17619 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
17620 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17621 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17622 * @user_data: (closure): the data to pass to callback function
17624 * Asynchronously gets the requested information about the files in a directory. The result
17625 * is a #GFileEnumerator object that will give out #GFileInfo objects for
17626 * all the files in the directory.
17628 * For more details, see g_file_enumerate_children() which is
17629 * the synchronous version of this call.
17631 * When the operation is finished, @callback will be called. You can then call
17632 * g_file_enumerate_children_finish() to get the result of the operation.
17637 * g_file_enumerate_children_finish:
17638 * @file: input #GFile.
17639 * @res: a #GAsyncResult.
17640 * @error: a #GError.
17642 * Finishes an async enumerate children operation.
17643 * See g_file_enumerate_children_async().
17645 * Returns: (transfer full): a #GFileEnumerator or %NULL if an error occurred. Free the returned object with g_object_unref().
17650 * g_file_enumerator_close:
17651 * @enumerator: a #GFileEnumerator.
17652 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17653 * @error: location to store the error occurring, or %NULL to ignore
17655 * Releases all resources used by this enumerator, making the
17656 * enumerator return %G_IO_ERROR_CLOSED on all calls.
17658 * This will be automatically called when the last reference
17659 * is dropped, but you might want to call this function to make
17660 * sure resources are released as early as possible.
17662 * Returns: #TRUE on success or #FALSE on error.
17667 * g_file_enumerator_close_async:
17668 * @enumerator: a #GFileEnumerator.
17669 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
17670 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17671 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17672 * @user_data: (closure): the data to pass to callback function
17674 * Asynchronously closes the file enumerator.
17676 * If @cancellable is not %NULL, then the operation can be cancelled by
17677 * triggering the cancellable object from another thread. If the operation
17678 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned in
17679 * g_file_enumerator_close_finish().
17684 * g_file_enumerator_close_finish:
17685 * @enumerator: a #GFileEnumerator.
17686 * @result: a #GAsyncResult.
17687 * @error: a #GError location to store the error occurring, or %NULL to ignore.
17689 * Finishes closing a file enumerator, started from g_file_enumerator_close_async().
17691 * If the file enumerator was already closed when g_file_enumerator_close_async()
17692 * was called, then this function will report %G_IO_ERROR_CLOSED in @error, and
17693 * return %FALSE. If the file enumerator had pending operation when the close
17694 * operation was started, then this function will report %G_IO_ERROR_PENDING, and
17695 * return %FALSE. If @cancellable was not %NULL, then the operation may have been
17696 * cancelled by triggering the cancellable object from another thread. If the operation
17697 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %FALSE will be
17700 * Returns: %TRUE if the close operation has finished successfully.
17705 * g_file_enumerator_get_container:
17706 * @enumerator: a #GFileEnumerator
17708 * Get the #GFile container which is being enumerated.
17710 * Returns: (transfer none): the #GFile which is being enumerated.
17716 * g_file_enumerator_has_pending:
17717 * @enumerator: a #GFileEnumerator.
17719 * Checks if the file enumerator has pending operations.
17721 * Returns: %TRUE if the @enumerator has pending operations.
17726 * g_file_enumerator_is_closed:
17727 * @enumerator: a #GFileEnumerator.
17729 * Checks if the file enumerator has been closed.
17731 * Returns: %TRUE if the @enumerator is closed.
17736 * g_file_enumerator_next_file:
17737 * @enumerator: a #GFileEnumerator.
17738 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17739 * @error: location to store the error occurring, or %NULL to ignore
17741 * Returns information for the next file in the enumerated object.
17742 * Will block until the information is available. The #GFileInfo
17743 * returned from this function will contain attributes that match the
17744 * attribute string that was passed when the #GFileEnumerator was created.
17746 * On error, returns %NULL and sets @error to the error. If the
17747 * enumerator is at the end, %NULL will be returned and @error will
17750 * 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.
17755 * g_file_enumerator_next_files_async:
17756 * @enumerator: a #GFileEnumerator.
17757 * @num_files: the number of file info objects to request
17758 * @io_priority: the <link linkend="gioscheduler">io priority</link> of the request.
17759 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17760 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17761 * @user_data: (closure): the data to pass to callback function
17763 * Request information for a number of files from the enumerator asynchronously.
17764 * When all i/o for the operation is finished the @callback will be called with
17765 * the requested information.
17767 * The callback can be called with less than @num_files files in case of error
17768 * or at the end of the enumerator. In case of a partial error the callback will
17769 * be called with any succeeding items and no error, and on the next request the
17770 * error will be reported. If a request is cancelled the callback will be called
17771 * with %G_IO_ERROR_CANCELLED.
17773 * During an async request no other sync and async calls are allowed, and will
17774 * result in %G_IO_ERROR_PENDING errors.
17776 * Any outstanding i/o request with higher priority (lower numerical value) will
17777 * be executed before an outstanding request with lower priority. Default
17778 * priority is %G_PRIORITY_DEFAULT.
17783 * g_file_enumerator_next_files_finish:
17784 * @enumerator: a #GFileEnumerator.
17785 * @result: a #GAsyncResult.
17786 * @error: a #GError location to store the error occurring, or %NULL to ignore.
17788 * Finishes the asynchronous operation started with g_file_enumerator_next_files_async().
17790 * 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.
17795 * g_file_enumerator_set_pending:
17796 * @enumerator: a #GFileEnumerator.
17797 * @pending: a boolean value.
17799 * Sets the file enumerator as having pending operations.
17805 * @file1: the first #GFile.
17806 * @file2: the second #GFile.
17808 * Checks equality of two given #GFile<!-- -->s. Note that two
17809 * #GFile<!-- -->s that differ can still refer to the same
17810 * file on the filesystem due to various forms of filename
17813 * This call does no blocking i/o.
17815 * Returns: %TRUE if @file1 and @file2 are equal. %FALSE if either is not a #GFile.
17820 * g_file_find_enclosing_mount:
17821 * @file: input #GFile.
17822 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17823 * @error: a #GError.
17825 * Gets a #GMount for the #GFile.
17827 * If the #GFileIface for @file does not have a mount (e.g. possibly a
17828 * remote share), @error will be set to %G_IO_ERROR_NOT_FOUND and %NULL
17829 * will be returned.
17831 * If @cancellable is not %NULL, then the operation can be cancelled by
17832 * triggering the cancellable object from another thread. If the operation
17833 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17835 * Returns: (transfer full): a #GMount where the @file is located or %NULL on error. Free the returned object with g_object_unref().
17840 * g_file_find_enclosing_mount_async:
17842 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
17843 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17844 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17845 * @user_data: (closure): the data to pass to callback function
17847 * Asynchronously gets the mount for the file.
17849 * For more details, see g_file_find_enclosing_mount() which is
17850 * the synchronous version of this call.
17852 * When the operation is finished, @callback will be called. You can then call
17853 * g_file_find_enclosing_mount_finish() to get the result of the operation.
17858 * g_file_find_enclosing_mount_finish:
17860 * @res: a #GAsyncResult
17861 * @error: a #GError
17863 * Finishes an asynchronous find mount request.
17864 * See g_file_find_enclosing_mount_async().
17866 * Returns: (transfer full): #GMount for given @file or %NULL on error. Free the returned object with g_object_unref().
17871 * g_file_get_basename:
17872 * @file: input #GFile.
17874 * Gets the base name (the last component of the path) for a given #GFile.
17876 * If called for the top level of a system (such as the filesystem root
17877 * or a uri like sftp://host/) it will return a single directory separator
17878 * (and on Windows, possibly a drive letter).
17880 * The base name is a byte string (*not* UTF-8). It has no defined encoding
17881 * or rules other than it may not contain zero bytes. If you want to use
17882 * filenames in a user interface you should use the display name that you
17883 * can get by requesting the %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
17884 * attribute with g_file_query_info().
17886 * This call does no blocking i/o.
17888 * 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.
17893 * g_file_get_child:
17894 * @file: input #GFile.
17895 * @name: string containing the child's basename.
17897 * Gets a child of @file with basename equal to @name.
17899 * Note that the file with that specific name might not exist, but
17900 * you can still have a #GFile that points to it. You can use this
17901 * for instance to create that file.
17903 * This call does no blocking i/o.
17905 * Returns: (transfer full): a #GFile to a child specified by @name. Free the returned object with g_object_unref().
17910 * g_file_get_child_for_display_name:
17911 * @file: input #GFile.
17912 * @display_name: string to a possible child.
17915 * Gets the child of @file for a given @display_name (i.e. a UTF8
17916 * version of the name). If this function fails, it returns %NULL and @error will be
17917 * set. This is very useful when constructing a GFile for a new file
17918 * and the user entered the filename in the user interface, for instance
17919 * when you select a directory and type a filename in the file selector.
17921 * This call does no blocking i/o.
17923 * 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().
17928 * g_file_get_parent:
17929 * @file: input #GFile.
17931 * Gets the parent directory for the @file.
17932 * If the @file represents the root directory of the
17933 * file system, then %NULL will be returned.
17935 * This call does no blocking i/o.
17937 * 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().
17942 * g_file_get_parse_name:
17943 * @file: input #GFile.
17945 * Gets the parse name of the @file.
17946 * A parse name is a UTF-8 string that describes the
17947 * file such that one can get the #GFile back using
17948 * g_file_parse_name().
17950 * This is generally used to show the #GFile as a nice
17951 * full-pathname kind of string in a user interface,
17952 * like in a location entry.
17954 * For local files with names that can safely be converted
17955 * to UTF8 the pathname is used, otherwise the IRI is used
17956 * (a form of URI that allows UTF8 characters unescaped).
17958 * This call does no blocking i/o.
17960 * Returns: a string containing the #GFile's parse name. The returned string should be freed with g_free() when no longer needed.
17966 * @file: input #GFile.
17968 * Gets the local pathname for #GFile, if one exists.
17970 * This call does no blocking i/o.
17972 * 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.
17977 * g_file_get_relative_path:
17978 * @parent: input #GFile.
17979 * @descendant: input #GFile.
17981 * Gets the path for @descendant relative to @parent.
17983 * This call does no blocking i/o.
17985 * 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.
17991 * @file: input #GFile.
17993 * Gets the URI for the @file.
17995 * This call does no blocking i/o.
17997 * Returns: a string containing the #GFile's URI. The returned string should be freed with g_free() when no longer needed.
18002 * g_file_get_uri_scheme:
18003 * @file: input #GFile.
18005 * Gets the URI scheme for a #GFile.
18006 * RFC 3986 decodes the scheme as:
18008 * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
18009 * </programlisting>
18010 * Common schemes include "file", "http", "ftp", etc.
18012 * This call does no blocking i/o.
18014 * Returns: a string containing the URI scheme for the given #GFile. The returned string should be freed with g_free() when no longer needed.
18019 * g_file_has_parent:
18020 * @file: input #GFile
18021 * @parent: (allow-none): the parent to check for, or %NULL
18023 * Checks if @file has a parent, and optionally, if it is @parent.
18025 * If @parent is %NULL then this function returns %TRUE if @file has any
18026 * parent at all. If @parent is non-%NULL then %TRUE is only returned
18027 * if @file is a child of @parent.
18029 * Returns: %TRUE if @file is a child of @parent (or any parent in the case that @parent is %NULL).
18035 * g_file_has_prefix:
18036 * @file: input #GFile.
18037 * @prefix: input #GFile.
18039 * Checks whether @file has the prefix specified by @prefix. In other word,
18040 * if the names of initial elements of @file<!-- -->s pathname match @prefix.
18041 * Only full pathname elements are matched, so a path like /foo is not
18042 * considered a prefix of /foobar, only of /foo/bar.
18044 * This call does no i/o, as it works purely on names. As such it can
18045 * sometimes return %FALSE even if @file is inside a @prefix (from a
18046 * filesystem point of view), because the prefix of @file is an alias
18049 * Virtual: prefix_matches
18050 * Returns: %TRUE if the @files's parent, grandparent, etc is @prefix. %FALSE otherwise.
18055 * g_file_has_uri_scheme:
18056 * @file: input #GFile.
18057 * @uri_scheme: a string containing a URI scheme.
18059 * Checks to see if a #GFile has a given URI scheme.
18061 * This call does no blocking i/o.
18063 * Returns: %TRUE if #GFile's backend supports the given URI scheme, %FALSE if URI scheme is %NULL, not supported, or #GFile is invalid.
18069 * @file: (type GFile): #gconstpointer to a #GFile.
18071 * Creates a hash value for a #GFile.
18073 * This call does no blocking i/o.
18076 * 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.
18081 * g_file_icon_get_file:
18084 * Gets the #GFile associated with the given @icon.
18086 * Returns: (transfer none): a #GFile, or %NULL.
18094 * Creates a new icon for a file.
18096 * Returns: (transfer full) (type GFileIcon): a #GIcon for the given @file, or %NULL on error.
18101 * g_file_info_clear_status:
18102 * @info: a #GFileInfo.
18104 * Clears the status information from @info.
18109 * g_file_info_copy_into:
18110 * @src_info: source to copy attributes from.
18111 * @dest_info: destination to copy attributes to.
18113 * Copies all of the <link linkend="gio-GFileAttribute">GFileAttribute</link>s
18114 * from @src_info to @dest_info.
18120 * @other: a #GFileInfo.
18122 * Duplicates a file info structure.
18124 * Returns: (transfer full): a duplicate #GFileInfo of @other.
18129 * g_file_info_get_attribute_as_string:
18130 * @info: a #GFileInfo.
18131 * @attribute: a file attribute key.
18133 * Gets the value of a attribute, formated as a string.
18134 * This escapes things as needed to make the string valid
18137 * Returns: a UTF-8 string associated with the given @attribute. When you're done with the string it must be freed with g_free().
18142 * g_file_info_get_attribute_boolean:
18143 * @info: a #GFileInfo.
18144 * @attribute: a file attribute key.
18146 * Gets the value of a boolean attribute. If the attribute does not
18147 * contain a boolean value, %FALSE will be returned.
18149 * Returns: the boolean value contained within the attribute.
18154 * g_file_info_get_attribute_byte_string:
18155 * @info: a #GFileInfo.
18156 * @attribute: a file attribute key.
18158 * Gets the value of a byte string attribute. If the attribute does
18159 * not contain a byte string, %NULL will be returned.
18161 * Returns: the contents of the @attribute value as a byte string, or %NULL otherwise.
18166 * g_file_info_get_attribute_data:
18167 * @info: a #GFileInfo
18168 * @attribute: a file attribute key
18169 * @type: (out) (allow-none): return location for the attribute type, or %NULL
18170 * @value_pp: (out) (allow-none): return location for the attribute value, or %NULL
18171 * @status: (out) (allow-none): return location for the attribute status, or %NULL
18173 * Gets the attribute type, value and status for an attribute key.
18175 * Returns: (transfer none): %TRUE if @info has an attribute named @attribute, %FALSE otherwise.
18180 * g_file_info_get_attribute_int32:
18181 * @info: a #GFileInfo.
18182 * @attribute: a file attribute key.
18184 * Gets a signed 32-bit integer contained within the attribute. If the
18185 * attribute does not contain a signed 32-bit integer, or is invalid,
18186 * 0 will be returned.
18188 * Returns: a signed 32-bit integer from the attribute.
18193 * g_file_info_get_attribute_int64:
18194 * @info: a #GFileInfo.
18195 * @attribute: a file attribute key.
18197 * Gets a signed 64-bit integer contained within the attribute. If the
18198 * attribute does not contain an signed 64-bit integer, or is invalid,
18199 * 0 will be returned.
18201 * Returns: a signed 64-bit integer from the attribute.
18206 * g_file_info_get_attribute_object:
18207 * @info: a #GFileInfo.
18208 * @attribute: a file attribute key.
18210 * Gets the value of a #GObject attribute. If the attribute does
18211 * not contain a #GObject, %NULL will be returned.
18213 * Returns: (transfer none): a #GObject associated with the given @attribute, or %NULL otherwise.
18218 * g_file_info_get_attribute_status:
18219 * @info: a #GFileInfo
18220 * @attribute: a file attribute key
18222 * Gets the attribute status for an attribute key.
18224 * Returns: a #GFileAttributeStatus for the given @attribute, or %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
18229 * g_file_info_get_attribute_string:
18230 * @info: a #GFileInfo.
18231 * @attribute: a file attribute key.
18233 * Gets the value of a string attribute. If the attribute does
18234 * not contain a string, %NULL will be returned.
18236 * Returns: the contents of the @attribute value as a UTF-8 string, or %NULL otherwise.
18241 * g_file_info_get_attribute_stringv:
18242 * @info: a #GFileInfo.
18243 * @attribute: a file attribute key.
18245 * Gets the value of a stringv attribute. If the attribute does
18246 * not contain a stringv, %NULL will be returned.
18248 * Returns: (transfer none): the contents of the @attribute value as a stringv, or %NULL otherwise. Do not free. These returned strings are UTF-8.
18254 * g_file_info_get_attribute_type:
18255 * @info: a #GFileInfo.
18256 * @attribute: a file attribute key.
18258 * Gets the attribute type for an attribute key.
18260 * Returns: a #GFileAttributeType for the given @attribute, or %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
18265 * g_file_info_get_attribute_uint32:
18266 * @info: a #GFileInfo.
18267 * @attribute: a file attribute key.
18269 * Gets an unsigned 32-bit integer contained within the attribute. If the
18270 * attribute does not contain an unsigned 32-bit integer, or is invalid,
18271 * 0 will be returned.
18273 * Returns: an unsigned 32-bit integer from the attribute.
18278 * g_file_info_get_attribute_uint64:
18279 * @info: a #GFileInfo.
18280 * @attribute: a file attribute key.
18282 * Gets a unsigned 64-bit integer contained within the attribute. If the
18283 * attribute does not contain an unsigned 64-bit integer, or is invalid,
18284 * 0 will be returned.
18286 * Returns: a unsigned 64-bit integer from the attribute.
18291 * g_file_info_get_content_type:
18292 * @info: a #GFileInfo.
18294 * Gets the file's content type.
18296 * Returns: a string containing the file's content type.
18301 * g_file_info_get_display_name:
18302 * @info: a #GFileInfo.
18304 * Gets a display name for a file.
18306 * Returns: a string containing the display name.
18311 * g_file_info_get_edit_name:
18312 * @info: a #GFileInfo.
18314 * Gets the edit name for a file.
18316 * Returns: a string containing the edit name.
18321 * g_file_info_get_etag:
18322 * @info: a #GFileInfo.
18324 * Gets the <link linkend="gfile-etag">entity tag</link> for a given
18325 * #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
18327 * Returns: a string containing the value of the "etag:value" attribute.
18332 * g_file_info_get_file_type:
18333 * @info: a #GFileInfo.
18335 * Gets a file's type (whether it is a regular file, symlink, etc).
18336 * This is different from the file's content type, see g_file_info_get_content_type().
18338 * Returns: a #GFileType for the given file.
18343 * g_file_info_get_icon:
18344 * @info: a #GFileInfo.
18346 * Gets the icon for a file.
18348 * Returns: (transfer none): #GIcon for the given @info.
18353 * g_file_info_get_is_backup:
18354 * @info: a #GFileInfo.
18356 * Checks if a file is a backup file.
18358 * Returns: %TRUE if file is a backup file, %FALSE otherwise.
18363 * g_file_info_get_is_hidden:
18364 * @info: a #GFileInfo.
18366 * Checks if a file is hidden.
18368 * Returns: %TRUE if the file is a hidden file, %FALSE otherwise.
18373 * g_file_info_get_is_symlink:
18374 * @info: a #GFileInfo.
18376 * Checks if a file is a symlink.
18378 * Returns: %TRUE if the given @info is a symlink.
18383 * g_file_info_get_modification_time:
18384 * @info: a #GFileInfo.
18385 * @result: (out caller-allocates): a #GTimeVal.
18387 * Gets the modification time of the current @info and sets it
18393 * g_file_info_get_name:
18394 * @info: a #GFileInfo.
18396 * Gets the name for a file.
18398 * Returns: a string containing the file name.
18403 * g_file_info_get_size:
18404 * @info: a #GFileInfo.
18406 * Gets the file's size.
18408 * Returns: a #goffset containing the file's size.
18413 * g_file_info_get_sort_order:
18414 * @info: a #GFileInfo.
18416 * Gets the value of the sort_order attribute from the #GFileInfo.
18417 * See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
18419 * Returns: a #gint32 containing the value of the "standard::sort_order" attribute.
18424 * g_file_info_get_symlink_target:
18425 * @info: a #GFileInfo.
18427 * Gets the symlink target for a given #GFileInfo.
18429 * Returns: a string containing the symlink target.
18434 * g_file_info_has_attribute:
18435 * @info: a #GFileInfo.
18436 * @attribute: a file attribute key.
18438 * Checks if a file info structure has an attribute named @attribute.
18440 * Returns: %TRUE if @Ginfo has an attribute named @attribute, %FALSE otherwise.
18445 * g_file_info_has_namespace:
18446 * @info: a #GFileInfo.
18447 * @name_space: a file attribute namespace.
18449 * Checks if a file info structure has an attribute in the
18450 * specified @name_space.
18452 * Returns: %TRUE if @Ginfo has an attribute in @name_space, %FALSE otherwise.
18458 * g_file_info_list_attributes:
18459 * @info: a #GFileInfo.
18460 * @name_space: a file attribute key's namespace.
18462 * Lists the file info structure's attributes.
18464 * 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.
18471 * Creates a new file info structure.
18473 * Returns: a #GFileInfo.
18478 * g_file_info_remove_attribute:
18479 * @info: a #GFileInfo.
18480 * @attribute: a file attribute key.
18482 * Removes all cases of @attribute from @info if it exists.
18487 * g_file_info_set_attribute:
18488 * @info: a #GFileInfo.
18489 * @attribute: a file attribute key.
18490 * @type: a #GFileAttributeType
18491 * @value_p: pointer to the value
18493 * Sets the @attribute to contain the given value, if possible. To unset the
18494 * attribute, use %G_ATTRIBUTE_TYPE_INVALID for @type.
18499 * g_file_info_set_attribute_boolean:
18500 * @info: a #GFileInfo.
18501 * @attribute: a file attribute key.
18502 * @attr_value: a boolean value.
18504 * Sets the @attribute to contain the given @attr_value,
18510 * g_file_info_set_attribute_byte_string:
18511 * @info: a #GFileInfo.
18512 * @attribute: a file attribute key.
18513 * @attr_value: a byte string.
18515 * Sets the @attribute to contain the given @attr_value,
18521 * g_file_info_set_attribute_int32:
18522 * @info: a #GFileInfo.
18523 * @attribute: a file attribute key.
18524 * @attr_value: a signed 32-bit integer
18526 * Sets the @attribute to contain the given @attr_value,
18532 * g_file_info_set_attribute_int64:
18533 * @info: a #GFileInfo.
18534 * @attribute: attribute name to set.
18535 * @attr_value: int64 value to set attribute to.
18537 * Sets the @attribute to contain the given @attr_value,
18543 * g_file_info_set_attribute_mask:
18544 * @info: a #GFileInfo.
18545 * @mask: a #GFileAttributeMatcher.
18547 * Sets @mask on @info to match specific attribute types.
18552 * g_file_info_set_attribute_object:
18553 * @info: a #GFileInfo.
18554 * @attribute: a file attribute key.
18555 * @attr_value: a #GObject.
18557 * Sets the @attribute to contain the given @attr_value,
18563 * g_file_info_set_attribute_status:
18564 * @info: a #GFileInfo
18565 * @attribute: a file attribute key
18566 * @status: a #GFileAttributeStatus
18568 * Sets the attribute status for an attribute key. This is only
18569 * needed by external code that implement g_file_set_attributes_from_info()
18570 * or similar functions.
18572 * The attribute must exist in @info for this to work. Otherwise %FALSE
18573 * is returned and @info is unchanged.
18575 * Returns: %TRUE if the status was changed, %FALSE if the key was not set.
18581 * g_file_info_set_attribute_string:
18582 * @info: a #GFileInfo.
18583 * @attribute: a file attribute key.
18584 * @attr_value: a UTF-8 string.
18586 * Sets the @attribute to contain the given @attr_value,
18592 * g_file_info_set_attribute_stringv:
18593 * @info: a #GFileInfo.
18594 * @attribute: a file attribute key
18595 * @attr_value: (array) (element-type utf8): a %NULL terminated array of UTF-8 strings.
18597 * Sets the @attribute to contain the given @attr_value,
18605 * g_file_info_set_attribute_uint32:
18606 * @info: a #GFileInfo.
18607 * @attribute: a file attribute key.
18608 * @attr_value: an unsigned 32-bit integer.
18610 * Sets the @attribute to contain the given @attr_value,
18616 * g_file_info_set_attribute_uint64:
18617 * @info: a #GFileInfo.
18618 * @attribute: a file attribute key.
18619 * @attr_value: an unsigned 64-bit integer.
18621 * Sets the @attribute to contain the given @attr_value,
18627 * g_file_info_set_content_type:
18628 * @info: a #GFileInfo.
18629 * @content_type: a content type. See <link linkend="gio-GContentType">GContentType</link>.
18631 * Sets the content type attribute for a given #GFileInfo.
18632 * See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
18637 * g_file_info_set_display_name:
18638 * @info: a #GFileInfo.
18639 * @display_name: a string containing a display name.
18641 * Sets the display name for the current #GFileInfo.
18642 * See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
18647 * g_file_info_set_edit_name:
18648 * @info: a #GFileInfo.
18649 * @edit_name: a string containing an edit name.
18651 * Sets the edit name for the current file.
18652 * See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
18657 * g_file_info_set_file_type:
18658 * @info: a #GFileInfo.
18659 * @type: a #GFileType.
18661 * Sets the file type in a #GFileInfo to @type.
18662 * See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
18667 * g_file_info_set_icon:
18668 * @info: a #GFileInfo.
18671 * Sets the icon for a given #GFileInfo.
18672 * See %G_FILE_ATTRIBUTE_STANDARD_ICON.
18677 * g_file_info_set_is_hidden:
18678 * @info: a #GFileInfo.
18679 * @is_hidden: a #gboolean.
18681 * Sets the "is_hidden" attribute in a #GFileInfo according to @is_symlink.
18682 * See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
18687 * g_file_info_set_is_symlink:
18688 * @info: a #GFileInfo.
18689 * @is_symlink: a #gboolean.
18691 * Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
18692 * See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
18697 * g_file_info_set_modification_time:
18698 * @info: a #GFileInfo.
18699 * @mtime: a #GTimeVal.
18701 * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
18702 * info to the given time value.
18707 * g_file_info_set_name:
18708 * @info: a #GFileInfo.
18709 * @name: a string containing a name.
18711 * Sets the name attribute for the current #GFileInfo.
18712 * See %G_FILE_ATTRIBUTE_STANDARD_NAME.
18717 * g_file_info_set_size:
18718 * @info: a #GFileInfo.
18719 * @size: a #goffset containing the file's size.
18721 * Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info
18722 * to the given size.
18727 * g_file_info_set_sort_order:
18728 * @info: a #GFileInfo.
18729 * @sort_order: a sort order integer.
18731 * Sets the sort order attribute in the file info structure. See
18732 * %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
18737 * g_file_info_set_symlink_target:
18738 * @info: a #GFileInfo.
18739 * @symlink_target: a static string containing a path to a symlink target.
18741 * Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
18742 * to the given symlink target.
18747 * g_file_info_unset_attribute_mask:
18748 * @info: #GFileInfo.
18750 * Unsets a mask set by g_file_info_set_attribute_mask(), if one
18756 * g_file_input_stream_query_info:
18757 * @stream: a #GFileInputStream.
18758 * @attributes: a file attribute query string.
18759 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18760 * @error: a #GError location to store the error occurring, or %NULL to ignore.
18762 * Queries a file input stream the given @attributes. This function blocks
18763 * while querying the stream. For the asynchronous (non-blocking) version
18764 * of this function, see g_file_input_stream_query_info_async(). While the
18765 * stream is blocked, the stream will set the pending flag internally, and
18766 * any other operations on the stream will fail with %G_IO_ERROR_PENDING.
18768 * Returns: (transfer full): a #GFileInfo, or %NULL on error.
18773 * g_file_input_stream_query_info_async:
18774 * @stream: a #GFileInputStream.
18775 * @attributes: a file attribute query string.
18776 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
18777 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18778 * @callback: (scope async): callback to call when the request is satisfied
18779 * @user_data: (closure): the data to pass to callback function
18781 * Queries the stream information asynchronously.
18782 * When the operation is finished @callback will be called.
18783 * You can then call g_file_input_stream_query_info_finish()
18784 * to get the result of the operation.
18786 * For the synchronous version of this function,
18787 * see g_file_input_stream_query_info().
18789 * If @cancellable is not %NULL, then the operation can be cancelled by
18790 * triggering the cancellable object from another thread. If the operation
18791 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set
18796 * g_file_input_stream_query_info_finish:
18797 * @stream: a #GFileInputStream.
18798 * @result: a #GAsyncResult.
18799 * @error: a #GError location to store the error occurring, or %NULL to ignore.
18801 * Finishes an asynchronous info query operation.
18803 * Returns: (transfer full): #GFileInfo.
18808 * g_file_io_stream_get_etag:
18809 * @stream: a #GFileIOStream.
18811 * Gets the entity tag for the file when it has been written.
18812 * This must be called after the stream has been written
18813 * and closed, as the etag can change while writing.
18815 * Returns: the entity tag for the stream.
18821 * g_file_io_stream_query_info:
18822 * @stream: a #GFileIOStream.
18823 * @attributes: a file attribute query string.
18824 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18825 * @error: a #GError, %NULL to ignore.
18827 * Queries a file io stream for the given @attributes.
18828 * This function blocks while querying the stream. For the asynchronous
18829 * version of this function, see g_file_io_stream_query_info_async().
18830 * While the stream is blocked, the stream will set the pending flag
18831 * internally, and any other operations on the stream will fail with
18832 * %G_IO_ERROR_PENDING.
18834 * Can fail if the stream was already closed (with @error being set to
18835 * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
18836 * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
18837 * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). I
18838 * all cases of failure, %NULL will be returned.
18840 * If @cancellable is not %NULL, then the operation can be cancelled by
18841 * triggering the cancellable object from another thread. If the operation
18842 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
18845 * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
18851 * g_file_io_stream_query_info_async:
18852 * @stream: a #GFileIOStream.
18853 * @attributes: a file attribute query string.
18854 * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
18855 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18856 * @callback: (scope async): callback to call when the request is satisfied
18857 * @user_data: (closure): the data to pass to callback function
18859 * Asynchronously queries the @stream for a #GFileInfo. When completed,
18860 * @callback will be called with a #GAsyncResult which can be used to
18861 * finish the operation with g_file_io_stream_query_info_finish().
18863 * For the synchronous version of this function, see
18864 * g_file_io_stream_query_info().
18871 * g_file_io_stream_query_info_finish:
18872 * @stream: a #GFileIOStream.
18873 * @result: a #GAsyncResult.
18874 * @error: a #GError, %NULL to ignore.
18876 * Finalizes the asynchronous query started
18877 * by g_file_io_stream_query_info_async().
18879 * Returns: (transfer full): A #GFileInfo for the finished query.
18885 * g_file_is_native:
18886 * @file: input #GFile.
18888 * Checks to see if a file is native to the platform.
18890 * A native file s one expressed in the platform-native filename format,
18891 * e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
18892 * as it might be on a locally mounted remote filesystem.
18894 * On some systems non-native files may be available using
18895 * the native filesystem via a userspace filesystem (FUSE), in
18896 * these cases this call will return %FALSE, but g_file_get_path()
18897 * will still return a native path.
18899 * This call does no blocking i/o.
18901 * Returns: %TRUE if file is native.
18906 * g_file_load_contents:
18907 * @file: input #GFile.
18908 * @cancellable: optional #GCancellable object, %NULL to ignore.
18909 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file.
18910 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
18911 * @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
18912 * @error: a #GError, or %NULL
18914 * Loads the content of the file into memory. The data is always
18915 * zero-terminated, but this is not included in the resultant @length.
18916 * The returned @content should be freed with g_free() when no longer
18919 * If @cancellable is not %NULL, then the operation can be cancelled by
18920 * triggering the cancellable object from another thread. If the operation
18921 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18923 * Returns: %TRUE if the @file's contents were successfully loaded. %FALSE if there were errors.
18928 * g_file_load_contents_async:
18929 * @file: input #GFile.
18930 * @cancellable: optional #GCancellable object, %NULL to ignore.
18931 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
18932 * @user_data: the data to pass to callback function
18934 * Starts an asynchronous load of the @file's contents.
18936 * For more details, see g_file_load_contents() which is
18937 * the synchronous version of this call.
18939 * When the load operation has completed, @callback will be called
18940 * with @user data. To finish the operation, call
18941 * g_file_load_contents_finish() with the #GAsyncResult returned by
18944 * If @cancellable is not %NULL, then the operation can be cancelled by
18945 * triggering the cancellable object from another thread. If the operation
18946 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18951 * g_file_load_contents_finish:
18952 * @file: input #GFile.
18953 * @res: a #GAsyncResult.
18954 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file.
18955 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
18956 * @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
18957 * @error: a #GError, or %NULL
18959 * Finishes an asynchronous load of the @file's contents.
18960 * The contents are placed in @contents, and @length is set to the
18961 * size of the @contents string. The @content should be freed with
18962 * g_free() when no longer needed. If @etag_out is present, it will be
18963 * set to the new entity tag for the @file.
18965 * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
18970 * g_file_load_partial_contents_async: (skip)
18971 * @file: input #GFile.
18972 * @cancellable: optional #GCancellable object, %NULL to ignore.
18973 * @read_more_callback: a #GFileReadMoreCallback to receive partial data and to specify whether further data should be read.
18974 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
18975 * @user_data: the data to pass to the callback functions.
18977 * Reads the partial contents of a file. A #GFileReadMoreCallback should be
18978 * used to stop reading from the file when appropriate, else this function
18979 * will behave exactly as g_file_load_contents_async(). This operation
18980 * can be finished by g_file_load_partial_contents_finish().
18982 * Users of this function should be aware that @user_data is passed to
18983 * both the @read_more_callback and the @callback.
18985 * If @cancellable is not %NULL, then the operation can be cancelled by
18986 * triggering the cancellable object from another thread. If the operation
18987 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18992 * g_file_load_partial_contents_finish:
18993 * @file: input #GFile.
18994 * @res: a #GAsyncResult.
18995 * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file.
18996 * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
18997 * @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
18998 * @error: a #GError, or %NULL
19000 * Finishes an asynchronous partial load operation that was started
19001 * with g_file_load_partial_contents_async(). The data is always
19002 * zero-terminated, but this is not included in the resultant @length.
19003 * The returned @content should be freed with g_free() when no longer
19006 * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
19011 * g_file_make_directory:
19012 * @file: input #GFile.
19013 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19014 * @error: a #GError, or %NULL
19016 * Creates a directory. Note that this will only create a child directory of
19017 * the immediate parent directory of the path or URI given by the #GFile. To
19018 * recursively create directories, see g_file_make_directory_with_parents().
19019 * This function will fail if the parent directory does not exist, setting
19020 * @error to %G_IO_ERROR_NOT_FOUND. If the file system doesn't support creating
19021 * directories, this function will fail, setting @error to
19022 * %G_IO_ERROR_NOT_SUPPORTED.
19024 * For a local #GFile the newly created directory will have the default
19025 * (current) ownership and permissions of the current process.
19027 * If @cancellable is not %NULL, then the operation can be cancelled by
19028 * triggering the cancellable object from another thread. If the operation
19029 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19031 * Returns: %TRUE on successful creation, %FALSE otherwise.
19036 * g_file_make_directory_with_parents:
19037 * @file: input #GFile.
19038 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19039 * @error: a #GError, or %NULL
19041 * Creates a directory and any parent directories that may not exist similar to
19042 * 'mkdir -p'. If the file system does not support creating directories, this
19043 * function will fail, setting @error to %G_IO_ERROR_NOT_SUPPORTED. If the
19044 * directory itself already exists, this function will fail setting @error
19045 * to %G_IO_ERROR_EXISTS, unlike the similar g_mkdir_with_parents().
19047 * For a local #GFile the newly created directories will have the default
19048 * (current) ownership and permissions of the current process.
19050 * If @cancellable is not %NULL, then the operation can be cancelled by
19051 * triggering the cancellable object from another thread. If the operation
19052 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19054 * Returns: %TRUE if all directories have been successfully created, %FALSE otherwise.
19060 * g_file_make_symbolic_link:
19061 * @file: a #GFile with the name of the symlink to create
19062 * @symlink_value: a string with the path for the target of the new symlink
19063 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19064 * @error: a #GError.
19066 * Creates a symbolic link named @file which contains the string
19069 * If @cancellable is not %NULL, then the operation can be cancelled by
19070 * triggering the cancellable object from another thread. If the operation
19071 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19073 * Returns: %TRUE on the creation of a new symlink, %FALSE otherwise.
19079 * @file: input #GFile
19080 * @flags: a set of #GFileMonitorFlags
19081 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19082 * @error: a #GError, or %NULL
19084 * Obtains a file or directory monitor for the given file, depending
19085 * on the type of the file.
19087 * If @cancellable is not %NULL, then the operation can be cancelled by
19088 * triggering the cancellable object from another thread. If the operation
19089 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19091 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19097 * g_file_monitor_cancel:
19098 * @monitor: a #GFileMonitor.
19100 * Cancels a file monitor.
19102 * Returns: %TRUE if monitor was cancelled.
19107 * g_file_monitor_directory:
19108 * @file: input #GFile.
19109 * @flags: a set of #GFileMonitorFlags.
19110 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19111 * @error: a #GError, or %NULL.
19113 * Obtains a directory monitor for the given file.
19114 * This may fail if directory monitoring is not supported.
19116 * If @cancellable is not %NULL, then the operation can be cancelled by
19117 * triggering the cancellable object from another thread. If the operation
19118 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19120 * Virtual: monitor_dir
19121 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19126 * g_file_monitor_emit_event:
19127 * @monitor: a #GFileMonitor.
19128 * @child: a #GFile.
19129 * @other_file: a #GFile.
19130 * @event_type: a set of #GFileMonitorEvent flags.
19132 * Emits the #GFileMonitor::changed signal if a change
19133 * has taken place. Should be called from file monitor
19134 * implementations only.
19136 * The signal will be emitted from an idle handler (in the <link
19137 * linkend="g-main-context-push-thread-default">thread-default main
19143 * g_file_monitor_file:
19144 * @file: input #GFile.
19145 * @flags: a set of #GFileMonitorFlags.
19146 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19147 * @error: a #GError, or %NULL.
19149 * Obtains a file monitor for the given file. If no file notification
19150 * mechanism exists, then regular polling of the file is used.
19152 * If @cancellable is not %NULL, then the operation can be cancelled by
19153 * triggering the cancellable object from another thread. If the operation
19154 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19156 * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19161 * g_file_monitor_is_cancelled:
19162 * @monitor: a #GFileMonitor
19164 * Returns whether the monitor is canceled.
19166 * Returns: %TRUE if monitor is canceled. %FALSE otherwise.
19171 * g_file_monitor_set_rate_limit:
19172 * @monitor: a #GFileMonitor.
19173 * @limit_msecs: a non-negative integer with the limit in milliseconds to poll for changes
19175 * Sets the rate limit to which the @monitor will report
19176 * consecutive change events to the same file.
19181 * g_file_mount_enclosing_volume:
19182 * @location: input #GFile.
19183 * @flags: flags affecting the operation
19184 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
19185 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19186 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
19187 * @user_data: the data to pass to callback function
19189 * Starts a @mount_operation, mounting the volume that contains the file @location.
19191 * When this operation has completed, @callback will be called with
19192 * @user_user data, and the operation can be finalized with
19193 * g_file_mount_enclosing_volume_finish().
19195 * If @cancellable is not %NULL, then the operation can be cancelled by
19196 * triggering the cancellable object from another thread. If the operation
19197 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19202 * g_file_mount_enclosing_volume_finish:
19203 * @location: input #GFile.
19204 * @result: a #GAsyncResult.
19205 * @error: a #GError, or %NULL
19207 * Finishes a mount operation started by g_file_mount_enclosing_volume().
19209 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
19214 * g_file_mount_mountable:
19215 * @file: input #GFile.
19216 * @flags: flags affecting the operation
19217 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
19218 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19219 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
19220 * @user_data: (closure): the data to pass to callback function
19222 * Mounts a file of type G_FILE_TYPE_MOUNTABLE.
19223 * Using @mount_operation, you can request callbacks when, for instance,
19224 * passwords are needed during authentication.
19226 * If @cancellable is not %NULL, then the operation can be cancelled by
19227 * triggering the cancellable object from another thread. If the operation
19228 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19230 * When the operation is finished, @callback will be called. You can then call
19231 * g_file_mount_mountable_finish() to get the result of the operation.
19236 * g_file_mount_mountable_finish:
19237 * @file: input #GFile.
19238 * @result: a #GAsyncResult.
19239 * @error: a #GError, or %NULL
19241 * Finishes a mount operation. See g_file_mount_mountable() for details.
19243 * Finish an asynchronous mount operation that was started
19244 * with g_file_mount_mountable().
19246 * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
19252 * @source: #GFile pointing to the source location.
19253 * @destination: #GFile pointing to the destination location.
19254 * @flags: set of #GFileCopyFlags.
19255 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19256 * @progress_callback: (allow-none) (scope call): #GFileProgressCallback function for updates.
19257 * @progress_callback_data: (closure): gpointer to user data for the callback function.
19258 * @error: #GError for returning error conditions, or %NULL
19260 * Tries to move the file or directory @source to the location specified by @destination.
19261 * If native move operations are supported then this is used, otherwise a copy + delete
19262 * fallback is used. The native implementation may support moving directories (for instance
19263 * on moves inside the same filesystem), but the fallback code does not.
19265 * If the flag #G_FILE_COPY_OVERWRITE is specified an already
19266 * existing @destination file is overwritten.
19268 * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
19269 * will be copied as symlinks, otherwise the target of the
19270 * @source symlink will be copied.
19272 * If @cancellable is not %NULL, then the operation can be cancelled by
19273 * triggering the cancellable object from another thread. If the operation
19274 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19276 * If @progress_callback is not %NULL, then the operation can be monitored by
19277 * setting this to a #GFileProgressCallback function. @progress_callback_data
19278 * will be passed to this function. It is guaranteed that this callback will
19279 * be called after all data has been transferred with the total number of bytes
19280 * copied during the operation.
19282 * If the @source file does not exist then the G_IO_ERROR_NOT_FOUND
19283 * error is returned, independent on the status of the @destination.
19285 * If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then the
19286 * error G_IO_ERROR_EXISTS is returned.
19288 * If trying to overwrite a file over a directory the G_IO_ERROR_IS_DIRECTORY
19289 * error is returned. If trying to overwrite a directory with a directory the
19290 * G_IO_ERROR_WOULD_MERGE error is returned.
19292 * If the source is a directory and the target does not exist, or #G_FILE_COPY_OVERWRITE is
19293 * specified and the target is a file, then the G_IO_ERROR_WOULD_RECURSE error
19294 * may be returned (if the native move operation isn't available).
19296 * Returns: %TRUE on successful move, %FALSE otherwise.
19301 * g_file_new_for_commandline_arg:
19302 * @arg: a command line string.
19304 * Creates a #GFile with the given argument from the command line. The value of
19305 * @arg can be either a URI, an absolute path or a relative path resolved
19306 * relative to the current working directory.
19307 * This operation never fails, but the returned object might not support any
19308 * I/O operation if @arg points to a malformed path.
19310 * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
19315 * g_file_new_for_path:
19316 * @path: a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
19318 * Constructs a #GFile for a given path. This operation never
19319 * fails, but the returned object might not support any I/O
19320 * operation if @path is malformed.
19322 * Returns: (transfer full): a new #GFile for the given @path. Free the returned object with g_object_unref().
19327 * g_file_new_for_uri:
19328 * @uri: a UTF8 string containing a URI.
19330 * Constructs a #GFile for a given URI. This operation never
19331 * fails, but the returned object might not support any I/O
19332 * operation if @uri is malformed or if the uri type is
19335 * Returns: (transfer full): a new #GFile for the given @uri. Free the returned object with g_object_unref().
19341 * @tmpl: (type filename) (allow-none): Template for the file name, as in g_file_open_tmp(), or %NULL for a default template.
19342 * @iostream: (out): on return, a #GFileIOStream for the created file.
19343 * @error: a #GError, or %NULL
19345 * Opens a file in the preferred directory for temporary files (as
19346 * returned by g_get_tmp_dir()) and returns a #GFile and
19347 * #GFileIOStream pointing to it.
19349 * @tmpl should be a string in the GLib file name encoding
19350 * containing a sequence of six 'X' characters, and containing no
19351 * directory components. If it is %NULL, a default template is used.
19353 * Unlike the other #GFile constructors, this will return %NULL if
19354 * a temporary file could not be created.
19356 * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
19362 * g_file_open_readwrite:
19363 * @file: #GFile to open
19364 * @cancellable: (allow-none): a #GCancellable
19365 * @error: a #GError, or %NULL
19367 * Opens an existing file for reading and writing. The result is
19368 * a #GFileIOStream that can be used to read and write the contents of the file.
19370 * If @cancellable is not %NULL, then the operation can be cancelled by
19371 * triggering the cancellable object from another thread. If the operation
19372 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19374 * If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
19375 * If the file is a directory, the G_IO_ERROR_IS_DIRECTORY error will be returned.
19376 * Other errors are possible too, and depend on what kind of filesystem the file is on.
19377 * Note that in many non-local file cases read and write streams are not supported,
19378 * so make sure you really need to do read and write streaming, rather than
19379 * just opening for reading or writing.
19381 * Returns: (transfer full): #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19387 * g_file_open_readwrite_async:
19388 * @file: input #GFile.
19389 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
19390 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19391 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19392 * @user_data: (closure): the data to pass to callback function
19394 * Asynchronously opens @file for reading and writing.
19396 * For more details, see g_file_open_readwrite() which is
19397 * the synchronous version of this call.
19399 * When the operation is finished, @callback will be called. You can then call
19400 * g_file_open_readwrite_finish() to get the result of the operation.
19407 * g_file_open_readwrite_finish:
19408 * @file: input #GFile.
19409 * @res: a #GAsyncResult.
19410 * @error: a #GError, or %NULL
19412 * Finishes an asynchronous file read operation started with
19413 * g_file_open_readwrite_async().
19415 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19421 * g_file_output_stream_get_etag:
19422 * @stream: a #GFileOutputStream.
19424 * Gets the entity tag for the file when it has been written.
19425 * This must be called after the stream has been written
19426 * and closed, as the etag can change while writing.
19428 * Returns: the entity tag for the stream.
19433 * g_file_output_stream_query_info:
19434 * @stream: a #GFileOutputStream.
19435 * @attributes: a file attribute query string.
19436 * @cancellable: optional #GCancellable object, %NULL to ignore.
19437 * @error: a #GError, %NULL to ignore.
19439 * Queries a file output stream for the given @attributes.
19440 * This function blocks while querying the stream. For the asynchronous
19441 * version of this function, see g_file_output_stream_query_info_async().
19442 * While the stream is blocked, the stream will set the pending flag
19443 * internally, and any other operations on the stream will fail with
19444 * %G_IO_ERROR_PENDING.
19446 * Can fail if the stream was already closed (with @error being set to
19447 * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
19448 * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
19449 * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). In
19450 * all cases of failure, %NULL will be returned.
19452 * If @cancellable is not %NULL, then the operation can be cancelled by
19453 * triggering the cancellable object from another thread. If the operation
19454 * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
19457 * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
19462 * g_file_output_stream_query_info_async:
19463 * @stream: a #GFileOutputStream.
19464 * @attributes: a file attribute query string.
19465 * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
19466 * @cancellable: optional #GCancellable object, %NULL to ignore.
19467 * @callback: callback to call when the request is satisfied
19468 * @user_data: the data to pass to callback function
19470 * Asynchronously queries the @stream for a #GFileInfo. When completed,
19471 * @callback will be called with a #GAsyncResult which can be used to
19472 * finish the operation with g_file_output_stream_query_info_finish().
19474 * For the synchronous version of this function, see
19475 * g_file_output_stream_query_info().
19480 * g_file_output_stream_query_info_finish:
19481 * @stream: a #GFileOutputStream.
19482 * @result: a #GAsyncResult.
19483 * @error: a #GError, %NULL to ignore.
19485 * Finalizes the asynchronous query started
19486 * by g_file_output_stream_query_info_async().
19488 * Returns: (transfer full): A #GFileInfo for the finished query.
19493 * g_file_parse_name:
19494 * @parse_name: a file name or path to be parsed.
19496 * Constructs a #GFile with the given @parse_name (i.e. something given by g_file_get_parse_name()).
19497 * This operation never fails, but the returned object might not support any I/O
19498 * operation if the @parse_name cannot be parsed.
19500 * Returns: (transfer full): a new #GFile.
19505 * g_file_poll_mountable:
19506 * @file: input #GFile.
19507 * @cancellable: optional #GCancellable object, %NULL to ignore.
19508 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
19509 * @user_data: the data to pass to callback function
19511 * Polls a file of type G_FILE_TYPE_MOUNTABLE.
19513 * If @cancellable is not %NULL, then the operation can be cancelled by
19514 * triggering the cancellable object from another thread. If the operation
19515 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19517 * When the operation is finished, @callback will be called. You can then call
19518 * g_file_mount_mountable_finish() to get the result of the operation.
19525 * g_file_poll_mountable_finish:
19526 * @file: input #GFile.
19527 * @result: a #GAsyncResult.
19528 * @error: a #GError, or %NULL
19530 * Finishes a poll operation. See g_file_poll_mountable() for details.
19532 * Finish an asynchronous poll operation that was polled
19533 * with g_file_poll_mountable().
19535 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
19541 * g_file_query_default_handler:
19542 * @file: a #GFile to open.
19543 * @cancellable: optional #GCancellable object, %NULL to ignore.
19544 * @error: a #GError, or %NULL
19546 * Returns the #GAppInfo that is registered as the default
19547 * application to handle the file specified by @file.
19549 * If @cancellable is not %NULL, then the operation can be cancelled by
19550 * triggering the cancellable object from another thread. If the operation
19551 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19553 * 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()
19558 * g_file_query_exists:
19559 * @file: input #GFile.
19560 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19562 * Utility function to check if a particular file exists. This is
19563 * implemented using g_file_query_info() and as such does blocking I/O.
19565 * Note that in many cases it is racy to first check for file existence
19566 * and then execute something based on the outcome of that, because the
19567 * file might have been created or removed in between the operations. The
19568 * general approach to handling that is to not check, but just do the
19569 * operation and handle the errors as they come.
19571 * As an example of race-free checking, take the case of reading a file, and
19572 * if it doesn't exist, creating it. There are two racy versions: read it, and
19573 * on error create it; and: check if it exists, if not create it. These
19574 * can both result in two processes creating the file (with perhaps a partially
19575 * written file as the result). The correct approach is to always try to create
19576 * the file with g_file_create() which will either atomically create the file
19577 * or fail with a G_IO_ERROR_EXISTS error.
19579 * However, in many cases an existence check is useful in a user
19580 * interface, for instance to make a menu item sensitive/insensitive, so that
19581 * you don't have to fool users that something is possible and then just show
19582 * and error dialog. If you do this, you should make sure to also handle the
19583 * errors that can happen due to races when you execute the operation.
19585 * Returns: %TRUE if the file exists (and can be detected without error), %FALSE otherwise (or if cancelled).
19590 * g_file_query_file_type:
19591 * @file: input #GFile.
19592 * @flags: a set of #GFileQueryInfoFlags passed to g_file_query_info().
19593 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19595 * Utility function to inspect the #GFileType of a file. This is
19596 * implemented using g_file_query_info() and as such does blocking I/O.
19598 * The primary use case of this method is to check if a file is a regular file,
19599 * directory, or symlink.
19601 * Returns: The #GFileType of the file and #G_FILE_TYPE_UNKNOWN if the file does not exist
19607 * g_file_query_filesystem_info:
19608 * @file: input #GFile.
19609 * @attributes: an attribute query string.
19610 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19611 * @error: a #GError.
19613 * Similar to g_file_query_info(), but obtains information
19614 * about the filesystem the @file is on, rather than the file itself.
19615 * For instance the amount of space available and the type of
19618 * The @attributes value is a string that specifies the file attributes that
19619 * should be gathered. It is not an error if it's not possible to read a particular
19620 * requested attribute from a file - it just won't be set. @attributes should
19621 * be a comma-separated list of attributes or attribute wildcards. The wildcard "*"
19622 * means all attributes, and a wildcard like "filesystem::*" means all attributes in the
19623 * filesystem namespace. The standard namespace for filesystem attributes is "filesystem".
19624 * Common attributes of interest are #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE
19625 * (the total size of the filesystem in bytes), #G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of
19626 * bytes available), and #G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
19628 * If @cancellable is not %NULL, then the operation can be cancelled by
19629 * triggering the cancellable object from another thread. If the operation
19630 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19632 * If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
19633 * Other errors are possible too, and depend on what kind of filesystem the file is on.
19635 * Returns: (transfer full): a #GFileInfo or %NULL if there was an error. Free the returned object with g_object_unref().
19640 * g_file_query_filesystem_info_async:
19641 * @file: input #GFile.
19642 * @attributes: an attribute query string.
19643 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
19644 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19645 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19646 * @user_data: (closure): the data to pass to callback function
19648 * Asynchronously gets the requested information about the filesystem
19649 * that the specified @file is on. The result is a #GFileInfo object
19650 * that contains key-value attributes (such as type or size for the
19653 * For more details, see g_file_query_filesystem_info() which is the
19654 * synchronous version of this call.
19656 * When the operation is finished, @callback will be called. You can
19657 * then call g_file_query_info_finish() to get the result of the
19663 * g_file_query_filesystem_info_finish:
19664 * @file: input #GFile.
19665 * @res: a #GAsyncResult.
19666 * @error: a #GError.
19668 * Finishes an asynchronous filesystem info query. See
19669 * g_file_query_filesystem_info_async().
19671 * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
19676 * g_file_query_info:
19677 * @file: input #GFile.
19678 * @attributes: an attribute query string.
19679 * @flags: a set of #GFileQueryInfoFlags.
19680 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19681 * @error: a #GError.
19683 * Gets the requested information about specified @file. The result
19684 * is a #GFileInfo object that contains key-value attributes (such as
19685 * the type or size of the file).
19687 * The @attributes value is a string that specifies the file attributes that
19688 * should be gathered. It is not an error if it's not possible to read a particular
19689 * requested attribute from a file - it just won't be set. @attributes should
19690 * be a comma-separated list of attributes or attribute wildcards. The wildcard "*"
19691 * means all attributes, and a wildcard like "standard::*" means all attributes in the standard
19692 * namespace. An example attribute query be "standard::*,owner::user".
19693 * The standard attributes are available as defines, like #G_FILE_ATTRIBUTE_STANDARD_NAME.
19695 * If @cancellable is not %NULL, then the operation can be cancelled by
19696 * triggering the cancellable object from another thread. If the operation
19697 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19699 * For symlinks, normally the information about the target of the
19700 * symlink is returned, rather than information about the symlink itself.
19701 * However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS in @flags the
19702 * information about the symlink itself will be returned. Also, for symlinks
19703 * that point to non-existing files the information about the symlink itself
19704 * will be returned.
19706 * If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
19707 * Other errors are possible too, and depend on what kind of filesystem the file is on.
19709 * Returns: (transfer full): a #GFileInfo for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19714 * g_file_query_info_async:
19715 * @file: input #GFile.
19716 * @attributes: an attribute query string.
19717 * @flags: a set of #GFileQueryInfoFlags.
19718 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
19719 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19720 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19721 * @user_data: (closure): the data to pass to callback function
19723 * Asynchronously gets the requested information about specified @file. The result
19724 * is a #GFileInfo object that contains key-value attributes (such as type or size
19727 * For more details, see g_file_query_info() which is
19728 * the synchronous version of this call.
19730 * When the operation is finished, @callback will be called. You can then call
19731 * g_file_query_info_finish() to get the result of the operation.
19736 * g_file_query_info_finish:
19737 * @file: input #GFile.
19738 * @res: a #GAsyncResult.
19739 * @error: a #GError.
19741 * Finishes an asynchronous file info query.
19742 * See g_file_query_info_async().
19744 * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
19749 * g_file_query_settable_attributes:
19750 * @file: input #GFile.
19751 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19752 * @error: a #GError, or %NULL
19754 * Obtain the list of settable attributes for the file.
19756 * Returns the type and full attribute name of all the attributes
19757 * that can be set on this file. This doesn't mean setting it will always
19758 * succeed though, you might get an access failure, or some specific
19759 * file may not support a specific attribute.
19761 * If @cancellable is not %NULL, then the operation can be cancelled by
19762 * triggering the cancellable object from another thread. If the operation
19763 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19765 * Returns: a #GFileAttributeInfoList describing the settable attributes. When you are done with it, release it with g_file_attribute_info_list_unref()
19770 * g_file_query_writable_namespaces:
19771 * @file: input #GFile.
19772 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19773 * @error: a #GError, or %NULL
19775 * Obtain the list of attribute namespaces where new attributes
19776 * can be created by a user. An example of this is extended
19777 * attributes (in the "xattr" namespace).
19779 * If @cancellable is not %NULL, then the operation can be cancelled by
19780 * triggering the cancellable object from another thread. If the operation
19781 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19783 * Returns: a #GFileAttributeInfoList describing the writable namespaces. When you are done with it, release it with g_file_attribute_info_list_unref()
19789 * @file: #GFile to read.
19790 * @cancellable: (allow-none): a #GCancellable
19791 * @error: a #GError, or %NULL
19793 * Opens a file for reading. The result is a #GFileInputStream that
19794 * can be used to read the contents of the file.
19796 * If @cancellable is not %NULL, then the operation can be cancelled by
19797 * triggering the cancellable object from another thread. If the operation
19798 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19800 * If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
19801 * If the file is a directory, the G_IO_ERROR_IS_DIRECTORY error will be returned.
19802 * Other errors are possible too, and depend on what kind of filesystem the file is on.
19805 * Returns: (transfer full): #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
19810 * g_file_read_async:
19811 * @file: input #GFile
19812 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
19813 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19814 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19815 * @user_data: (closure): the data to pass to callback function
19817 * Asynchronously opens @file for reading.
19819 * For more details, see g_file_read() which is
19820 * the synchronous version of this call.
19822 * When the operation is finished, @callback will be called. You can then call
19823 * g_file_read_finish() to get the result of the operation.
19828 * g_file_read_finish:
19829 * @file: input #GFile.
19830 * @res: a #GAsyncResult.
19831 * @error: a #GError, or %NULL
19833 * Finishes an asynchronous file read operation started with
19834 * g_file_read_async().
19836 * Returns: (transfer full): a #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
19842 * @file: input #GFile.
19843 * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore.
19844 * @make_backup: %TRUE if a backup should be created.
19845 * @flags: a set of #GFileCreateFlags.
19846 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19847 * @error: a #GError, or %NULL
19849 * Returns an output stream for overwriting the file, possibly
19850 * creating a backup copy of the file first. If the file doesn't exist,
19851 * it will be created.
19853 * This will try to replace the file in the safest way possible so
19854 * that any errors during the writing will not affect an already
19855 * existing copy of the file. For instance, for local files it
19856 * may write to a temporary file and then atomically rename over
19857 * the destination when the stream is closed.
19859 * By default files created are generally readable by everyone,
19860 * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
19861 * will be made readable only to the current user, to the level that
19862 * is supported on the target filesystem.
19864 * If @cancellable is not %NULL, then the operation can be cancelled by
19865 * triggering the cancellable object from another thread. If the operation
19866 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19868 * If you pass in a non-#NULL @etag value, then this value is
19869 * compared to the current entity tag of the file, and if they differ
19870 * an G_IO_ERROR_WRONG_ETAG error is returned. This generally means
19871 * that the file has been changed since you last read it. You can get
19872 * the new etag from g_file_output_stream_get_etag() after you've
19873 * finished writing and closed the #GFileOutputStream. When you load
19874 * a new file you can use g_file_input_stream_query_info() to get
19875 * the etag of the file.
19877 * If @make_backup is %TRUE, this function will attempt to make a backup
19878 * of the current file before overwriting it. If this fails a G_IO_ERROR_CANT_CREATE_BACKUP
19879 * error will be returned. If you want to replace anyway, try again with
19880 * @make_backup set to %FALSE.
19882 * If the file is a directory the G_IO_ERROR_IS_DIRECTORY error will be returned,
19883 * and if the file is some other form of non-regular file then a
19884 * G_IO_ERROR_NOT_REGULAR_FILE error will be returned.
19885 * Some file systems don't allow all file names, and may
19886 * return an G_IO_ERROR_INVALID_FILENAME error, and if the name
19887 * is to long G_IO_ERROR_FILENAME_TOO_LONG will be returned.
19888 * Other errors are possible too, and depend on what kind of
19889 * filesystem the file is on.
19891 * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
19896 * g_file_replace_async:
19897 * @file: input #GFile.
19898 * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore.
19899 * @make_backup: %TRUE if a backup should be created.
19900 * @flags: a set of #GFileCreateFlags.
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 overwrites the file, replacing the contents, possibly
19907 * creating a backup copy of the file first.
19909 * For more details, see g_file_replace() which is
19910 * the synchronous version of this call.
19912 * When the operation is finished, @callback will be called. You can then call
19913 * g_file_replace_finish() to get the result of the operation.
19918 * g_file_replace_contents:
19919 * @file: input #GFile.
19920 * @contents: (element-type guint8) (array length=length): a string containing the new contents for @file.
19921 * @length: the length of @contents in bytes.
19922 * @etag: (allow-none): the old <link linkend="gfile-etag">entity tag</link> for the document, or %NULL
19923 * @make_backup: %TRUE if a backup should be created.
19924 * @flags: a set of #GFileCreateFlags.
19925 * @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
19926 * @cancellable: optional #GCancellable object, %NULL to ignore.
19927 * @error: a #GError, or %NULL
19929 * Replaces the contents of @file with @contents of @length bytes.
19931 * If @etag is specified (not %NULL) any existing file must have that etag, or
19932 * the error %G_IO_ERROR_WRONG_ETAG will be returned.
19934 * If @make_backup is %TRUE, this function will attempt to make a backup of @file.
19936 * If @cancellable is not %NULL, then the operation can be cancelled by
19937 * triggering the cancellable object from another thread. If the operation
19938 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19940 * The returned @new_etag can be used to verify that the file hasn't changed the
19941 * next time it is saved over.
19943 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
19948 * g_file_replace_contents_async:
19949 * @file: input #GFile.
19950 * @contents: (element-type guint8) (array length=length): string of contents to replace the file with.
19951 * @length: the length of @contents in bytes.
19952 * @etag: (allow-none): a new <link linkend="gfile-etag">entity tag</link> for the @file, or %NULL
19953 * @make_backup: %TRUE if a backup should be created.
19954 * @flags: a set of #GFileCreateFlags.
19955 * @cancellable: optional #GCancellable object, %NULL to ignore.
19956 * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19957 * @user_data: the data to pass to callback function
19959 * Starts an asynchronous replacement of @file with the given
19960 * @contents of @length bytes. @etag will replace the document's
19961 * current entity tag.
19963 * When this operation has completed, @callback will be called with
19964 * @user_user data, and the operation can be finalized with
19965 * g_file_replace_contents_finish().
19967 * If @cancellable is not %NULL, then the operation can be cancelled by
19968 * triggering the cancellable object from another thread. If the operation
19969 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19971 * If @make_backup is %TRUE, this function will attempt to
19972 * make a backup of @file.
19977 * g_file_replace_contents_finish:
19978 * @file: input #GFile.
19979 * @res: a #GAsyncResult.
19980 * @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
19981 * @error: a #GError, or %NULL
19983 * Finishes an asynchronous replace of the given @file. See
19984 * g_file_replace_contents_async(). Sets @new_etag to the new entity
19985 * tag for the document, if present.
19987 * Returns: %TRUE on success, %FALSE on failure.
19992 * g_file_replace_finish:
19993 * @file: input #GFile.
19994 * @res: a #GAsyncResult.
19995 * @error: a #GError, or %NULL
19997 * Finishes an asynchronous file replace operation started with
19998 * g_file_replace_async().
20000 * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
20005 * g_file_replace_readwrite:
20007 * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
20008 * @make_backup: %TRUE if a backup should be created
20009 * @flags: a set of #GFileCreateFlags
20010 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20011 * @error: return location for a #GError, or %NULL
20013 * Returns an output stream for overwriting the file in readwrite mode,
20014 * possibly creating a backup copy of the file first. If the file doesn't
20015 * exist, it will be created.
20017 * For details about the behaviour, see g_file_replace() which does the same
20018 * thing but returns an output stream only.
20020 * Note that in many non-local file cases read and write streams are not
20021 * supported, so make sure you really need to do read and write streaming,
20022 * rather than just opening for reading or writing.
20024 * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
20030 * g_file_replace_readwrite_async:
20031 * @file: input #GFile.
20032 * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore.
20033 * @make_backup: %TRUE if a backup should be created.
20034 * @flags: a set of #GFileCreateFlags.
20035 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
20036 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20037 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20038 * @user_data: (closure): the data to pass to callback function
20040 * Asynchronously overwrites the file in read-write mode, replacing the
20041 * contents, possibly creating a backup copy of the file first.
20043 * For more details, see g_file_replace_readwrite() which is
20044 * the synchronous version of this call.
20046 * When the operation is finished, @callback will be called. You can then
20047 * call g_file_replace_readwrite_finish() to get the result of the operation.
20054 * g_file_replace_readwrite_finish:
20055 * @file: input #GFile.
20056 * @res: a #GAsyncResult.
20057 * @error: a #GError, or %NULL
20059 * Finishes an asynchronous file replace operation started with
20060 * g_file_replace_readwrite_async().
20062 * Returns: (transfer full): a #GFileIOStream, or %NULL on error. Free the returned object with g_object_unref().
20068 * g_file_resolve_relative_path:
20069 * @file: input #GFile.
20070 * @relative_path: a given relative path string.
20072 * Resolves a relative path for @file to an absolute path.
20074 * This call does no blocking i/o.
20076 * 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().
20081 * g_file_set_attribute:
20082 * @file: input #GFile.
20083 * @attribute: a string containing the attribute's name.
20084 * @type: The type of the attribute
20085 * @value_p: (allow-none): a pointer to the value (or the pointer itself if the type is a pointer type)
20086 * @flags: a set of #GFileQueryInfoFlags.
20087 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20088 * @error: a #GError, or %NULL
20090 * Sets an attribute in the file with attribute name @attribute to @value.
20092 * Some attributes can be unset by setting @attribute to
20093 * %G_FILE_ATTRIBUTE_TYPE_INVALID and @value_p to %NULL.
20095 * If @cancellable is not %NULL, then the operation can be cancelled by
20096 * triggering the cancellable object from another thread. If the operation
20097 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20099 * Returns: %TRUE if the attribute was set, %FALSE otherwise.
20104 * g_file_set_attribute_byte_string:
20105 * @file: input #GFile.
20106 * @attribute: a string containing the attribute's name.
20107 * @value: a string containing the attribute's new value.
20108 * @flags: a #GFileQueryInfoFlags.
20109 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20110 * @error: a #GError, or %NULL
20112 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value.
20113 * If @attribute is of a different type, this operation will fail,
20114 * returning %FALSE.
20116 * If @cancellable is not %NULL, then the operation can be cancelled by
20117 * triggering the cancellable object from another thread. If the operation
20118 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20120 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20125 * g_file_set_attribute_int32:
20126 * @file: input #GFile.
20127 * @attribute: a string containing the attribute's name.
20128 * @value: a #gint32 containing the attribute's new value.
20129 * @flags: a #GFileQueryInfoFlags.
20130 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20131 * @error: a #GError, or %NULL
20133 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value.
20134 * If @attribute is of a different type, this operation will fail.
20136 * If @cancellable is not %NULL, then the operation can be cancelled by
20137 * triggering the cancellable object from another thread. If the operation
20138 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20140 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20145 * g_file_set_attribute_int64:
20146 * @file: input #GFile.
20147 * @attribute: a string containing the attribute's name.
20148 * @value: a #guint64 containing the attribute's new value.
20149 * @flags: a #GFileQueryInfoFlags.
20150 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20151 * @error: a #GError, or %NULL
20153 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value.
20154 * If @attribute is of a different type, this operation will fail.
20156 * If @cancellable is not %NULL, then the operation can be cancelled by
20157 * triggering the cancellable object from another thread. If the operation
20158 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20160 * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20165 * g_file_set_attribute_string:
20166 * @file: input #GFile.
20167 * @attribute: a string containing the attribute's name.
20168 * @value: a string containing the attribute's value.
20169 * @flags: #GFileQueryInfoFlags.
20170 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20171 * @error: a #GError, or %NULL
20173 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value.
20174 * If @attribute is of a different type, this operation will fail.
20176 * If @cancellable is not %NULL, then the operation can be cancelled by
20177 * triggering the cancellable object from another thread. If the operation
20178 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20180 * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20185 * g_file_set_attribute_uint32:
20186 * @file: input #GFile.
20187 * @attribute: a string containing the attribute's name.
20188 * @value: a #guint32 containing the attribute's new value.
20189 * @flags: a #GFileQueryInfoFlags.
20190 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20191 * @error: a #GError, or %NULL
20193 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value.
20194 * If @attribute is of a different type, this operation will fail.
20196 * If @cancellable is not %NULL, then the operation can be cancelled by
20197 * triggering the cancellable object from another thread. If the operation
20198 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20200 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20205 * g_file_set_attribute_uint64:
20206 * @file: input #GFile.
20207 * @attribute: a string containing the attribute's name.
20208 * @value: a #guint64 containing the attribute's new value.
20209 * @flags: a #GFileQueryInfoFlags.
20210 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20211 * @error: a #GError, or %NULL
20213 * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value.
20214 * If @attribute is of a different type, this operation will fail.
20216 * If @cancellable is not %NULL, then the operation can be cancelled by
20217 * triggering the cancellable object from another thread. If the operation
20218 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20220 * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20225 * g_file_set_attributes_async:
20226 * @file: input #GFile.
20227 * @info: a #GFileInfo.
20228 * @flags: a #GFileQueryInfoFlags.
20229 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
20230 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20231 * @callback: (scope async): a #GAsyncReadyCallback.
20232 * @user_data: (closure): a #gpointer.
20234 * Asynchronously sets the attributes of @file with @info.
20236 * For more details, see g_file_set_attributes_from_info() which is
20237 * the synchronous version of this call.
20239 * When the operation is finished, @callback will be called. You can then call
20240 * g_file_set_attributes_finish() to get the result of the operation.
20245 * g_file_set_attributes_finish:
20246 * @file: input #GFile.
20247 * @result: a #GAsyncResult.
20248 * @info: (out) (transfer full): a #GFileInfo.
20249 * @error: a #GError, or %NULL
20251 * Finishes setting an attribute started in g_file_set_attributes_async().
20253 * Returns: %TRUE if the attributes were set correctly, %FALSE otherwise.
20258 * g_file_set_attributes_from_info:
20259 * @file: input #GFile.
20260 * @info: a #GFileInfo.
20261 * @flags: #GFileQueryInfoFlags
20262 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20263 * @error: a #GError, or %NULL
20265 * Tries to set all attributes in the #GFileInfo on the target values,
20266 * not stopping on the first error.
20268 * If there is any error during this operation then @error will be set to
20269 * the first error. Error on particular fields are flagged by setting
20270 * the "status" field in the attribute value to
20271 * %G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING, which means you can also detect
20274 * If @cancellable is not %NULL, then the operation can be cancelled by
20275 * triggering the cancellable object from another thread. If the operation
20276 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20278 * Returns: %TRUE if there was any error, %FALSE otherwise.
20283 * g_file_set_display_name:
20284 * @file: input #GFile.
20285 * @display_name: a string.
20286 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20287 * @error: a #GError, or %NULL
20289 * Renames @file to the specified display name.
20291 * The display name is converted from UTF8 to the correct encoding for the target
20292 * filesystem if possible and the @file is renamed to this.
20294 * If you want to implement a rename operation in the user interface the edit name
20295 * (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the initial value in the rename
20296 * widget, and then the result after editing should be passed to g_file_set_display_name().
20298 * On success the resulting converted filename is returned.
20300 * If @cancellable is not %NULL, then the operation can be cancelled by
20301 * triggering the cancellable object from another thread. If the operation
20302 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20304 * 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().
20309 * g_file_set_display_name_async:
20310 * @file: input #GFile.
20311 * @display_name: a string.
20312 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
20313 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20314 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20315 * @user_data: (closure): the data to pass to callback function
20317 * Asynchronously sets the display name for a given #GFile.
20319 * For more details, see g_file_set_display_name() which is
20320 * the synchronous version of this call.
20322 * When the operation is finished, @callback will be called. You can then call
20323 * g_file_set_display_name_finish() to get the result of the operation.
20328 * g_file_set_display_name_finish:
20329 * @file: input #GFile.
20330 * @res: a #GAsyncResult.
20331 * @error: a #GError, or %NULL
20333 * Finishes setting a display name started with
20334 * g_file_set_display_name_async().
20336 * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
20341 * g_file_start_mountable:
20342 * @file: input #GFile.
20343 * @flags: flags affecting the operation
20344 * @start_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
20345 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20346 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
20347 * @user_data: the data to pass to callback function
20349 * Starts a file of type G_FILE_TYPE_MOUNTABLE.
20350 * Using @start_operation, you can request callbacks when, for instance,
20351 * passwords are needed during authentication.
20353 * If @cancellable is not %NULL, then the operation can be cancelled by
20354 * triggering the cancellable object from another thread. If the operation
20355 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20357 * When the operation is finished, @callback will be called. You can then call
20358 * g_file_mount_mountable_finish() to get the result of the operation.
20365 * g_file_start_mountable_finish:
20366 * @file: input #GFile.
20367 * @result: a #GAsyncResult.
20368 * @error: a #GError, or %NULL
20370 * Finishes a start operation. See g_file_start_mountable() for details.
20372 * Finish an asynchronous start operation that was started
20373 * with g_file_start_mountable().
20375 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20381 * g_file_stop_mountable:
20382 * @file: input #GFile.
20383 * @flags: flags affecting the operation
20384 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
20385 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20386 * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
20387 * @user_data: the data to pass to callback function
20389 * Stops a file of type G_FILE_TYPE_MOUNTABLE.
20391 * If @cancellable is not %NULL, then the operation can be cancelled by
20392 * triggering the cancellable object from another thread. If the operation
20393 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20395 * When the operation is finished, @callback will be called. You can then call
20396 * g_file_stop_mountable_finish() to get the result of the operation.
20403 * g_file_stop_mountable_finish:
20404 * @file: input #GFile.
20405 * @result: a #GAsyncResult.
20406 * @error: a #GError, or %NULL
20408 * Finishes an stop operation, see g_file_stop_mountable() for details.
20410 * Finish an asynchronous stop operation that was started
20411 * with g_file_stop_mountable().
20413 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20419 * g_file_supports_thread_contexts:
20422 * Checks if @file supports <link
20423 * linkend="g-main-context-push-thread-default-context">thread-default
20424 * contexts</link>. If this returns %FALSE, you cannot perform
20425 * asynchronous operations on @file in a thread that has a
20426 * thread-default context.
20428 * Returns: Whether or not @file supports thread-default contexts.
20435 * @file: #GFile to send to trash.
20436 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20437 * @error: a #GError, or %NULL
20439 * Sends @file to the "Trashcan", if possible. This is similar to
20440 * deleting it, but the user can recover it before emptying the trashcan.
20441 * Not all file systems support trashing, so this call can return the
20442 * %G_IO_ERROR_NOT_SUPPORTED error.
20445 * If @cancellable is not %NULL, then the operation can be cancelled by
20446 * triggering the cancellable object from another thread. If the operation
20447 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20449 * Returns: %TRUE on successful trash, %FALSE otherwise.
20454 * g_file_unmount_mountable:
20455 * @file: input #GFile.
20456 * @flags: flags affecting the operation
20457 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20458 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
20459 * @user_data: (closure): the data to pass to callback function
20461 * Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
20463 * If @cancellable is not %NULL, then the operation can be cancelled by
20464 * triggering the cancellable object from another thread. If the operation
20465 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20467 * When the operation is finished, @callback will be called. You can then call
20468 * g_file_unmount_mountable_finish() to get the result of the operation.
20470 * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation() instead.
20475 * g_file_unmount_mountable_finish:
20476 * @file: input #GFile.
20477 * @result: a #GAsyncResult.
20478 * @error: a #GError, or %NULL
20480 * Finishes an unmount operation, see g_file_unmount_mountable() for details.
20482 * Finish an asynchronous unmount operation that was started
20483 * with g_file_unmount_mountable().
20485 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20486 * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation_finish() instead.
20491 * g_file_unmount_mountable_with_operation:
20492 * @file: input #GFile.
20493 * @flags: flags affecting the operation
20494 * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
20495 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20496 * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
20497 * @user_data: (closure): the data to pass to callback function
20499 * Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
20501 * If @cancellable is not %NULL, then the operation can be cancelled by
20502 * triggering the cancellable object from another thread. If the operation
20503 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20505 * When the operation is finished, @callback will be called. You can then call
20506 * g_file_unmount_mountable_finish() to get the result of the operation.
20513 * g_file_unmount_mountable_with_operation_finish:
20514 * @file: input #GFile.
20515 * @result: a #GAsyncResult.
20516 * @error: a #GError, or %NULL
20518 * Finishes an unmount operation, see g_file_unmount_mountable_with_operation() for details.
20520 * Finish an asynchronous unmount operation that was started
20521 * with g_file_unmount_mountable_with_operation().
20523 * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20529 * g_filename_completer_get_completion_suffix:
20530 * @completer: the filename completer.
20531 * @initial_text: text to be completed.
20533 * Obtains a completion for @initial_text from @completer.
20535 * 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.
20540 * g_filename_completer_get_completions:
20541 * @completer: the filename completer.
20542 * @initial_text: text to be completed.
20544 * Gets an array of completion strings for a given initial text.
20546 * 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.
20551 * g_filename_completer_new:
20553 * Creates a new filename completer.
20555 * Returns: a #GFilenameCompleter.
20560 * g_filename_completer_set_dirs_only:
20561 * @completer: the filename completer.
20562 * @dirs_only: a #gboolean.
20564 * If @dirs_only is %TRUE, @completer will only
20565 * complete directory names, and not file names.
20570 * g_filter_input_stream_get_base_stream:
20571 * @stream: a #GFilterInputStream.
20573 * Gets the base stream for the filter stream.
20575 * Returns: (transfer none): a #GInputStream.
20580 * g_filter_input_stream_get_close_base_stream:
20581 * @stream: a #GFilterInputStream.
20583 * Returns whether the base stream will be closed when @stream is
20586 * Returns: %TRUE if the base stream will be closed.
20591 * g_filter_input_stream_set_close_base_stream:
20592 * @stream: a #GFilterInputStream.
20593 * @close_base: %TRUE to close the base stream.
20595 * Sets whether the base stream will be closed when @stream is closed.
20600 * g_filter_output_stream_get_base_stream:
20601 * @stream: a #GFilterOutputStream.
20603 * Gets the base stream for the filter stream.
20605 * Returns: (transfer none): a #GOutputStream.
20610 * g_filter_output_stream_get_close_base_stream:
20611 * @stream: a #GFilterOutputStream.
20613 * Returns whether the base stream will be closed when @stream is
20616 * Returns: %TRUE if the base stream will be closed.
20621 * g_filter_output_stream_set_close_base_stream:
20622 * @stream: a #GFilterOutputStream.
20623 * @close_base: %TRUE to close the base stream.
20625 * Sets whether the base stream will be closed when @stream is closed.
20631 * @icon1: (allow-none): pointer to the first #GIcon.
20632 * @icon2: (allow-none): pointer to the second #GIcon.
20634 * Checks if two icons are equal.
20636 * Returns: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
20642 * @icon: #gconstpointer to an icon object.
20644 * Gets a hash for an icon.
20647 * Returns: a #guint containing a hash for the @icon, suitable for use in a #GHashTable or similar data structure.
20652 * g_icon_new_for_string:
20653 * @str: A string obtained via g_icon_to_string().
20654 * @error: Return location for error.
20656 * Generate a #GIcon instance from @str. This function can fail if
20657 * @str is not valid - see g_icon_to_string() for discussion.
20659 * If your application or library provides one or more #GIcon
20660 * implementations you need to ensure that each #GType is registered
20661 * with the type system prior to calling g_icon_new_for_string().
20663 * Returns: (transfer full): An object implementing the #GIcon interface or %NULL if @error is set.
20669 * g_icon_to_string:
20672 * Generates a textual representation of @icon that can be used for
20673 * serialization such as when passing @icon to a different process or
20674 * saving it to persistent storage. Use g_icon_new_for_string() to
20675 * get @icon back from the returned string.
20677 * The encoding of the returned string is proprietary to #GIcon except
20678 * in the following two cases
20682 * If @icon is a #GFileIcon, the returned string is a native path
20683 * (such as <literal>/path/to/my icon.png</literal>) without escaping
20684 * if the #GFile for @icon is a native file. If the file is not
20685 * native, the returned string is the result of g_file_get_uri()
20686 * (such as <literal>sftp://path/to/my%20icon.png</literal>).
20687 * </para></listitem>
20689 * If @icon is a #GThemedIcon with exactly one name, the encoding is
20690 * simply the name (such as <literal>network-server</literal>).
20691 * </para></listitem>
20694 * Virtual: to_tokens
20695 * Returns: An allocated NUL-terminated UTF8 string or %NULL if @icon can't be serialized. Use g_free() to free.
20701 * g_inet_address_equal:
20702 * @address: A #GInetAddress.
20703 * @other_address: Another #GInetAddress.
20705 * Checks if two #GInetAddress instances are equal, e.g. the same address.
20707 * Returns: %TRUE if @address and @other_address are equal, %FALSE otherwise.
20713 * g_inet_address_get_family:
20714 * @address: a #GInetAddress
20716 * Gets @address's family
20718 * Returns: @address's family
20724 * g_inet_address_get_is_any:
20725 * @address: a #GInetAddress
20727 * Tests whether @address is the "any" address for its family.
20729 * Returns: %TRUE if @address is the "any" address for its family.
20735 * g_inet_address_get_is_link_local:
20736 * @address: a #GInetAddress
20738 * Tests whether @address is a link-local address (that is, if it
20739 * identifies a host on a local network that is not connected to the
20742 * Returns: %TRUE if @address is a link-local address.
20748 * g_inet_address_get_is_loopback:
20749 * @address: a #GInetAddress
20751 * Tests whether @address is the loopback address for its family.
20753 * Returns: %TRUE if @address is the loopback address for its family.
20759 * g_inet_address_get_is_mc_global:
20760 * @address: a #GInetAddress
20762 * Tests whether @address is a global multicast address.
20764 * Returns: %TRUE if @address is a global multicast address.
20770 * g_inet_address_get_is_mc_link_local:
20771 * @address: a #GInetAddress
20773 * Tests whether @address is a link-local multicast address.
20775 * Returns: %TRUE if @address is a link-local multicast address.
20781 * g_inet_address_get_is_mc_node_local:
20782 * @address: a #GInetAddress
20784 * Tests whether @address is a node-local multicast address.
20786 * Returns: %TRUE if @address is a node-local multicast address.
20792 * g_inet_address_get_is_mc_org_local:
20793 * @address: a #GInetAddress
20795 * Tests whether @address is an organization-local multicast address.
20797 * Returns: %TRUE if @address is an organization-local multicast address.
20803 * g_inet_address_get_is_mc_site_local:
20804 * @address: a #GInetAddress
20806 * Tests whether @address is a site-local multicast address.
20808 * Returns: %TRUE if @address is a site-local multicast address.
20814 * g_inet_address_get_is_multicast:
20815 * @address: a #GInetAddress
20817 * Tests whether @address is a multicast address.
20819 * Returns: %TRUE if @address is a multicast address.
20825 * g_inet_address_get_is_site_local:
20826 * @address: a #GInetAddress
20828 * Tests whether @address is a site-local address such as 10.0.0.1
20829 * (that is, the address identifies a host on a local network that can
20830 * not be reached directly from the Internet, but which may have
20831 * outgoing Internet connectivity via a NAT or firewall).
20833 * Returns: %TRUE if @address is a site-local address.
20839 * g_inet_address_get_native_size:
20840 * @address: a #GInetAddress
20842 * Gets the size of the native raw binary address for @address. This
20843 * is the size of the data that you get from g_inet_address_to_bytes().
20845 * Returns: the number of bytes used for the native version of @address.
20851 * g_inet_address_mask_equal:
20852 * @mask: a #GInetAddressMask
20853 * @mask2: another #GInetAddressMask
20855 * Tests if @mask and @mask2 are the same mask.
20857 * Returns: whether @mask and @mask2 are the same mask
20863 * g_inet_address_mask_get_address:
20864 * @mask: a #GInetAddressMask
20866 * Gets @mask's base address
20868 * Returns: (transfer none): @mask's base address
20874 * g_inet_address_mask_get_family:
20875 * @mask: a #GInetAddressMask
20877 * Gets the #GSocketFamily of @mask's address
20879 * Returns: the #GSocketFamily of @mask's address
20885 * g_inet_address_mask_get_length:
20886 * @mask: a #GInetAddressMask
20888 * Gets @mask's length
20890 * Returns: @mask's length
20896 * g_inet_address_mask_matches:
20897 * @mask: a #GInetAddressMask
20898 * @address: a #GInetAddress
20900 * Tests if @address falls within the range described by @mask.
20902 * Returns: whether @address falls within the range described by @mask.
20908 * g_inet_address_mask_new:
20909 * @addr: a #GInetAddress
20910 * @length: number of bits of @addr to use
20911 * @error: return location for #GError, or %NULL
20913 * Creates a new #GInetAddressMask representing all addresses whose
20914 * first @length bits match @addr.
20916 * Returns: a new #GInetAddressMask, or %NULL on error
20922 * g_inet_address_mask_new_from_string:
20923 * @mask_string: an IP address or address/length string
20924 * @error: return location for #GError, or %NULL
20926 * Parses @mask_string as an IP address and (optional) length, and
20927 * creates a new #GInetAddressMask. The length, if present, is
20928 * delimited by a "/". If it is not present, then the length is
20929 * assumed to be the full length of the address.
20931 * Returns: a new #GInetAddressMask corresponding to @string, or %NULL on error.
20937 * g_inet_address_mask_to_string:
20938 * @mask: a #GInetAddressMask
20940 * Converts @mask back to its corresponding string form.
20942 * Returns: a string corresponding to @mask.
20948 * g_inet_address_new_any:
20949 * @family: the address family
20951 * Creates a #GInetAddress for the "any" address (unassigned/"don't
20952 * care") for @family.
20954 * Returns: a new #GInetAddress corresponding to the "any" address for @family.
20960 * g_inet_address_new_from_bytes:
20961 * @bytes: (array) (element-type guint8): raw address data
20962 * @family: the address family of @bytes
20964 * Creates a new #GInetAddress from the given @family and @bytes.
20965 * @bytes should be 4 bytes for %G_SOCKET_FAMILY_IPV4 and 16 bytes for
20966 * %G_SOCKET_FAMILY_IPV6.
20968 * Returns: a new #GInetAddress corresponding to @family and @bytes.
20974 * g_inet_address_new_from_string:
20975 * @string: a string representation of an IP address
20977 * Parses @string as an IP address and creates a new #GInetAddress.
20979 * Returns: a new #GInetAddress corresponding to @string, or %NULL if @string could not be parsed.
20985 * g_inet_address_new_loopback:
20986 * @family: the address family
20988 * Creates a #GInetAddress for the loopback address for @family.
20990 * Returns: a new #GInetAddress corresponding to the loopback address for @family.
20996 * g_inet_address_to_bytes: (skip)
20997 * @address: a #GInetAddress
20999 * Gets the raw binary address data from @address.
21001 * 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().
21007 * g_inet_address_to_string:
21008 * @address: a #GInetAddress
21010 * Converts @address to string form.
21012 * Returns: a representation of @address as a string, which should be freed after use.
21018 * g_inet_socket_address_get_address:
21019 * @address: a #GInetSocketAddress
21021 * Gets @address's #GInetAddress.
21023 * Returns: (transfer none): the #GInetAddress for @address, which must be g_object_ref()'d if it will be stored
21029 * g_inet_socket_address_get_flowinfo:
21030 * @address: a %G_SOCKET_FAMILY_IPV6 #GInetSocketAddress
21032 * Gets the <literal>sin6_flowinfo</literal> field from @address,
21033 * which must be an IPv6 address.
21035 * Returns: the flowinfo field
21041 * g_inet_socket_address_get_port:
21042 * @address: a #GInetSocketAddress
21044 * Gets @address's port.
21046 * Returns: the port for @address
21052 * g_inet_socket_address_get_scope_id:
21053 * @address: a %G_SOCKET_FAMILY_IPV6 #GInetAddress
21055 * Gets the <literal>sin6_scope_id</literal> field from @address,
21056 * which must be an IPv6 address.
21058 * Returns: the scope id field
21064 * g_inet_socket_address_new:
21065 * @address: a #GInetAddress
21066 * @port: a port number
21068 * Creates a new #GInetSocketAddress for @address and @port.
21070 * Returns: a new #GInetSocketAddress
21077 * @initable: a #GInitable.
21078 * @cancellable: optional #GCancellable object, %NULL to ignore.
21079 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21081 * Initializes the object implementing the interface.
21083 * The object must be initialized before any real use after initial
21084 * construction, either with this function or g_async_initable_init_async().
21086 * Implementations may also support cancellation. If @cancellable is not %NULL,
21087 * then initialization can be cancelled by triggering the cancellable object
21088 * from another thread. If the operation was cancelled, the error
21089 * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL and
21090 * the object doesn't support cancellable initialization the error
21091 * %G_IO_ERROR_NOT_SUPPORTED will be returned.
21093 * If the object is not initialized, or initialization returns with an
21094 * error, then all operations on the object except g_object_ref() and
21095 * g_object_unref() are considered to be invalid, and have undefined
21096 * behaviour. See the <xref linkend="ginitable"/> section introduction
21097 * for more details.
21099 * Implementations of this method must be idempotent, i.e. multiple calls
21100 * to this function with the same argument should return the same results.
21101 * Only the first call initializes the object, further calls return the result
21102 * of the first call. This is so that it's safe to implement the singleton
21103 * pattern in the GObject constructor function.
21105 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
21112 * @object_type: a #GType supporting #GInitable.
21113 * @cancellable: optional #GCancellable object, %NULL to ignore.
21114 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21115 * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
21116 * @...: the value if the first property, followed by and other property value pairs, and ended by %NULL.
21118 * Helper function for constructing #GInitable object. This is
21119 * similar to g_object_new() but also initializes the object
21120 * and returns %NULL, setting an error on failure.
21122 * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21128 * g_initable_new_valist:
21129 * @object_type: a #GType supporting #GInitable.
21130 * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
21131 * @var_args: The var args list generated from @first_property_name.
21132 * @cancellable: optional #GCancellable object, %NULL to ignore.
21133 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21135 * Helper function for constructing #GInitable object. This is
21136 * similar to g_object_new_valist() but also initializes the object
21137 * and returns %NULL, setting an error on failure.
21139 * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21146 * @object_type: a #GType supporting #GInitable.
21147 * @n_parameters: the number of parameters in @parameters
21148 * @parameters: (array length=n_parameters): the parameters to use to construct the object
21149 * @cancellable: optional #GCancellable object, %NULL to ignore.
21150 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21152 * Helper function for constructing #GInitable object. This is
21153 * similar to g_object_newv() but also initializes the object
21154 * and returns %NULL, setting an error on failure.
21156 * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21162 * g_input_stream_clear_pending:
21163 * @stream: input stream
21165 * Clears the pending flag on @stream.
21170 * g_input_stream_close:
21171 * @stream: A #GInputStream.
21172 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21173 * @error: location to store the error occurring, or %NULL to ignore
21175 * Closes the stream, releasing resources related to it.
21177 * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
21178 * Closing a stream multiple times will not return an error.
21180 * Streams will be automatically closed when the last reference
21181 * is dropped, but you might want to call this function to make sure
21182 * resources are released as early as possible.
21184 * Some streams might keep the backing store of the stream (e.g. a file descriptor)
21185 * open after the stream is closed. See the documentation for the individual
21186 * stream for details.
21188 * On failure the first error that happened will be reported, but the close
21189 * operation will finish as much as possible. A stream that failed to
21190 * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
21191 * is important to check and report the error to the user.
21193 * If @cancellable is not %NULL, then the operation can be cancelled by
21194 * triggering the cancellable object from another thread. If the operation
21195 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21196 * Cancelling a close will still leave the stream closed, but some streams
21197 * can use a faster close that doesn't block to e.g. check errors.
21199 * Returns: %TRUE on success, %FALSE on failure
21204 * g_input_stream_close_async:
21205 * @stream: A #GInputStream.
21206 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21207 * @cancellable: (allow-none): optional cancellable object
21208 * @callback: (scope async): callback to call when the request is satisfied
21209 * @user_data: (closure): the data to pass to callback function
21211 * Requests an asynchronous closes of the stream, releasing resources related to it.
21212 * When the operation is finished @callback will be called.
21213 * You can then call g_input_stream_close_finish() to get the result of the
21216 * For behaviour details see g_input_stream_close().
21218 * The asyncronous methods have a default fallback that uses threads to implement
21219 * asynchronicity, so they are optional for inheriting classes. However, if you
21220 * override one you must override all.
21225 * g_input_stream_close_finish:
21226 * @stream: a #GInputStream.
21227 * @result: a #GAsyncResult.
21228 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21230 * Finishes closing a stream asynchronously, started from g_input_stream_close_async().
21232 * Returns: %TRUE if the stream was closed successfully.
21237 * g_input_stream_has_pending:
21238 * @stream: input stream.
21240 * Checks if an input stream has pending actions.
21242 * Returns: %TRUE if @stream has pending actions.
21247 * g_input_stream_is_closed:
21248 * @stream: input stream.
21250 * Checks if an input stream is closed.
21252 * Returns: %TRUE if the stream is closed.
21257 * g_input_stream_read:
21258 * @stream: a #GInputStream.
21259 * @buffer: a buffer to read data into (which should be at least count bytes long).
21260 * @count: the number of bytes that will be read from the stream
21261 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21262 * @error: location to store the error occurring, or %NULL to ignore
21264 * Tries to read @count bytes from the stream into the buffer starting at
21265 * @buffer. Will block during this read.
21267 * If count is zero returns zero and does nothing. A value of @count
21268 * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21270 * On success, the number of bytes read into the buffer is returned.
21271 * It is not an error if this is not the same as the requested size, as it
21272 * can happen e.g. near the end of a file. Zero is returned on end of file
21273 * (or if @count is zero), but never otherwise.
21275 * If @cancellable is not %NULL, then the operation can be cancelled by
21276 * triggering the cancellable object from another thread. If the operation
21277 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21278 * operation was partially finished when the operation was cancelled the
21279 * partial result will be returned, without an error.
21281 * On error -1 is returned and @error is set accordingly.
21283 * Returns: Number of bytes read, or -1 on error, or 0 on end of file.
21288 * g_input_stream_read_all:
21289 * @stream: a #GInputStream.
21290 * @buffer: a buffer to read data into (which should be at least count bytes long).
21291 * @count: the number of bytes that will be read from the stream
21292 * @bytes_read: (out): location to store the number of bytes that was read from the stream
21293 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21294 * @error: location to store the error occurring, or %NULL to ignore
21296 * Tries to read @count bytes from the stream into the buffer starting at
21297 * @buffer. Will block during this read.
21299 * This function is similar to g_input_stream_read(), except it tries to
21300 * read as many bytes as requested, only stopping on an error or end of stream.
21302 * On a successful read of @count bytes, or if we reached the end of the
21303 * stream, %TRUE is returned, and @bytes_read is set to the number of bytes
21304 * read into @buffer.
21306 * If there is an error during the operation %FALSE is returned and @error
21307 * is set to indicate the error status, @bytes_read is updated to contain
21308 * the number of bytes read into @buffer before the error occurred.
21310 * Returns: %TRUE on success, %FALSE if there was an error
21315 * g_input_stream_read_async:
21316 * @stream: A #GInputStream.
21317 * @buffer: a buffer to read data into (which should be at least count bytes long).
21318 * @count: the number of bytes that will be read from the stream
21319 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21320 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21321 * @callback: (scope async): callback to call when the request is satisfied
21322 * @user_data: (closure): the data to pass to callback function
21324 * Request an asynchronous read of @count bytes from the stream into the buffer
21325 * starting at @buffer. When the operation is finished @callback will be called.
21326 * You can then call g_input_stream_read_finish() to get the result of the
21329 * During an async request no other sync and async calls are allowed on @stream, and will
21330 * result in %G_IO_ERROR_PENDING errors.
21332 * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21334 * On success, the number of bytes read into the buffer will be passed to the
21335 * callback. It is not an error if this is not the same as the requested size, as it
21336 * can happen e.g. near the end of a file, but generally we try to read
21337 * as many bytes as requested. Zero is returned on end of file
21338 * (or if @count is zero), but never otherwise.
21340 * Any outstanding i/o request with higher priority (lower numerical value) will
21341 * be executed before an outstanding request with lower priority. Default
21342 * priority is %G_PRIORITY_DEFAULT.
21344 * The asyncronous methods have a default fallback that uses threads to implement
21345 * asynchronicity, so they are optional for inheriting classes. However, if you
21346 * override one you must override all.
21351 * g_input_stream_read_bytes:
21352 * @stream: a #GInputStream.
21353 * @count: maximum number of bytes that will be read from the stream. Common values include 4096 and 8192.
21354 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21355 * @error: location to store the error occurring, or %NULL to ignore
21357 * Like g_input_stream_read(), this tries to read @count bytes from
21358 * the stream in a blocking fashion. However, rather than reading into
21359 * a user-supplied buffer, this will create a new #GBytes containing
21360 * the data that was read. This may be easier to use from language
21363 * If count is zero, returns a zero-length #GBytes and does nothing. A
21364 * value of @count larger than %G_MAXSSIZE will cause a
21365 * %G_IO_ERROR_INVALID_ARGUMENT error.
21367 * On success, a new #GBytes is returned. It is not an error if the
21368 * size of this object is not the same as the requested size, as it
21369 * can happen e.g. near the end of a file. A zero-length #GBytes is
21370 * returned on end of file (or if @count is zero), but never
21373 * If @cancellable is not %NULL, then the operation can be cancelled by
21374 * triggering the cancellable object from another thread. If the operation
21375 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21376 * operation was partially finished when the operation was cancelled the
21377 * partial result will be returned, without an error.
21379 * On error %NULL is returned and @error is set accordingly.
21381 * Returns: a new #GBytes, or %NULL on error
21386 * g_input_stream_read_bytes_async:
21387 * @stream: A #GInputStream.
21388 * @count: the number of bytes that will be read from the stream
21389 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21390 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21391 * @callback: (scope async): callback to call when the request is satisfied
21392 * @user_data: (closure): the data to pass to callback function
21394 * Request an asynchronous read of @count bytes from the stream into a
21395 * new #GBytes. When the operation is finished @callback will be
21396 * called. You can then call g_input_stream_read_bytes_finish() to get the
21397 * result of the operation.
21399 * During an async request no other sync and async calls are allowed
21400 * on @stream, and will result in %G_IO_ERROR_PENDING errors.
21402 * A value of @count larger than %G_MAXSSIZE will cause a
21403 * %G_IO_ERROR_INVALID_ARGUMENT error.
21405 * On success, the new #GBytes will be passed to the callback. It is
21406 * not an error if this is smaller than the requested size, as it can
21407 * happen e.g. near the end of a file, but generally we try to read as
21408 * many bytes as requested. Zero is returned on end of file (or if
21409 * @count is zero), but never otherwise.
21411 * Any outstanding I/O request with higher priority (lower numerical
21412 * value) will be executed before an outstanding request with lower
21413 * priority. Default priority is %G_PRIORITY_DEFAULT.
21418 * g_input_stream_read_bytes_finish:
21419 * @stream: a #GInputStream.
21420 * @result: a #GAsyncResult.
21421 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21423 * Finishes an asynchronous stream read-into-#GBytes operation.
21425 * Returns: the newly-allocated #GBytes, or %NULL on error
21430 * g_input_stream_read_finish:
21431 * @stream: a #GInputStream.
21432 * @result: a #GAsyncResult.
21433 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21435 * Finishes an asynchronous stream read operation.
21437 * Returns: number of bytes read in, or -1 on error, or 0 on end of file.
21442 * g_input_stream_set_pending:
21443 * @stream: input stream
21444 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21446 * Sets @stream to have actions pending. If the pending flag is
21447 * already set or @stream is closed, it will return %FALSE and set
21450 * Returns: %TRUE if pending was previously unset and is now set.
21455 * g_input_stream_skip:
21456 * @stream: a #GInputStream.
21457 * @count: the number of bytes that will be skipped from the stream
21458 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21459 * @error: location to store the error occurring, or %NULL to ignore
21461 * Tries to skip @count bytes from the stream. Will block during the operation.
21463 * This is identical to g_input_stream_read(), from a behaviour standpoint,
21464 * but the bytes that are skipped are not returned to the user. Some
21465 * streams have an implementation that is more efficient than reading the data.
21467 * This function is optional for inherited classes, as the default implementation
21468 * emulates it using read.
21470 * If @cancellable is not %NULL, then the operation can be cancelled by
21471 * triggering the cancellable object from another thread. If the operation
21472 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21473 * operation was partially finished when the operation was cancelled the
21474 * partial result will be returned, without an error.
21476 * Returns: Number of bytes skipped, or -1 on error
21481 * g_input_stream_skip_async:
21482 * @stream: A #GInputStream.
21483 * @count: the number of bytes that will be skipped from the stream
21484 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21485 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21486 * @callback: (scope async): callback to call when the request is satisfied
21487 * @user_data: (closure): the data to pass to callback function
21489 * Request an asynchronous skip of @count bytes from the stream.
21490 * When the operation is finished @callback will be called.
21491 * You can then call g_input_stream_skip_finish() to get the result
21492 * of the operation.
21494 * During an async request no other sync and async calls are allowed,
21495 * and will result in %G_IO_ERROR_PENDING errors.
21497 * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21499 * On success, the number of bytes skipped will be passed to the callback.
21500 * It is not an error if this is not the same as the requested size, as it
21501 * can happen e.g. near the end of a file, but generally we try to skip
21502 * as many bytes as requested. Zero is returned on end of file
21503 * (or if @count is zero), but never otherwise.
21505 * Any outstanding i/o request with higher priority (lower numerical value)
21506 * will be executed before an outstanding request with lower priority.
21507 * Default priority is %G_PRIORITY_DEFAULT.
21509 * The asynchronous methods have a default fallback that uses threads to
21510 * implement asynchronicity, so they are optional for inheriting classes.
21511 * However, if you override one, you must override all.
21516 * g_input_stream_skip_finish:
21517 * @stream: a #GInputStream.
21518 * @result: a #GAsyncResult.
21519 * @error: a #GError location to store the error occurring, or %NULL to ignore.
21521 * Finishes a stream skip operation.
21523 * Returns: the size of the bytes skipped, or %-1 on error.
21528 * g_io_error_from_errno:
21529 * @err_no: Error number as defined in errno.h.
21531 * Converts errno.h error codes into GIO error codes.
21533 * Returns: #GIOErrorEnum value for the given errno.h error number.
21538 * g_io_error_from_win32_error:
21539 * @error_code: Windows error number.
21541 * Converts some common error codes into GIO error codes. The
21542 * fallback value G_IO_ERROR_FAILED is returned for error codes not
21545 * Returns: #GIOErrorEnum value for the given error number.
21551 * g_io_error_quark:
21553 * Gets the GIO Error Quark.
21555 * Returns: a #GQuark.
21560 * g_io_extension_get_name:
21561 * @extension: a #GIOExtension
21563 * Gets the name under which @extension was registered.
21565 * Note that the same type may be registered as extension
21566 * for multiple extension points, under different names.
21568 * Returns: the name of @extension.
21573 * g_io_extension_get_priority:
21574 * @extension: a #GIOExtension
21576 * Gets the priority with which @extension was registered.
21578 * Returns: the priority of @extension
21583 * g_io_extension_get_type:
21584 * @extension: a #GIOExtension
21586 * Gets the type associated with @extension.
21588 * Returns: the type of @extension
21593 * g_io_extension_point_get_extension_by_name:
21594 * @extension_point: a #GIOExtensionPoint
21595 * @name: the name of the extension to get
21597 * Finds a #GIOExtension for an extension point by name.
21599 * Returns: (transfer none): the #GIOExtension for @extension_point that has the given name, or %NULL if there is no extension with that name
21604 * g_io_extension_point_get_extensions:
21605 * @extension_point: a #GIOExtensionPoint
21607 * Gets a list of all extensions that implement this extension point.
21608 * The list is sorted by priority, beginning with the highest priority.
21610 * Returns: (element-type GIOExtension) (transfer none): a #GList of #GIOExtension<!-- -->s. The list is owned by GIO and should not be modified.
21615 * g_io_extension_point_get_required_type:
21616 * @extension_point: a #GIOExtensionPoint
21618 * Gets the required type for @extension_point.
21620 * Returns: the #GType that all implementations must have, or #G_TYPE_INVALID if the extension point has no required type
21625 * g_io_extension_point_implement:
21626 * @extension_point_name: the name of the extension point
21627 * @type: the #GType to register as extension
21628 * @extension_name: the name for the extension
21629 * @priority: the priority for the extension
21631 * Registers @type as extension for the extension point with name
21632 * @extension_point_name.
21634 * If @type has already been registered as an extension for this
21635 * extension point, the existing #GIOExtension object is returned.
21637 * Returns: (transfer none): a #GIOExtension object for #GType
21642 * g_io_extension_point_lookup:
21643 * @name: the name of the extension point
21645 * Looks up an existing extension point.
21647 * Returns: (transfer none): the #GIOExtensionPoint, or %NULL if there is no registered extension point with the given name.
21652 * g_io_extension_point_register:
21653 * @name: The name of the extension point
21655 * Registers an extension point.
21657 * Returns: (transfer none): the new #GIOExtensionPoint. This object is owned by GIO and should not be freed.
21662 * g_io_extension_point_set_required_type:
21663 * @extension_point: a #GIOExtensionPoint
21664 * @type: the #GType to require
21666 * Sets the required type for @extension_point to @type.
21667 * All implementations must henceforth have this type.
21672 * g_io_extension_ref_class:
21673 * @extension: a #GIOExtension
21675 * Gets a reference to the class for the type that is
21676 * associated with @extension.
21678 * Returns: (transfer full): the #GTypeClass for the type of @extension
21684 * @filename: filename of the shared library module.
21686 * Creates a new GIOModule that will load the specific
21687 * shared library when in use.
21689 * Returns: a #GIOModule from given @filename, or %NULL on error.
21694 * g_io_module_scope_block:
21695 * @scope: a module loading scope
21696 * @basename: the basename to block
21698 * Block modules with the given @basename from being loaded when
21699 * this scope is used with g_io_modules_scan_all_in_directory_with_scope()
21700 * or g_io_modules_load_all_in_directory_with_scope().
21707 * g_io_module_scope_free:
21708 * @scope: a module loading scope
21710 * Free a module scope.
21717 * g_io_module_scope_new:
21718 * @flags: flags for the new scope
21720 * Create a new scope for loading of IO modules. A scope can be used for
21721 * blocking duplicate modules, or blocking a module you don't want to load.
21723 * Specify the %G_IO_MODULE_SCOPE_BLOCK_DUPLICATES flag to block modules
21724 * which have the same base name as a module that has already been seen
21727 * Returns: (transfer full): the new module scope
21733 * g_io_modules_load_all_in_directory:
21734 * @dirname: pathname for a directory containing modules to load.
21736 * Loads all the modules in the specified directory.
21738 * If don't require all modules to be initialized (and thus registering
21739 * all gtypes) then you can use g_io_modules_scan_all_in_directory()
21740 * which allows delayed/lazy loading of modules.
21742 * 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().
21747 * g_io_modules_load_all_in_directory_with_scope:
21748 * @dirname: pathname for a directory containing modules to load.
21749 * @scope: a scope to use when scanning the modules.
21751 * Loads all the modules in the specified directory.
21753 * If don't require all modules to be initialized (and thus registering
21754 * all gtypes) then you can use g_io_modules_scan_all_in_directory()
21755 * which allows delayed/lazy loading of modules.
21757 * 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().
21763 * g_io_modules_scan_all_in_directory:
21764 * @dirname: pathname for a directory containing modules to scan.
21766 * Scans all the modules in the specified directory, ensuring that
21767 * any extension point implemented by a module is registered.
21769 * This may not actually load and initialize all the types in each
21770 * module, some modules may be lazily loaded and initialized when
21771 * an extension point it implementes is used with e.g.
21772 * g_io_extension_point_get_extensions() or
21773 * g_io_extension_point_get_extension_by_name().
21775 * If you need to guarantee that all types are loaded in all the modules,
21776 * use g_io_modules_load_all_in_directory().
21783 * g_io_modules_scan_all_in_directory_with_scope:
21784 * @dirname: pathname for a directory containing modules to scan.
21785 * @scope: a scope to use when scanning the modules
21787 * Scans all the modules in the specified directory, ensuring that
21788 * any extension point implemented by a module is registered.
21790 * This may not actually load and initialize all the types in each
21791 * module, some modules may be lazily loaded and initialized when
21792 * an extension point it implementes is used with e.g.
21793 * g_io_extension_point_get_extensions() or
21794 * g_io_extension_point_get_extension_by_name().
21796 * If you need to guarantee that all types are loaded in all the modules,
21797 * use g_io_modules_load_all_in_directory().
21804 * g_io_scheduler_cancel_all_jobs:
21806 * Cancels all cancellable I/O jobs.
21808 * A job is cancellable if a #GCancellable was passed into
21809 * g_io_scheduler_push_job().
21814 * g_io_scheduler_job_send_to_mainloop:
21815 * @job: a #GIOSchedulerJob
21816 * @func: a #GSourceFunc callback that will be called in the original thread
21817 * @user_data: data to pass to @func
21818 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
21820 * Used from an I/O job to send a callback to be run in the thread
21821 * that the job was started from, waiting for the result (and thus
21822 * blocking the I/O job).
21824 * Returns: The return value of @func
21829 * g_io_scheduler_job_send_to_mainloop_async:
21830 * @job: a #GIOSchedulerJob
21831 * @func: a #GSourceFunc callback that will be called in the original thread
21832 * @user_data: data to pass to @func
21833 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
21835 * Used from an I/O job to send a callback to be run asynchronously in
21836 * the thread that the job was started from. The callback will be run
21837 * when the main loop is available, but at that time the I/O job might
21838 * have finished. The return value from the callback is ignored.
21840 * Note that if you are passing the @user_data from g_io_scheduler_push_job()
21841 * on to this function you have to ensure that it is not freed before
21842 * @func is called, either by passing %NULL as @notify to
21843 * g_io_scheduler_push_job() or by using refcounting for @user_data.
21848 * g_io_scheduler_push_job:
21849 * @job_func: a #GIOSchedulerJobFunc.
21850 * @user_data: data to pass to @job_func
21851 * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
21852 * @io_priority: the <link linkend="gioscheduler">I/O priority</link> of the request.
21853 * @cancellable: optional #GCancellable object, %NULL to ignore.
21855 * Schedules the I/O job to run in another thread.
21857 * @notify will be called on @user_data after @job_func has returned,
21858 * regardless whether the job was cancelled or has run to completion.
21860 * If @cancellable is not %NULL, it can be used to cancel the I/O job
21861 * by calling g_cancellable_cancel() or by calling
21862 * g_io_scheduler_cancel_all_jobs().
21867 * g_io_stream_clear_pending:
21868 * @stream: a #GIOStream
21870 * Clears the pending flag on @stream.
21877 * g_io_stream_close:
21878 * @stream: a #GIOStream
21879 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21880 * @error: location to store the error occurring, or %NULL to ignore
21882 * Closes the stream, releasing resources related to it. This will also
21883 * closes the individual input and output streams, if they are not already
21886 * Once the stream is closed, all other operations will return
21887 * %G_IO_ERROR_CLOSED. Closing a stream multiple times will not
21890 * Closing a stream will automatically flush any outstanding buffers
21893 * Streams will be automatically closed when the last reference
21894 * is dropped, but you might want to call this function to make sure
21895 * resources are released as early as possible.
21897 * Some streams might keep the backing store of the stream (e.g. a file
21898 * descriptor) open after the stream is closed. See the documentation for
21899 * the individual stream for details.
21901 * On failure the first error that happened will be reported, but the
21902 * close operation will finish as much as possible. A stream that failed
21903 * to close will still return %G_IO_ERROR_CLOSED for all operations.
21904 * Still, it is important to check and report the error to the user,
21905 * otherwise there might be a loss of data as all data might not be written.
21907 * If @cancellable is not NULL, then the operation can be cancelled by
21908 * triggering the cancellable object from another thread. If the operation
21909 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21910 * Cancelling a close will still leave the stream closed, but some streams
21911 * can use a faster close that doesn't block to e.g. check errors.
21913 * The default implementation of this method just calls close on the
21914 * individual input/output streams.
21916 * Returns: %TRUE on success, %FALSE on failure
21922 * g_io_stream_close_async:
21923 * @stream: a #GIOStream
21924 * @io_priority: the io priority of the request
21925 * @cancellable: (allow-none): optional cancellable object
21926 * @callback: (scope async): callback to call when the request is satisfied
21927 * @user_data: (closure): the data to pass to callback function
21929 * Requests an asynchronous close of the stream, releasing resources
21930 * related to it. When the operation is finished @callback will be
21931 * called. You can then call g_io_stream_close_finish() to get
21932 * the result of the operation.
21934 * For behaviour details see g_io_stream_close().
21936 * The asynchronous methods have a default fallback that uses threads
21937 * to implement asynchronicity, so they are optional for inheriting
21938 * classes. However, if you override one you must override all.
21945 * g_io_stream_close_finish:
21946 * @stream: a #GIOStream
21947 * @result: a #GAsyncResult
21948 * @error: a #GError location to store the error occurring, or %NULL to ignore
21952 * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
21958 * g_io_stream_get_input_stream:
21959 * @stream: a #GIOStream
21961 * Gets the input stream for this object. This is used
21964 * Returns: (transfer none): a #GInputStream, owned by the #GIOStream. Do not free.
21970 * g_io_stream_get_output_stream:
21971 * @stream: a #GIOStream
21973 * Gets the output stream for this object. This is used for
21976 * Returns: (transfer none): a #GOutputStream, owned by the #GIOStream. Do not free.
21982 * g_io_stream_has_pending:
21983 * @stream: a #GIOStream
21985 * Checks if a stream has pending actions.
21987 * Returns: %TRUE if @stream has pending actions.
21993 * g_io_stream_is_closed:
21994 * @stream: a #GIOStream
21996 * Checks if a stream is closed.
21998 * Returns: %TRUE if the stream is closed.
22004 * g_io_stream_set_pending:
22005 * @stream: a #GIOStream
22006 * @error: a #GError location to store the error occurring, or %NULL to ignore
22008 * Sets @stream to have actions pending. If the pending flag is
22009 * already set or @stream is closed, it will return %FALSE and set
22012 * Returns: %TRUE if pending was previously unset and is now set.
22018 * g_io_stream_splice_async:
22019 * @stream1: a #GIOStream.
22020 * @stream2: a #GIOStream.
22021 * @flags: a set of #GIOStreamSpliceFlags.
22022 * @io_priority: the io priority of the request.
22023 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22024 * @callback: (scope async): a #GAsyncReadyCallback.
22025 * @user_data: (closure): user data passed to @callback.
22027 * Asyncronously splice the output stream of @stream1 to the input stream of
22028 * @stream2, and splice the output stream of @stream2 to the input stream of
22031 * When the operation is finished @callback will be called.
22032 * You can then call g_io_stream_splice_finish() to get the
22033 * result of the operation.
22040 * g_io_stream_splice_finish:
22041 * @result: a #GAsyncResult.
22042 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22044 * Finishes an asynchronous io stream splice operation.
22046 * Returns: %TRUE on success, %FALSE otherwise.
22052 * g_keyfile_settings_backend_new:
22053 * @filename: the filename of the keyfile
22054 * @root_path: the path under which all settings keys appear
22055 * @root_group: (allow-none): the group name corresponding to @root_path, or %NULL
22057 * Creates a keyfile-backed #GSettingsBackend.
22059 * The filename of the keyfile to use is given by @filename.
22061 * All settings read to or written from the backend must fall under the
22062 * path given in @root_path (which must start and end with a slash and
22063 * not contain two consecutive slashes). @root_path may be "/".
22065 * If @root_group is non-%NULL then it specifies the name of the keyfile
22066 * group used for keys that are written directly below @root_path. For
22067 * example, if @root_path is "/apps/example/" and @root_group is
22068 * "toplevel", then settings the key "/apps/example/enabled" to a value
22069 * of %TRUE will cause the following to appear in the keyfile:
22076 * If @root_group is %NULL then it is not permitted to store keys
22077 * directly below the @root_path.
22079 * For keys not stored directly below @root_path (ie: in a sub-path),
22080 * the name of the subpath (with the final slash stripped) is used as
22081 * the name of the keyfile group. To continue the example, if
22082 * "/apps/example/profiles/default/font-size" were set to
22083 * 12 then the following would appear in the keyfile:
22086 * [profiles/default]
22090 * The backend will refuse writes (and return writability as being
22091 * %FALSE) for keys outside of @root_path and, in the event that
22092 * @root_group is %NULL, also for keys directly under @root_path.
22093 * Writes will also be refused if the backend detects that it has the
22094 * inability to rewrite the keyfile (ie: the containing directory is not
22097 * There is no checking done for your key namespace clashing with the
22098 * syntax of the key file format. For example, if you have '[' or ']'
22099 * characters in your path names or '=' in your key names you may be in
22102 * Returns: (transfer full): a keyfile-backed #GSettingsBackend
22107 * g_loadable_icon_load:
22108 * @icon: a #GLoadableIcon.
22109 * @size: an integer.
22110 * @type: (out) (allow-none): a location to store the type of the loaded icon, %NULL to ignore.
22111 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22112 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22114 * Loads a loadable icon. For the asynchronous version of this function,
22115 * see g_loadable_icon_load_async().
22117 * Returns: (transfer full): a #GInputStream to read the icon from.
22122 * g_loadable_icon_load_async:
22123 * @icon: a #GLoadableIcon.
22124 * @size: an integer.
22125 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22126 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
22127 * @user_data: (closure): the data to pass to callback function
22129 * Loads an icon asynchronously. To finish this function, see
22130 * g_loadable_icon_load_finish(). For the synchronous, blocking
22131 * version of this function, see g_loadable_icon_load().
22136 * g_loadable_icon_load_finish:
22137 * @icon: a #GLoadableIcon.
22138 * @res: a #GAsyncResult.
22139 * @type: a location to store the type of the loaded icon, %NULL to ignore.
22140 * @error: a #GError location to store the error occurring, or %NULL to ignore.
22142 * Finishes an asynchronous icon load started in g_loadable_icon_load_async().
22144 * Returns: (transfer full): a #GInputStream to read the icon from.
22151 * Returns a new #GVfs handle for a local vfs.
22153 * Returns: a new #GVfs handle.
22158 * g_memory_input_stream_add_bytes:
22159 * @stream: a #GMemoryInputStream
22160 * @bytes: input data
22162 * Appends @bytes to data that can be read from the input stream.
22169 * g_memory_input_stream_add_data:
22170 * @stream: a #GMemoryInputStream
22171 * @data: (array length=len) (element-type guint8) (transfer full): input data
22172 * @len: length of the data, may be -1 if @data is a nul-terminated string
22173 * @destroy: (allow-none): function that is called to free @data, or %NULL
22175 * Appends @data to data that can be read from the input stream
22180 * g_memory_input_stream_new:
22182 * Creates a new empty #GMemoryInputStream.
22184 * Returns: a new #GInputStream
22189 * g_memory_input_stream_new_from_bytes:
22190 * @bytes: a #GBytes
22192 * Creates a new #GMemoryInputStream with data from the given @bytes.
22194 * Returns: new #GInputStream read from @bytes
22200 * g_memory_input_stream_new_from_data:
22201 * @data: (array length=len) (element-type guint8) (transfer full): input data
22202 * @len: length of the data, may be -1 if @data is a nul-terminated string
22203 * @destroy: (allow-none): function that is called to free @data, or %NULL
22205 * Creates a new #GMemoryInputStream with data in memory of a given size.
22207 * Returns: new #GInputStream read from @data of @len bytes.
22212 * g_memory_output_stream_get_data:
22213 * @ostream: a #GMemoryOutputStream
22215 * Gets any loaded data from the @ostream.
22217 * Note that the returned pointer may become invalid on the next
22218 * write or truncate operation on the stream.
22220 * Returns: (transfer none): pointer to the stream's data
22225 * g_memory_output_stream_get_data_size:
22226 * @ostream: a #GMemoryOutputStream
22228 * Returns the number of bytes from the start up
22229 * to including the last byte written in the stream
22230 * that has not been truncated away.
22232 * Returns: the number of bytes written to the stream
22238 * g_memory_output_stream_get_size:
22239 * @ostream: a #GMemoryOutputStream
22241 * Gets the size of the currently allocated data area (available from
22242 * g_memory_output_stream_get_data()). If the stream isn't
22243 * growable (no realloc was passed to g_memory_output_stream_new()) then
22244 * this is the maximum size of the stream and further writes
22245 * will return %G_IO_ERROR_NO_SPACE.
22247 * Note that for growable streams the returned size may become invalid on
22248 * the next write or truncate operation on the stream.
22250 * If you want the number of bytes currently written to the stream, use
22251 * g_memory_output_stream_get_data_size().
22253 * Returns: the number of bytes allocated for the data buffer
22258 * g_memory_output_stream_new: (skip)
22259 * @data: (allow-none): pointer to a chunk of memory to use, or %NULL
22260 * @size: the size of @data
22261 * @realloc_function: (allow-none): a function with realloc() semantics (like g_realloc()) to be called when @data needs to be grown, or %NULL
22262 * @destroy_function: (allow-none): a function to be called on @data when the stream is finalized, or %NULL
22264 * Creates a new #GMemoryOutputStream.
22266 * If @data is non-%NULL, the stream will use that for its internal storage.
22267 * If @realloc_fn is non-%NULL, it will be used for resizing the internal
22268 * storage when necessary. To construct a fixed-size output stream,
22269 * pass %NULL as @realloc_fn.
22272 * /* a stream that can grow */
22273 * stream = g_memory_output_stream_new (NULL, 0, realloc, free);
22275 * /* another stream that can grow */
22276 * stream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
22278 * /* a fixed-size stream */
22279 * data = malloc (200);
22280 * stream3 = g_memory_output_stream_new (data, 200, NULL, free);
22283 * Returns: A newly created #GMemoryOutputStream object.
22288 * g_memory_output_stream_steal_as_bytes:
22289 * @ostream: a #GMemoryOutputStream
22291 * Returns data from the @ostream as a #GBytes. @ostream must be
22292 * closed before calling this function.
22294 * Returns: (transfer full): the stream's data
22300 * g_memory_output_stream_steal_data:
22301 * @ostream: a #GMemoryOutputStream
22303 * Gets any loaded data from the @ostream. Ownership of the data
22304 * is transferred to the caller; when no longer needed it must be
22305 * freed using the free function set in @ostream's
22306 * #GMemoryOutputStream:destroy-function property.
22308 * @ostream must be closed before calling this function.
22310 * Returns: (transfer full): the stream's data
22316 * g_memory_settings_backend_new:
22318 * Creates a memory-backed #GSettingsBackend.
22320 * This backend allows changes to settings, but does not write them
22321 * to any backing storage, so the next time you run your application,
22322 * the memory backend will start out with the default values again.
22324 * Returns: (transfer full): a newly created #GSettingsBackend
22332 * @label: (allow-none): the section label, or %NULL
22333 * @detailed_action: (allow-none): the detailed action string, or %NULL
22335 * Convenience function for appending a normal menu item to the end of
22336 * @menu. Combine g_menu_item_new() and g_menu_insert_item() for a more
22337 * flexible alternative.
22344 * g_menu_append_item:
22346 * @item: a #GMenuItem to append
22348 * Appends @item to the end of @menu.
22350 * See g_menu_insert_item() for more information.
22357 * g_menu_append_section:
22359 * @label: (allow-none): the section label, or %NULL
22360 * @section: a #GMenuModel with the items of the section
22362 * Convenience function for appending a section menu item to the end of
22363 * @menu. Combine g_menu_item_new_section() and g_menu_insert_item() for a
22364 * more flexible alternative.
22371 * g_menu_append_submenu:
22373 * @label: (allow-none): the section label, or %NULL
22374 * @submenu: a #GMenuModel with the items of the submenu
22376 * Convenience function for appending a submenu menu item to the end of
22377 * @menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for a
22378 * more flexible alternative.
22385 * g_menu_attribute_iter_get_name:
22386 * @iter: a #GMenuAttributeIter
22388 * Gets the name of the attribute at the current iterator position, as
22391 * The iterator is not advanced.
22393 * Returns: the name of the attribute
22399 * g_menu_attribute_iter_get_next:
22400 * @iter: a #GMenuAttributeIter
22401 * @out_name: (out) (allow-none) (transfer none): the type of the attribute
22402 * @value: (out) (allow-none) (transfer full): the attribute value
22404 * This function combines g_menu_attribute_iter_next() with
22405 * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value().
22407 * First the iterator is advanced to the next (possibly first) attribute.
22408 * If that fails, then %FALSE is returned and there are no other
22411 * If successful, @name and @value are set to the name and value of the
22412 * attribute that has just been advanced to. At this point,
22413 * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value() will
22414 * return the same values again.
22416 * The value returned in @name remains valid for as long as the iterator
22417 * remains at the current position. The value returned in @value must
22418 * be unreffed using g_variant_unref() when it is no longer in use.
22420 * Returns: %TRUE on success, or %FALSE if there is no additional attribute
22426 * g_menu_attribute_iter_get_value:
22427 * @iter: a #GMenuAttributeIter
22429 * Gets the value of the attribute at the current iterator position.
22431 * The iterator is not advanced.
22433 * Returns: (transfer full): the value of the current attribute
22439 * g_menu_attribute_iter_next:
22440 * @iter: a #GMenuAttributeIter
22442 * Attempts to advance the iterator to the next (possibly first)
22445 * %TRUE is returned on success, or %FALSE if there are no more
22448 * You must call this function when you first acquire the iterator
22449 * to advance it to the first attribute (and determine if the first
22450 * attribute exists at all).
22452 * Returns: %TRUE on success, or %FALSE when there are no more attributes
22461 * Marks @menu as frozen.
22463 * After the menu is frozen, it is an error to attempt to make any
22464 * changes to it. In effect this means that the #GMenu API must no
22467 * This function causes g_menu_model_is_mutable() to begin returning
22468 * %FALSE, which has some positive performance implications.
22477 * @position: the position at which to insert the item
22478 * @label: (allow-none): the section label, or %NULL
22479 * @detailed_action: (allow-none): the detailed action string, or %NULL
22481 * Convenience function for inserting a normal menu item into @menu.
22482 * Combine g_menu_item_new() and g_menu_insert_item() for a more flexible
22490 * g_menu_insert_item:
22492 * @position: the position at which to insert the item
22493 * @item: the #GMenuItem to insert
22495 * Inserts @item into @menu.
22497 * The "insertion" is actually done by copying all of the attribute and
22498 * link values of @item and using them to form a new item within @menu.
22499 * As such, @item itself is not really inserted, but rather, a menu item
22500 * that is exactly the same as the one presently described by @item.
22502 * This means that @item is essentially useless after the insertion
22503 * occurs. Any changes you make to it are ignored unless it is inserted
22504 * again (at which point its updated values will be copied).
22506 * You should probably just free @item once you're done.
22508 * There are many convenience functions to take care of common cases.
22509 * See g_menu_insert(), g_menu_insert_section() and
22510 * g_menu_insert_submenu() as well as "prepend" and "append" variants of
22511 * each of these functions.
22518 * g_menu_insert_section:
22520 * @position: the position at which to insert the item
22521 * @label: (allow-none): the section label, or %NULL
22522 * @section: a #GMenuModel with the items of the section
22524 * Convenience function for inserting a section menu item into @menu.
22525 * Combine g_menu_item_new_section() and g_menu_insert_item() for a more
22526 * flexible alternative.
22533 * g_menu_insert_submenu:
22535 * @position: the position at which to insert the item
22536 * @label: (allow-none): the section label, or %NULL
22537 * @submenu: a #GMenuModel with the items of the submenu
22539 * Convenience function for inserting a submenu menu item into @menu.
22540 * Combine g_menu_item_new_submenu() and g_menu_insert_item() for a more
22541 * flexible alternative.
22549 * @label: (allow-none): the section label, or %NULL
22550 * @detailed_action: (allow-none): the detailed action string, or %NULL
22552 * Creates a new #GMenuItem.
22554 * If @label is non-%NULL it is used to set the "label" attribute of the
22557 * If @detailed_action is non-%NULL it is used to set the "action" and
22558 * possibly the "target" attribute of the new item. See
22559 * g_menu_item_set_detailed_action() for more information.
22561 * Returns: a new #GMenuItem
22567 * g_menu_item_new_section:
22568 * @label: (allow-none): the section label, or %NULL
22569 * @section: a #GMenuModel with the items of the section
22571 * Creates a new #GMenuItem representing a section.
22573 * This is a convenience API around g_menu_item_new() and
22574 * g_menu_item_set_section().
22576 * The effect of having one menu appear as a section of another is
22577 * exactly as it sounds: the items from @section become a direct part of
22578 * the menu that @menu_item is added to.
22580 * Visual separation is typically displayed between two non-empty
22581 * sections. If @label is non-%NULL then it will be encorporated into
22582 * this visual indication. This allows for labeled subsections of a
22585 * As a simple example, consider a typical "Edit" menu from a simple
22586 * program. It probably contains an "Undo" and "Redo" item, followed by
22587 * a separator, followed by "Cut", "Copy" and "Paste".
22589 * This would be accomplished by creating three #GMenu instances. The
22590 * first would be populated with the "Undo" and "Redo" items, and the
22591 * second with the "Cut", "Copy" and "Paste" items. The first and
22592 * second menus would then be added as submenus of the third. In XML
22593 * format, this would look something like the following:
22595 * <informalexample><programlisting><![CDATA[
22596 * <menu id='edit-menu'>
22598 * <item label='Undo'/>
22599 * <item label='Redo'/>
22602 * <item label='Cut'/>
22603 * <item label='Copy'/>
22604 * <item label='Paste'/>
22607 * ]]></programlisting></informalexample>
22609 * The following example is exactly equivalent. It is more illustrative
22610 * of the exact relationship between the menus and items (keeping in
22611 * mind that the 'link' element defines a new menu that is linked to the
22612 * containing one). The style of the second example is more verbose and
22613 * difficult to read (and therefore not recommended except for the
22614 * purpose of understanding what is really going on).
22616 * <informalexample><programlisting><![CDATA[
22617 * <menu id='edit-menu'>
22619 * <link name='section'>
22620 * <item label='Undo'/>
22621 * <item label='Redo'/>
22625 * <link name='section'>
22626 * <item label='Cut'/>
22627 * <item label='Copy'/>
22628 * <item label='Paste'/>
22632 * ]]></programlisting></informalexample>
22634 * Returns: a new #GMenuItem
22640 * g_menu_item_new_submenu:
22641 * @label: (allow-none): the section label, or %NULL
22642 * @submenu: a #GMenuModel with the items of the submenu
22644 * Creates a new #GMenuItem representing a submenu.
22646 * This is a convenience API around g_menu_item_new() and
22647 * g_menu_item_set_submenu().
22649 * Returns: a new #GMenuItem
22655 * g_menu_item_set_action_and_target:
22656 * @menu_item: a #GMenuItem
22657 * @action: (allow-none): the name of the action for this item
22658 * @format_string: (allow-none): a GVariant format string
22659 * @...: positional parameters, as per @format_string
22661 * Sets or unsets the "action" and "target" attributes of @menu_item.
22663 * If @action is %NULL then both the "action" and "target" attributes
22664 * are unset (and @format_string is ignored along with the positional
22667 * If @action is non-%NULL then the "action" attribute is set.
22668 * @format_string is then inspected. If it is non-%NULL then the proper
22669 * position parameters are collected to create a #GVariant instance to
22670 * use as the target value. If it is %NULL then the positional
22671 * parameters are ignored and the "target" attribute is unset.
22673 * See also g_menu_item_set_action_and_target_value() for an equivalent
22674 * call that directly accepts a #GVariant. See
22675 * g_menu_item_set_detailed_action() for a more convenient version that
22676 * works with string-typed targets.
22678 * See also g_menu_item_set_action_and_target_value() for a
22679 * description of the semantics of the action and target attributes.
22686 * g_menu_item_set_action_and_target_value:
22687 * @menu_item: a #GMenuItem
22688 * @action: (allow-none): the name of the action for this item
22689 * @target_value: (allow-none): a #GVariant to use as the action target
22691 * Sets or unsets the "action" and "target" attributes of @menu_item.
22693 * If @action is %NULL then both the "action" and "target" attributes
22694 * are unset (and @target_value is ignored).
22696 * If @action is non-%NULL then the "action" attribute is set. The
22697 * "target" attribute is then set to the value of @target_value if it is
22698 * non-%NULL or unset otherwise.
22700 * Normal menu items (ie: not submenu, section or other custom item
22701 * types) are expected to have the "action" attribute set to identify
22702 * the action that they are associated with. The state type of the
22703 * action help to determine the disposition of the menu item. See
22704 * #GAction and #GActionGroup for an overview of actions.
22706 * In general, clicking on the menu item will result in activation of
22707 * the named action with the "target" attribute given as the parameter
22708 * to the action invocation. If the "target" attribute is not set then
22709 * the action is invoked with no parameter.
22711 * If the action has no state then the menu item is usually drawn as a
22712 * plain menu item (ie: with no additional decoration).
22714 * If the action has a boolean state then the menu item is usually drawn
22715 * as a toggle menu item (ie: with a checkmark or equivalent
22716 * indication). The item should be marked as 'toggled' or 'checked'
22717 * when the boolean state is %TRUE.
22719 * If the action has a string state then the menu item is usually drawn
22720 * as a radio menu item (ie: with a radio bullet or equivalent
22721 * indication). The item should be marked as 'selected' when the string
22722 * state is equal to the value of the @target property.
22724 * See g_menu_item_set_action_and_target() or
22725 * g_menu_item_set_detailed_action() for two equivalent calls that are
22726 * probably more convenient for most uses.
22733 * g_menu_item_set_attribute:
22734 * @menu_item: a #GMenuItem
22735 * @attribute: the attribute to set
22736 * @format_string: (allow-none): a #GVariant format string, or %NULL
22737 * @...: positional parameters, as per @format_string
22739 * Sets or unsets an attribute on @menu_item.
22741 * The attribute to set or unset is specified by @attribute. This
22742 * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
22743 * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
22745 * Attribute names are restricted to lowercase characters, numbers
22746 * and '-'. Furthermore, the names must begin with a lowercase character,
22747 * must not end with a '-', and must not contain consecutive dashes.
22749 * If @format_string is non-%NULL then the proper position parameters
22750 * are collected to create a #GVariant instance to use as the attribute
22751 * value. If it is %NULL then the positional parameterrs are ignored
22752 * and the named attribute is unset.
22754 * See also g_menu_item_set_attribute_value() for an equivalent call
22755 * that directly accepts a #GVariant.
22762 * g_menu_item_set_attribute_value:
22763 * @menu_item: a #GMenuItem
22764 * @attribute: the attribute to set
22765 * @value: (allow-none): a #GVariant to use as the value, or %NULL
22767 * Sets or unsets an attribute on @menu_item.
22769 * The attribute to set or unset is specified by @attribute. This
22770 * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
22771 * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
22773 * Attribute names are restricted to lowercase characters, numbers
22774 * and '-'. Furthermore, the names must begin with a lowercase character,
22775 * must not end with a '-', and must not contain consecutive dashes.
22777 * must consist only of lowercase
22778 * ASCII characters, digits and '-'.
22780 * If @value is non-%NULL then it is used as the new value for the
22781 * attribute. If @value is %NULL then the attribute is unset. If
22782 * the @value #GVariant is floating, it is consumed.
22784 * See also g_menu_item_set_attribute() for a more convenient way to do
22792 * g_menu_item_set_detailed_action:
22793 * @menu_item: a #GMenuItem
22794 * @detailed_action: the "detailed" action string
22796 * Sets the "action" and possibly the "target" attribute of @menu_item.
22798 * If @detailed_action contains a double colon ("::") then it is used as
22799 * a separator between an action name and a target string. In this
22800 * case, this call is equivalent to calling
22801 * g_menu_item_set_action_and_target() with the part before the "::" and
22802 * with a string-type #GVariant containing the part following the "::".
22804 * If @detailed_action doesn't contain "::" then the action is set to
22805 * the given string (verbatim) and the target value is unset.
22807 * See g_menu_item_set_action_and_target() or
22808 * g_menu_item_set_action_and_target_value() for more flexible (but
22809 * slightly less convenient) alternatives.
22811 * See also g_menu_item_set_action_and_target_value() for a description of
22812 * the semantics of the action and target attributes.
22819 * g_menu_item_set_label:
22820 * @menu_item: a #GMenuItem
22821 * @label: (allow-none): the label to set, or %NULL to unset
22823 * Sets or unsets the "label" attribute of @menu_item.
22825 * If @label is non-%NULL it is used as the label for the menu item. If
22826 * it is %NULL then the label attribute is unset.
22833 * g_menu_item_set_link:
22834 * @menu_item: a #GMenuItem
22835 * @link: type of link to establish or unset
22836 * @model: (allow-none): the #GMenuModel to link to (or %NULL to unset)
22838 * Creates a link from @menu_item to @model if non-%NULL, or unsets it.
22840 * Links are used to establish a relationship between a particular menu
22841 * item and another menu. For example, %G_MENU_LINK_SUBMENU is used to
22842 * associate a submenu with a particular menu item, and %G_MENU_LINK_SECTION
22843 * is used to create a section. Other types of link can be used, but there
22844 * is no guarantee that clients will be able to make sense of them.
22845 * Link types are restricted to lowercase characters, numbers
22846 * and '-'. Furthermore, the names must begin with a lowercase character,
22847 * must not end with a '-', and must not contain consecutive dashes.
22854 * g_menu_item_set_section:
22855 * @menu_item: a #GMenuItem
22856 * @section: (allow-none): a #GMenuModel, or %NULL
22858 * Sets or unsets the "section" link of @menu_item to @section.
22860 * The effect of having one menu appear as a section of another is
22861 * exactly as it sounds: the items from @section become a direct part of
22862 * the menu that @menu_item is added to. See g_menu_item_new_section()
22863 * for more information about what it means for a menu item to be a
22871 * g_menu_item_set_submenu:
22872 * @menu_item: a #GMenuItem
22873 * @submenu: (allow-none): a #GMenuModel, or %NULL
22875 * Sets or unsets the "submenu" link of @menu_item to @submenu.
22877 * If @submenu is non-%NULL, it is linked to. If it is %NULL then the
22880 * The effect of having one menu appear as a submenu of another is
22881 * exactly as it sounds.
22888 * g_menu_link_iter_get_name:
22889 * @iter: a #GMenuLinkIter
22891 * Gets the name of the link at the current iterator position.
22893 * The iterator is not advanced.
22895 * Returns: the type of the link
22901 * g_menu_link_iter_get_next:
22902 * @iter: a #GMenuLinkIter
22903 * @out_link: (out) (allow-none) (transfer none): the name of the link
22904 * @value: (out) (allow-none) (transfer full): the linked #GMenuModel
22906 * This function combines g_menu_link_iter_next() with
22907 * g_menu_link_iter_get_name() and g_menu_link_iter_get_value().
22909 * First the iterator is advanced to the next (possibly first) link.
22910 * If that fails, then %FALSE is returned and there are no other effects.
22912 * If successful, @out_link and @value are set to the name and #GMenuModel
22913 * of the link that has just been advanced to. At this point,
22914 * g_menu_link_iter_get_name() and g_menu_link_iter_get_value() will return the
22915 * same values again.
22917 * The value returned in @out_link remains valid for as long as the iterator
22918 * remains at the current position. The value returned in @value must
22919 * be unreffed using g_object_unref() when it is no longer in use.
22921 * Returns: %TRUE on success, or %FALSE if there is no additional link
22927 * g_menu_link_iter_get_value:
22928 * @iter: a #GMenuLinkIter
22930 * Gets the linked #GMenuModel at the current iterator position.
22932 * The iterator is not advanced.
22934 * Returns: (transfer full): the #GMenuModel that is linked to
22940 * g_menu_link_iter_next:
22941 * @iter: a #GMenuLinkIter
22943 * Attempts to advance the iterator to the next (possibly first)
22946 * %TRUE is returned on success, or %FALSE if there are no more links.
22948 * You must call this function when you first acquire the iterator to
22949 * advance it to the first link (and determine if the first link exists
22952 * Returns: %TRUE on success, or %FALSE when there are no more links
22958 * g_menu_model_get_item_attribute:
22959 * @model: a #GMenuModel
22960 * @item_index: the index of the item
22961 * @attribute: the attribute to query
22962 * @format_string: a #GVariant format string
22963 * @...: positional parameters, as per @format_string
22965 * Queries item at position @item_index in @model for the attribute
22966 * specified by @attribute.
22968 * If the attribute exists and matches the #GVariantType corresponding
22969 * to @format_string then @format_string is used to deconstruct the
22970 * value into the positional parameters and %TRUE is returned.
22972 * If the attribute does not exist, or it does exist but has the wrong
22973 * type, then the positional parameters are ignored and %FALSE is
22976 * Returns: %TRUE if the named attribute was found with the expected type
22982 * g_menu_model_get_item_attribute_value:
22983 * @model: a #GMenuModel
22984 * @item_index: the index of the item
22985 * @attribute: the attribute to query
22986 * @expected_type: (allow-none): the expected type of the attribute, or %NULL
22988 * Queries the item at position @item_index in @model for the attribute
22989 * specified by @attribute.
22991 * If @expected_type is non-%NULL then it specifies the expected type of
22992 * the attribute. If it is %NULL then any type will be accepted.
22994 * If the attribute exists and matches @expected_type (or if the
22995 * expected type is unspecified) then the value is returned.
22997 * If the attribute does not exist, or does not match the expected type
22998 * then %NULL is returned.
23000 * Returns: (transfer full): the value of the attribute
23006 * g_menu_model_get_item_link:
23007 * @model: a #GMenuModel
23008 * @item_index: the index of the item
23009 * @link: the link to query
23011 * Queries the item at position @item_index in @model for the link
23012 * specified by @link.
23014 * If the link exists, the linked #GMenuModel is returned. If the link
23015 * does not exist, %NULL is returned.
23017 * Returns: (transfer full): the linked #GMenuModel, or %NULL
23023 * g_menu_model_get_n_items:
23024 * @model: a #GMenuModel
23026 * Query the number of items in @model.
23028 * Returns: the number of items
23034 * g_menu_model_is_mutable:
23035 * @model: a #GMenuModel
23037 * Queries if @model is mutable.
23039 * An immutable #GMenuModel will never emit the #GMenuModel::items-changed
23040 * signal. Consumers of the model may make optimisations accordingly.
23042 * Returns: %TRUE if the model is mutable (ie: "items-changed" may be emitted).
23048 * g_menu_model_items_changed:
23049 * @model: a #GMenuModel
23050 * @position: the position of the change
23051 * @removed: the number of items removed
23052 * @added: the number of items added
23054 * Requests emission of the #GMenuModel::items-changed signal on @model.
23056 * This function should never be called except by #GMenuModel
23057 * subclasses. Any other calls to this function will very likely lead
23058 * to a violation of the interface of the model.
23060 * The implementation should update its internal representation of the
23061 * menu before emitting the signal. The implementation should further
23062 * expect to receive queries about the new state of the menu (and
23063 * particularly added menu items) while signal handlers are running.
23065 * The implementation must dispatch this call directly from a mainloop
23066 * entry and not in response to calls -- particularly those from the
23067 * #GMenuModel API. Said another way: the menu must not change while
23068 * user code is running without returning to the mainloop.
23075 * g_menu_model_iterate_item_attributes:
23076 * @model: a #GMenuModel
23077 * @item_index: the index of the item
23079 * Creates a #GMenuAttributeIter to iterate over the attributes of
23080 * the item at position @item_index in @model.
23082 * You must free the iterator with g_object_unref() when you are done.
23084 * Returns: (transfer full): a new #GMenuAttributeIter
23090 * g_menu_model_iterate_item_links:
23091 * @model: a #GMenuModel
23092 * @item_index: the index of the item
23094 * Creates a #GMenuLinkIter to iterate over the links of the item at
23095 * position @item_index in @model.
23097 * You must free the iterator with g_object_unref() when you are done.
23099 * Returns: (transfer full): a new #GMenuLinkIter
23107 * Creates a new #GMenu.
23109 * The new menu has no items.
23111 * Returns: a new #GMenu
23119 * @label: (allow-none): the section label, or %NULL
23120 * @detailed_action: (allow-none): the detailed action string, or %NULL
23122 * Convenience function for prepending a normal menu item to the start
23123 * of @menu. Combine g_menu_item_new() and g_menu_insert_item() for a more
23124 * flexible alternative.
23131 * g_menu_prepend_item:
23133 * @item: a #GMenuItem to prepend
23135 * Prepends @item to the start of @menu.
23137 * See g_menu_insert_item() for more information.
23144 * g_menu_prepend_section:
23146 * @label: (allow-none): the section label, or %NULL
23147 * @section: a #GMenuModel with the items of the section
23149 * Convenience function for prepending a section menu item to the start
23150 * of @menu. Combine g_menu_item_new_section() and g_menu_insert_item() for
23151 * a more flexible alternative.
23158 * g_menu_prepend_submenu:
23160 * @label: (allow-none): the section label, or %NULL
23161 * @submenu: a #GMenuModel with the items of the submenu
23163 * Convenience function for prepending a submenu menu item to the start
23164 * of @menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for
23165 * a more flexible alternative.
23174 * @position: the position of the item to remove
23176 * Removes an item from the menu.
23178 * @position gives the index of the item to remove.
23180 * It is an error if position is not in range the range from 0 to one
23181 * less than the number of items in the menu.
23183 * It is not possible to remove items by identity since items are added
23184 * to the menu simply by copying their links and attributes (ie:
23185 * identity of the item itself is not preserved).
23192 * g_mount_can_eject:
23193 * @mount: a #GMount.
23195 * Checks if @mount can be eject.
23197 * Returns: %TRUE if the @mount can be ejected.
23202 * g_mount_can_unmount:
23203 * @mount: a #GMount.
23205 * Checks if @mount can be mounted.
23207 * Returns: %TRUE if the @mount can be unmounted.
23213 * @mount: a #GMount.
23214 * @flags: flags affecting the unmount if required for eject
23215 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23216 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23217 * @user_data: user data passed to @callback.
23219 * Ejects a mount. This is an asynchronous operation, and is
23220 * finished by calling g_mount_eject_finish() with the @mount
23221 * and #GAsyncResult data returned in the @callback.
23223 * Deprecated: 2.22: Use g_mount_eject_with_operation() instead.
23228 * g_mount_eject_finish:
23229 * @mount: a #GMount.
23230 * @result: a #GAsyncResult.
23231 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23233 * Finishes ejecting a mount. If any errors occurred during the operation,
23234 * @error will be set to contain the errors and %FALSE will be returned.
23236 * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
23237 * Deprecated: 2.22: Use g_mount_eject_with_operation_finish() instead.
23242 * g_mount_eject_with_operation:
23243 * @mount: a #GMount.
23244 * @flags: flags affecting the unmount if required for eject
23245 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23246 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23247 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23248 * @user_data: user data passed to @callback.
23250 * Ejects a mount. This is an asynchronous operation, and is
23251 * finished by calling g_mount_eject_with_operation_finish() with the @mount
23252 * and #GAsyncResult data returned in the @callback.
23259 * g_mount_eject_with_operation_finish:
23260 * @mount: a #GMount.
23261 * @result: a #GAsyncResult.
23262 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23264 * Finishes ejecting a mount. If any errors occurred during the operation,
23265 * @error will be set to contain the errors and %FALSE will be returned.
23267 * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
23273 * g_mount_get_default_location:
23274 * @mount: a #GMount.
23276 * Gets the default location of @mount. The default location of the given
23277 * @mount is a path that reflects the main entry point for the user (e.g.
23278 * the home directory, or the root of the volume).
23280 * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
23285 * g_mount_get_drive:
23286 * @mount: a #GMount.
23288 * Gets the drive for the @mount.
23290 * This is a convenience method for getting the #GVolume and then
23291 * using that object to get the #GDrive.
23293 * 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.
23298 * g_mount_get_icon:
23299 * @mount: a #GMount.
23301 * Gets the icon for @mount.
23303 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
23308 * g_mount_get_name:
23309 * @mount: a #GMount.
23311 * Gets the name of @mount.
23313 * Returns: the name for the given @mount. The returned string should be freed with g_free() when no longer needed.
23318 * g_mount_get_root:
23319 * @mount: a #GMount.
23321 * Gets the root directory on @mount.
23323 * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
23328 * g_mount_get_sort_key:
23329 * @mount: A #GMount.
23331 * Gets the sort key for @mount, if any.
23333 * Returns: Sorting key for @mount or %NULL if no such key is available.
23339 * g_mount_get_uuid:
23340 * @mount: a #GMount.
23342 * Gets the UUID for the @mount. The reference is typically based on
23343 * the file system UUID for the mount in question and should be
23344 * considered an opaque string. Returns %NULL if there is no UUID
23347 * 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.
23352 * g_mount_get_volume:
23353 * @mount: a #GMount.
23355 * Gets the volume for the @mount.
23357 * 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.
23362 * g_mount_guess_content_type:
23363 * @mount: a #GMount
23364 * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
23365 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
23366 * @callback: a #GAsyncReadyCallback
23367 * @user_data: user data passed to @callback
23369 * Tries to guess the type of content stored on @mount. Returns one or
23370 * more textual identifiers of well-known content types (typically
23371 * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
23372 * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23373 * specification for more on x-content types.
23375 * This is an asynchronous operation (see
23376 * g_mount_guess_content_type_sync() for the synchronous version), and
23377 * is finished by calling g_mount_guess_content_type_finish() with the
23378 * @mount and #GAsyncResult data returned in the @callback.
23385 * g_mount_guess_content_type_finish:
23386 * @mount: a #GMount
23387 * @result: a #GAsyncResult
23388 * @error: a #GError location to store the error occurring, or %NULL to ignore
23390 * Finishes guessing content types of @mount. If any errors occurred
23391 * during the operation, @error will be set to contain the errors and
23392 * %FALSE will be returned. In particular, you may get an
23393 * %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content
23396 * 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.
23402 * g_mount_guess_content_type_sync:
23403 * @mount: a #GMount
23404 * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
23405 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
23406 * @error: a #GError location to store the error occurring, or %NULL to ignore
23408 * Tries to guess the type of content stored on @mount. Returns one or
23409 * more textual identifiers of well-known content types (typically
23410 * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
23411 * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23412 * specification for more on x-content types.
23414 * This is an synchronous operation and as such may block doing IO;
23415 * see g_mount_guess_content_type() for the asynchronous version.
23417 * 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.
23423 * g_mount_is_shadowed:
23424 * @mount: A #GMount.
23426 * Determines if @mount is shadowed. Applications or libraries should
23427 * avoid displaying @mount in the user interface if it is shadowed.
23429 * A mount is said to be shadowed if there exists one or more user
23430 * visible objects (currently #GMount objects) with a root that is
23431 * inside the root of @mount.
23433 * One application of shadow mounts is when exposing a single file
23434 * system that is used to address several logical volumes. In this
23435 * situation, a #GVolumeMonitor implementation would create two
23436 * #GVolume objects (for example, one for the camera functionality of
23437 * the device and one for a SD card reader on the device) with
23438 * activation URIs <literal>gphoto2://[usb:001,002]/store1/</literal>
23439 * and <literal>gphoto2://[usb:001,002]/store2/</literal>. When the
23440 * underlying mount (with root
23441 * <literal>gphoto2://[usb:001,002]/</literal>) is mounted, said
23442 * #GVolumeMonitor implementation would create two #GMount objects
23443 * (each with their root matching the corresponding volume activation
23444 * root) that would shadow the original mount.
23446 * The proxy monitor in GVfs 2.26 and later, automatically creates and
23447 * manage shadow mounts (and shadows the underlying mount) if the
23448 * activation root on a #GVolume is set.
23450 * Returns: %TRUE if @mount is shadowed.
23456 * g_mount_operation_get_anonymous:
23457 * @op: a #GMountOperation.
23459 * Check to see whether the mount operation is being used
23460 * for an anonymous user.
23462 * Returns: %TRUE if mount operation is anonymous.
23467 * g_mount_operation_get_choice:
23468 * @op: a #GMountOperation.
23470 * Gets a choice from the mount operation.
23472 * Returns: an integer containing an index of the user's choice from the choice's list, or %0.
23477 * g_mount_operation_get_domain:
23478 * @op: a #GMountOperation.
23480 * Gets the domain of the mount operation.
23482 * Returns: a string set to the domain.
23487 * g_mount_operation_get_password:
23488 * @op: a #GMountOperation.
23490 * Gets a password from the mount operation.
23492 * Returns: a string containing the password within @op.
23497 * g_mount_operation_get_password_save:
23498 * @op: a #GMountOperation.
23500 * Gets the state of saving passwords for the mount operation.
23502 * Returns: a #GPasswordSave flag.
23507 * g_mount_operation_get_username:
23508 * @op: a #GMountOperation.
23510 * Get the user name from the mount operation.
23512 * Returns: a string containing the user name.
23517 * g_mount_operation_new:
23519 * Creates a new mount operation.
23521 * Returns: a #GMountOperation.
23526 * g_mount_operation_reply:
23527 * @op: a #GMountOperation
23528 * @result: a #GMountOperationResult
23530 * Emits the #GMountOperation::reply signal.
23535 * g_mount_operation_set_anonymous:
23536 * @op: a #GMountOperation.
23537 * @anonymous: boolean value.
23539 * Sets the mount operation to use an anonymous user if @anonymous is %TRUE.
23544 * g_mount_operation_set_choice:
23545 * @op: a #GMountOperation.
23546 * @choice: an integer.
23548 * Sets a default choice for the mount operation.
23553 * g_mount_operation_set_domain:
23554 * @op: a #GMountOperation.
23555 * @domain: the domain to set.
23557 * Sets the mount operation's domain.
23562 * g_mount_operation_set_password:
23563 * @op: a #GMountOperation.
23564 * @password: password to set.
23566 * Sets the mount operation's password to @password.
23571 * g_mount_operation_set_password_save:
23572 * @op: a #GMountOperation.
23573 * @save: a set of #GPasswordSave flags.
23575 * Sets the state of saving passwords for the mount operation.
23580 * g_mount_operation_set_username:
23581 * @op: a #GMountOperation.
23582 * @username: input username.
23584 * Sets the user name within @op to @username.
23590 * @mount: a #GMount.
23591 * @flags: flags affecting the operation
23592 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23593 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23594 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23595 * @user_data: user data passed to @callback.
23597 * Remounts a mount. This is an asynchronous operation, and is
23598 * finished by calling g_mount_remount_finish() with the @mount
23599 * and #GAsyncResults data returned in the @callback.
23601 * Remounting is useful when some setting affecting the operation
23602 * of the volume has been changed, as these may need a remount to
23603 * take affect. While this is semantically equivalent with unmounting
23604 * and then remounting not all backends might need to actually be
23610 * g_mount_remount_finish:
23611 * @mount: a #GMount.
23612 * @result: a #GAsyncResult.
23613 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23615 * Finishes remounting a mount. If any errors occurred during the operation,
23616 * @error will be set to contain the errors and %FALSE will be returned.
23618 * Returns: %TRUE if the mount was successfully remounted. %FALSE otherwise.
23624 * @mount: A #GMount.
23626 * Increments the shadow count on @mount. Usually used by
23627 * #GVolumeMonitor implementations when creating a shadow mount for
23628 * @mount, see g_mount_is_shadowed() for more information. The caller
23629 * will need to emit the #GMount::changed signal on @mount manually.
23637 * @mount: a #GMount.
23638 * @flags: flags affecting the operation
23639 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23640 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23641 * @user_data: user data passed to @callback.
23643 * Unmounts a mount. This is an asynchronous operation, and is
23644 * finished by calling g_mount_unmount_finish() with the @mount
23645 * and #GAsyncResult data returned in the @callback.
23647 * Deprecated: 2.22: Use g_mount_unmount_with_operation() instead.
23652 * g_mount_unmount_finish:
23653 * @mount: a #GMount.
23654 * @result: a #GAsyncResult.
23655 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23657 * Finishes unmounting a mount. If any errors occurred during the operation,
23658 * @error will be set to contain the errors and %FALSE will be returned.
23660 * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
23661 * Deprecated: 2.22: Use g_mount_unmount_with_operation_finish() instead.
23666 * g_mount_unmount_with_operation:
23667 * @mount: a #GMount.
23668 * @flags: flags affecting the operation
23669 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23670 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23671 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23672 * @user_data: user data passed to @callback.
23674 * Unmounts a mount. This is an asynchronous operation, and is
23675 * finished by calling g_mount_unmount_with_operation_finish() with the @mount
23676 * and #GAsyncResult data returned in the @callback.
23683 * g_mount_unmount_with_operation_finish:
23684 * @mount: a #GMount.
23685 * @result: a #GAsyncResult.
23686 * @error: a #GError location to store the error occurring, or %NULL to ignore.
23688 * Finishes unmounting a mount. If any errors occurred during the operation,
23689 * @error will be set to contain the errors and %FALSE will be returned.
23691 * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
23697 * g_mount_unshadow:
23698 * @mount: A #GMount.
23700 * Decrements the shadow count on @mount. Usually used by
23701 * #GVolumeMonitor implementations when destroying a shadow mount for
23702 * @mount, see g_mount_is_shadowed() for more information. The caller
23703 * will need to emit the #GMount::changed signal on @mount manually.
23710 * g_network_address_get_hostname:
23711 * @addr: a #GNetworkAddress
23713 * Gets @addr's hostname. This might be either UTF-8 or ASCII-encoded,
23714 * depending on what @addr was created with.
23716 * Returns: @addr's hostname
23722 * g_network_address_get_port:
23723 * @addr: a #GNetworkAddress
23725 * Gets @addr's port number
23727 * Returns: @addr's port (which may be 0)
23733 * g_network_address_get_scheme:
23734 * @addr: a #GNetworkAddress
23736 * Gets @addr's scheme
23738 * Returns: @addr's scheme (%NULL if not built from URI)
23744 * g_network_address_new:
23745 * @hostname: the hostname
23748 * Creates a new #GSocketConnectable for connecting to the given
23749 * @hostname and @port.
23751 * Returns: (transfer full) (type GNetworkAddress): the new #GNetworkAddress
23757 * g_network_address_parse:
23758 * @host_and_port: the hostname and optionally a port
23759 * @default_port: the default port if not in @host_and_port
23760 * @error: a pointer to a #GError, or %NULL
23762 * Creates a new #GSocketConnectable for connecting to the given
23763 * @hostname and @port. May fail and return %NULL in case
23764 * parsing @host_and_port fails.
23766 * @host_and_port may be in any of a number of recognised formats; an IPv6
23767 * address, an IPv4 address, or a domain name (in which case a DNS
23768 * lookup is performed). Quoting with [] is supported for all address
23769 * types. A port override may be specified in the usual way with a
23772 * If no port is specified in @host_and_port then @default_port will be
23773 * used as the port number to connect to.
23775 * In general, @host_and_port is expected to be provided by the user
23776 * (allowing them to give the hostname, and a port overide if necessary)
23777 * and @default_port is expected to be provided by the application.
23779 * (The port component of @host_and_port can also be specified as a
23780 * service name rather than as a numeric port, but this functionality
23781 * is deprecated, because it depends on the contents of /etc/services,
23782 * which is generally quite sparse on platforms other than Linux.)
23784 * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
23790 * g_network_address_parse_uri:
23791 * @uri: the hostname and optionally a port
23792 * @default_port: The default port if none is found in the URI
23793 * @error: a pointer to a #GError, or %NULL
23795 * Creates a new #GSocketConnectable for connecting to the given
23796 * @uri. May fail and return %NULL in case parsing @uri fails.
23798 * Using this rather than g_network_address_new() or
23799 * g_network_address_parse() allows #GSocketClient to determine
23800 * when to use application-specific proxy protocols.
23802 * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
23808 * g_network_monitor_base_add_network:
23809 * @monitor: the #GNetworkMonitorBase
23810 * @network: a #GInetAddressMask
23812 * Adds @network to @monitor's list of available networks.
23819 * g_network_monitor_base_remove_network:
23820 * @monitor: the #GNetworkMonitorBase
23821 * @network: a #GInetAddressMask
23823 * Removes @network from @monitor's list of available networks.
23830 * g_network_monitor_base_set_networks:
23831 * @monitor: the #GNetworkMonitorBase
23832 * @networks: (array length=length): an array of #GInetAddressMask
23833 * @length: length of @networks
23835 * Drops @monitor's current list of available networks and replaces
23836 * it with @networks.
23841 * g_network_monitor_can_reach:
23842 * @monitor: a #GNetworkMonitor
23843 * @connectable: a #GSocketConnectable
23844 * @cancellable: (allow-none): a #GCancellable, or %NULL
23845 * @error: return location for a #GError, or %NULL
23847 * Attempts to determine whether or not the host pointed to by
23848 * @connectable can be reached, without actually trying to connect to
23851 * This may return %TRUE even when #GNetworkMonitor:network-available
23852 * is %FALSE, if, for example, @monitor can determine that
23853 * @connectable refers to a host on a local network.
23855 * If @monitor believes that an attempt to connect to @connectable
23856 * will succeed, it will return %TRUE. Otherwise, it will return
23857 * %FALSE and set @error to an appropriate error (such as
23858 * %G_IO_ERROR_HOST_UNREACHABLE).
23860 * Note that although this does not attempt to connect to
23861 * @connectable, it may still block for a brief period of time (eg,
23862 * trying to do multicast DNS on the local network), so if you do not
23863 * want to block, you should use g_network_monitor_can_reach_async().
23865 * Returns: %TRUE if @connectable is reachable, %FALSE if not.
23871 * g_network_monitor_can_reach_async:
23872 * @monitor: a #GNetworkMonitor
23873 * @connectable: a #GSocketConnectable
23874 * @cancellable: (allow-none): a #GCancellable, or %NULL
23875 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
23876 * @user_data: (closure): the data to pass to callback function
23878 * Asynchronously attempts to determine whether or not the host
23879 * pointed to by @connectable can be reached, without actually
23880 * trying to connect to it.
23882 * For more details, see g_network_monitor_can_reach().
23884 * When the operation is finished, @callback will be called.
23885 * You can then call g_network_monitor_can_reach_finish()
23886 * to get the result of the operation.
23891 * g_network_monitor_can_reach_finish:
23892 * @monitor: a #GNetworkMonitor
23893 * @result: a #GAsyncResult
23894 * @error: return location for errors, or %NULL
23896 * Finishes an async network connectivity test.
23897 * See g_network_monitor_can_reach_async().
23899 * Returns: %TRUE if network is reachable, %FALSE if not.
23904 * g_network_monitor_get_default:
23906 * Gets the default #GNetworkMonitor for the system.
23908 * Returns: (transfer none): a #GNetworkMonitor
23914 * g_network_monitor_get_network_available:
23915 * @monitor: the #GNetworkMonitor
23917 * Checks if the network is available. "Available" here means that the
23918 * system has a default route available for at least one of IPv4 or
23919 * IPv6. It does not necessarily imply that the public Internet is
23920 * reachable. See #GNetworkMonitor:network-available for more details.
23922 * Returns: whether the network is available
23928 * g_network_service_get_domain:
23929 * @srv: a #GNetworkService
23931 * Gets the domain that @srv serves. This might be either UTF-8 or
23932 * ASCII-encoded, depending on what @srv was created with.
23934 * Returns: @srv's domain name
23940 * g_network_service_get_protocol:
23941 * @srv: a #GNetworkService
23943 * Gets @srv's protocol name (eg, "tcp").
23945 * Returns: @srv's protocol name
23951 * g_network_service_get_scheme:
23952 * @srv: a #GNetworkService
23954 * Get's the URI scheme used to resolve proxies. By default, the service name
23955 * is used as scheme.
23957 * Returns: @srv's scheme name
23963 * g_network_service_get_service:
23964 * @srv: a #GNetworkService
23966 * Gets @srv's service name (eg, "ldap").
23968 * Returns: @srv's service name
23974 * g_network_service_new:
23975 * @service: the service type to look up (eg, "ldap")
23976 * @protocol: the networking protocol to use for @service (eg, "tcp")
23977 * @domain: the DNS domain to look up the service in
23979 * Creates a new #GNetworkService representing the given @service,
23980 * @protocol, and @domain. This will initially be unresolved; use the
23981 * #GSocketConnectable interface to resolve it.
23983 * Returns: (transfer full) (type GNetworkService): a new #GNetworkService
23989 * g_network_service_set_scheme:
23990 * @srv: a #GNetworkService
23991 * @scheme: a URI scheme
23993 * Set's the URI scheme used to resolve proxies. By default, the service name
23994 * is used as scheme.
24001 * g_null_settings_backend_new:
24003 * Creates a readonly #GSettingsBackend.
24005 * This backend does not allow changes to settings, so all settings
24006 * will always have their default values.
24008 * Returns: (transfer full): a newly created #GSettingsBackend
24014 * g_output_stream_clear_pending:
24015 * @stream: output stream
24017 * Clears the pending flag on @stream.
24022 * g_output_stream_close:
24023 * @stream: A #GOutputStream.
24024 * @cancellable: (allow-none): optional cancellable object
24025 * @error: location to store the error occurring, or %NULL to ignore
24027 * Closes the stream, releasing resources related to it.
24029 * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
24030 * Closing a stream multiple times will not return an error.
24032 * Closing a stream will automatically flush any outstanding buffers in the
24035 * Streams will be automatically closed when the last reference
24036 * is dropped, but you might want to call this function to make sure
24037 * resources are released as early as possible.
24039 * Some streams might keep the backing store of the stream (e.g. a file descriptor)
24040 * open after the stream is closed. See the documentation for the individual
24041 * stream for details.
24043 * On failure the first error that happened will be reported, but the close
24044 * operation will finish as much as possible. A stream that failed to
24045 * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
24046 * is important to check and report the error to the user, otherwise
24047 * there might be a loss of data as all data might not be written.
24049 * If @cancellable is not %NULL, then the operation can be cancelled by
24050 * triggering the cancellable object from another thread. If the operation
24051 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24052 * Cancelling a close will still leave the stream closed, but there some streams
24053 * can use a faster close that doesn't block to e.g. check errors. On
24054 * cancellation (as with any error) there is no guarantee that all written
24055 * data will reach the target.
24057 * Returns: %TRUE on success, %FALSE on failure
24062 * g_output_stream_close_async:
24063 * @stream: A #GOutputStream.
24064 * @io_priority: the io priority of the request.
24065 * @cancellable: (allow-none): optional cancellable object
24066 * @callback: (scope async): callback to call when the request is satisfied
24067 * @user_data: (closure): the data to pass to callback function
24069 * Requests an asynchronous close of the stream, releasing resources
24070 * related to it. When the operation is finished @callback will be
24071 * called. You can then call g_output_stream_close_finish() to get
24072 * the result of the operation.
24074 * For behaviour details see g_output_stream_close().
24076 * The asyncronous methods have a default fallback that uses threads
24077 * to implement asynchronicity, so they are optional for inheriting
24078 * classes. However, if you override one you must override all.
24083 * g_output_stream_close_finish:
24084 * @stream: a #GOutputStream.
24085 * @result: a #GAsyncResult.
24086 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24088 * Closes an output stream.
24090 * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
24095 * g_output_stream_flush:
24096 * @stream: a #GOutputStream.
24097 * @cancellable: (allow-none): optional cancellable object
24098 * @error: location to store the error occurring, or %NULL to ignore
24100 * Forces a write of all user-space buffered data for the given
24101 * @stream. Will block during the operation. Closing the stream will
24102 * implicitly cause a flush.
24104 * This function is optional for inherited classes.
24106 * If @cancellable is not %NULL, then the operation can be cancelled by
24107 * triggering the cancellable object from another thread. If the operation
24108 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24110 * Returns: %TRUE on success, %FALSE on error
24115 * g_output_stream_flush_async:
24116 * @stream: a #GOutputStream.
24117 * @io_priority: the io priority of the request.
24118 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24119 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
24120 * @user_data: (closure): the data to pass to callback function
24122 * Forces an asynchronous write of all user-space buffered data for
24123 * the given @stream.
24124 * For behaviour details see g_output_stream_flush().
24126 * When the operation is finished @callback will be
24127 * called. You can then call g_output_stream_flush_finish() to get the
24128 * result of the operation.
24133 * g_output_stream_flush_finish:
24134 * @stream: a #GOutputStream.
24135 * @result: a GAsyncResult.
24136 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24138 * Finishes flushing an output stream.
24140 * Returns: %TRUE if flush operation succeeded, %FALSE otherwise.
24145 * g_output_stream_has_pending:
24146 * @stream: a #GOutputStream.
24148 * Checks if an ouput stream has pending actions.
24150 * Returns: %TRUE if @stream has pending actions.
24155 * g_output_stream_is_closed:
24156 * @stream: a #GOutputStream.
24158 * Checks if an output stream has already been closed.
24160 * Returns: %TRUE if @stream is closed. %FALSE otherwise.
24165 * g_output_stream_is_closing:
24166 * @stream: a #GOutputStream.
24168 * Checks if an output stream is being closed. This can be
24169 * used inside e.g. a flush implementation to see if the
24170 * flush (or other i/o operation) is called from within
24171 * the closing operation.
24173 * Returns: %TRUE if @stream is being closed. %FALSE otherwise.
24179 * g_output_stream_set_pending:
24180 * @stream: a #GOutputStream.
24181 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24183 * Sets @stream to have actions pending. If the pending flag is
24184 * already set or @stream is closed, it will return %FALSE and set
24187 * Returns: %TRUE if pending was previously unset and is now set.
24192 * g_output_stream_splice:
24193 * @stream: a #GOutputStream.
24194 * @source: a #GInputStream.
24195 * @flags: a set of #GOutputStreamSpliceFlags.
24196 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24197 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24199 * Splices an input stream into an output stream.
24201 * 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.
24206 * g_output_stream_splice_async:
24207 * @stream: a #GOutputStream.
24208 * @source: a #GInputStream.
24209 * @flags: a set of #GOutputStreamSpliceFlags.
24210 * @io_priority: the io priority of the request.
24211 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24212 * @callback: (scope async): a #GAsyncReadyCallback.
24213 * @user_data: (closure): user data passed to @callback.
24215 * Splices a stream asynchronously.
24216 * When the operation is finished @callback will be called.
24217 * You can then call g_output_stream_splice_finish() to get the
24218 * result of the operation.
24220 * For the synchronous, blocking version of this function, see
24221 * g_output_stream_splice().
24226 * g_output_stream_splice_finish:
24227 * @stream: a #GOutputStream.
24228 * @result: a #GAsyncResult.
24229 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24231 * Finishes an asynchronous stream splice operation.
24233 * 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.
24238 * g_output_stream_write:
24239 * @stream: a #GOutputStream.
24240 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24241 * @count: the number of bytes to write
24242 * @cancellable: (allow-none): optional cancellable object
24243 * @error: location to store the error occurring, or %NULL to ignore
24245 * Tries to write @count bytes from @buffer into the stream. Will block
24246 * during the operation.
24248 * If count is 0, returns 0 and does nothing. A value of @count
24249 * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
24251 * On success, the number of bytes written to the stream is returned.
24252 * It is not an error if this is not the same as the requested size, as it
24253 * can happen e.g. on a partial I/O error, or if there is not enough
24254 * storage in the stream. All writes block until at least one byte
24255 * is written or an error occurs; 0 is never returned (unless
24258 * If @cancellable is not %NULL, then the operation can be cancelled by
24259 * triggering the cancellable object from another thread. If the operation
24260 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24261 * operation was partially finished when the operation was cancelled the
24262 * partial result will be returned, without an error.
24264 * On error -1 is returned and @error is set accordingly.
24266 * Virtual: write_fn
24267 * Returns: Number of bytes written, or -1 on error
24272 * g_output_stream_write_all:
24273 * @stream: a #GOutputStream.
24274 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24275 * @count: the number of bytes to write
24276 * @bytes_written: (out): location to store the number of bytes that was written to the stream
24277 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24278 * @error: location to store the error occurring, or %NULL to ignore
24280 * Tries to write @count bytes from @buffer into the stream. Will block
24281 * during the operation.
24283 * This function is similar to g_output_stream_write(), except it tries to
24284 * write as many bytes as requested, only stopping on an error.
24286 * On a successful write of @count bytes, %TRUE is returned, and @bytes_written
24287 * is set to @count.
24289 * If there is an error during the operation %FALSE is returned and @error
24290 * is set to indicate the error status, @bytes_written is updated to contain
24291 * the number of bytes written into the stream before the error occurred.
24293 * Returns: %TRUE on success, %FALSE if there was an error
24298 * g_output_stream_write_async:
24299 * @stream: A #GOutputStream.
24300 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24301 * @count: the number of bytes to write
24302 * @io_priority: the io priority of the request.
24303 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24304 * @callback: (scope async): callback to call when the request is satisfied
24305 * @user_data: (closure): the data to pass to callback function
24307 * Request an asynchronous write of @count bytes from @buffer into
24308 * the stream. When the operation is finished @callback will be called.
24309 * You can then call g_output_stream_write_finish() to get the result of the
24312 * During an async request no other sync and async calls are allowed,
24313 * and will result in %G_IO_ERROR_PENDING errors.
24315 * A value of @count larger than %G_MAXSSIZE will cause a
24316 * %G_IO_ERROR_INVALID_ARGUMENT error.
24318 * On success, the number of bytes written will be passed to the
24319 * @callback. It is not an error if this is not the same as the
24320 * requested size, as it can happen e.g. on a partial I/O error,
24321 * but generally we try to write as many bytes as requested.
24323 * You are guaranteed that this method will never fail with
24324 * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
24325 * method will just wait until this changes.
24327 * Any outstanding I/O request with higher priority (lower numerical
24328 * value) will be executed before an outstanding request with lower
24329 * priority. Default priority is %G_PRIORITY_DEFAULT.
24331 * The asyncronous methods have a default fallback that uses threads
24332 * to implement asynchronicity, so they are optional for inheriting
24333 * classes. However, if you override one you must override all.
24335 * For the synchronous, blocking version of this function, see
24336 * g_output_stream_write().
24341 * g_output_stream_write_bytes:
24342 * @stream: a #GOutputStream.
24343 * @bytes: the #GBytes to write
24344 * @cancellable: (allow-none): optional cancellable object
24345 * @error: location to store the error occurring, or %NULL to ignore
24347 * Tries to write the data from @bytes into the stream. Will block
24348 * during the operation.
24350 * If @bytes is 0-length, returns 0 and does nothing. A #GBytes larger
24351 * than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
24353 * On success, the number of bytes written to the stream is returned.
24354 * It is not an error if this is not the same as the requested size, as it
24355 * can happen e.g. on a partial I/O error, or if there is not enough
24356 * storage in the stream. All writes block until at least one byte
24357 * is written or an error occurs; 0 is never returned (unless
24358 * the size of @bytes is 0).
24360 * If @cancellable is not %NULL, then the operation can be cancelled by
24361 * triggering the cancellable object from another thread. If the operation
24362 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24363 * operation was partially finished when the operation was cancelled the
24364 * partial result will be returned, without an error.
24366 * On error -1 is returned and @error is set accordingly.
24368 * Returns: Number of bytes written, or -1 on error
24373 * g_output_stream_write_bytes_async:
24374 * @stream: A #GOutputStream.
24375 * @bytes: The bytes to write
24376 * @io_priority: the io priority of the request.
24377 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24378 * @callback: (scope async): callback to call when the request is satisfied
24379 * @user_data: (closure): the data to pass to callback function
24381 * Request an asynchronous write of the data in @bytes to the stream.
24382 * When the operation is finished @callback will be called. You can
24383 * then call g_output_stream_write_bytes_finish() to get the result of
24386 * During an async request no other sync and async calls are allowed,
24387 * and will result in %G_IO_ERROR_PENDING errors.
24389 * A #GBytes larger than %G_MAXSSIZE will cause a
24390 * %G_IO_ERROR_INVALID_ARGUMENT error.
24392 * On success, the number of bytes written will be passed to the
24393 * @callback. It is not an error if this is not the same as the
24394 * requested size, as it can happen e.g. on a partial I/O error,
24395 * but generally we try to write as many bytes as requested.
24397 * You are guaranteed that this method will never fail with
24398 * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
24399 * method will just wait until this changes.
24401 * Any outstanding I/O request with higher priority (lower numerical
24402 * value) will be executed before an outstanding request with lower
24403 * priority. Default priority is %G_PRIORITY_DEFAULT.
24405 * For the synchronous, blocking version of this function, see
24406 * g_output_stream_write_bytes().
24411 * g_output_stream_write_bytes_finish:
24412 * @stream: a #GOutputStream.
24413 * @result: a #GAsyncResult.
24414 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24416 * Finishes a stream write-from-#GBytes operation.
24418 * Returns: a #gssize containing the number of bytes written to the stream.
24423 * g_output_stream_write_finish:
24424 * @stream: a #GOutputStream.
24425 * @result: a #GAsyncResult.
24426 * @error: a #GError location to store the error occurring, or %NULL to ignore.
24428 * Finishes a stream write operation.
24430 * Returns: a #gssize containing the number of bytes written to the stream.
24435 * g_permission_acquire:
24436 * @permission: a #GPermission instance
24437 * @cancellable: (allow-none): a #GCancellable, or %NULL
24438 * @error: a pointer to a %NULL #GError, or %NULL
24440 * Attempts to acquire the permission represented by @permission.
24442 * The precise method by which this happens depends on the permission
24443 * and the underlying authentication mechanism. A simple example is
24444 * that a dialog may appear asking the user to enter their password.
24446 * You should check with g_permission_get_can_acquire() before calling
24449 * If the permission is acquired then %TRUE is returned. Otherwise,
24450 * %FALSE is returned and @error is set appropriately.
24452 * This call is blocking, likely for a very long time (in the case that
24453 * user interaction is required). See g_permission_acquire_async() for
24454 * the non-blocking version.
24456 * Returns: %TRUE if the permission was successfully acquired
24462 * g_permission_acquire_async:
24463 * @permission: a #GPermission instance
24464 * @cancellable: (allow-none): a #GCancellable, or %NULL
24465 * @callback: the #GAsyncReadyCallback to call when done
24466 * @user_data: the user data to pass to @callback
24468 * Attempts to acquire the permission represented by @permission.
24470 * This is the first half of the asynchronous version of
24471 * g_permission_acquire().
24478 * g_permission_acquire_finish:
24479 * @permission: a #GPermission instance
24480 * @result: the #GAsyncResult given to the #GAsyncReadyCallback
24481 * @error: a pointer to a %NULL #GError, or %NULL
24483 * Collects the result of attempting to acquire the permission
24484 * represented by @permission.
24486 * This is the second half of the asynchronous version of
24487 * g_permission_acquire().
24489 * Returns: %TRUE if the permission was successfully acquired
24495 * g_permission_get_allowed:
24496 * @permission: a #GPermission instance
24498 * Gets the value of the 'allowed' property. This property is %TRUE if
24499 * the caller currently has permission to perform the action that
24500 * @permission represents the permission to perform.
24502 * Returns: the value of the 'allowed' property
24508 * g_permission_get_can_acquire:
24509 * @permission: a #GPermission instance
24511 * Gets the value of the 'can-acquire' property. This property is %TRUE
24512 * if it is generally possible to acquire the permission by calling
24513 * g_permission_acquire().
24515 * Returns: the value of the 'can-acquire' property
24521 * g_permission_get_can_release:
24522 * @permission: a #GPermission instance
24524 * Gets the value of the 'can-release' property. This property is %TRUE
24525 * if it is generally possible to release the permission by calling
24526 * g_permission_release().
24528 * Returns: the value of the 'can-release' property
24534 * g_permission_impl_update:
24535 * @permission: a #GPermission instance
24536 * @allowed: the new value for the 'allowed' property
24537 * @can_acquire: the new value for the 'can-acquire' property
24538 * @can_release: the new value for the 'can-release' property
24540 * This function is called by the #GPermission implementation to update
24541 * the properties of the permission. You should never call this
24542 * function except from a #GPermission implementation.
24544 * GObject notify signals are generated, as appropriate.
24551 * g_permission_release:
24552 * @permission: a #GPermission instance
24553 * @cancellable: (allow-none): a #GCancellable, or %NULL
24554 * @error: a pointer to a %NULL #GError, or %NULL
24556 * Attempts to release the permission represented by @permission.
24558 * The precise method by which this happens depends on the permission
24559 * and the underlying authentication mechanism. In most cases the
24560 * permission will be dropped immediately without further action.
24562 * You should check with g_permission_get_can_release() before calling
24565 * If the permission is released then %TRUE is returned. Otherwise,
24566 * %FALSE is returned and @error is set appropriately.
24568 * This call is blocking, likely for a very long time (in the case that
24569 * user interaction is required). See g_permission_release_async() for
24570 * the non-blocking version.
24572 * Returns: %TRUE if the permission was successfully released
24578 * g_permission_release_async:
24579 * @permission: a #GPermission instance
24580 * @cancellable: (allow-none): a #GCancellable, or %NULL
24581 * @callback: the #GAsyncReadyCallback to call when done
24582 * @user_data: the user data to pass to @callback
24584 * Attempts to release the permission represented by @permission.
24586 * This is the first half of the asynchronous version of
24587 * g_permission_release().
24594 * g_permission_release_finish:
24595 * @permission: a #GPermission instance
24596 * @result: the #GAsyncResult given to the #GAsyncReadyCallback
24597 * @error: a pointer to a %NULL #GError, or %NULL
24599 * Collects the result of attempting to release the permission
24600 * represented by @permission.
24602 * This is the second half of the asynchronous version of
24603 * g_permission_release().
24605 * Returns: %TRUE if the permission was successfully released
24611 * g_poll_file_monitor_new:
24614 * Polls @file for changes.
24616 * Returns: a new #GFileMonitor for the given #GFile.
24621 * g_pollable_input_stream_can_poll:
24622 * @stream: a #GPollableInputStream.
24624 * Checks if @stream is actually pollable. Some classes may implement
24625 * #GPollableInputStream but have only certain instances of that class
24626 * be pollable. If this method returns %FALSE, then the behavior of
24627 * other #GPollableInputStream methods is undefined.
24629 * For any given stream, the value returned by this method is constant;
24630 * a stream cannot switch from pollable to non-pollable or vice versa.
24632 * Returns: %TRUE if @stream is pollable, %FALSE if not.
24638 * g_pollable_input_stream_create_source:
24639 * @stream: a #GPollableInputStream.
24640 * @cancellable: (allow-none): a #GCancellable, or %NULL
24642 * Creates a #GSource that triggers when @stream can be read, or
24643 * @cancellable is triggered or an error occurs. The callback on the
24644 * source is of the #GPollableSourceFunc type.
24646 * As with g_pollable_input_stream_is_readable(), it is possible that
24647 * the stream may not actually be readable even after the source
24648 * triggers, so you should use g_pollable_input_stream_read_nonblocking()
24649 * rather than g_input_stream_read() from the callback.
24651 * Returns: (transfer full): a new #GSource
24657 * g_pollable_input_stream_is_readable:
24658 * @stream: a #GPollableInputStream.
24660 * Checks if @stream can be read.
24662 * Note that some stream types may not be able to implement this 100%
24663 * reliably, and it is possible that a call to g_input_stream_read()
24664 * after this returns %TRUE would still block. To guarantee
24665 * non-blocking behavior, you should always use
24666 * g_pollable_input_stream_read_nonblocking(), which will return a
24667 * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
24669 * 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.
24675 * g_pollable_input_stream_read_nonblocking:
24676 * @stream: a #GPollableInputStream
24677 * @buffer: a buffer to read data into (which should be at least @count bytes long).
24678 * @count: the number of bytes you want to read
24679 * @cancellable: (allow-none): a #GCancellable, or %NULL
24680 * @error: #GError for error reporting, or %NULL to ignore.
24682 * Attempts to read up to @count bytes from @stream into @buffer, as
24683 * with g_input_stream_read(). If @stream is not currently readable,
24684 * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
24685 * use g_pollable_input_stream_create_source() to create a #GSource
24686 * that will be triggered when @stream is readable.
24688 * Note that since this method never blocks, you cannot actually
24689 * use @cancellable to cancel it. However, it will return an error
24690 * if @cancellable has already been cancelled when you call, which
24691 * may happen if you call this method after a source triggers due
24692 * to having been cancelled.
24694 * Virtual: read_nonblocking
24695 * Returns: the number of bytes read, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
24700 * g_pollable_output_stream_can_poll:
24701 * @stream: a #GPollableOutputStream.
24703 * Checks if @stream is actually pollable. Some classes may implement
24704 * #GPollableOutputStream but have only certain instances of that
24705 * class be pollable. If this method returns %FALSE, then the behavior
24706 * of other #GPollableOutputStream methods is undefined.
24708 * For any given stream, the value returned by this method is constant;
24709 * a stream cannot switch from pollable to non-pollable or vice versa.
24711 * Returns: %TRUE if @stream is pollable, %FALSE if not.
24717 * g_pollable_output_stream_create_source:
24718 * @stream: a #GPollableOutputStream.
24719 * @cancellable: (allow-none): a #GCancellable, or %NULL
24721 * Creates a #GSource that triggers when @stream can be written, or
24722 * @cancellable is triggered or an error occurs. The callback on the
24723 * source is of the #GPollableSourceFunc type.
24725 * As with g_pollable_output_stream_is_writable(), it is possible that
24726 * the stream may not actually be writable even after the source
24727 * triggers, so you should use g_pollable_output_stream_write_nonblocking()
24728 * rather than g_output_stream_write() from the callback.
24730 * Returns: (transfer full): a new #GSource
24736 * g_pollable_output_stream_is_writable:
24737 * @stream: a #GPollableOutputStream.
24739 * Checks if @stream can be written.
24741 * Note that some stream types may not be able to implement this 100%
24742 * reliably, and it is possible that a call to g_output_stream_write()
24743 * after this returns %TRUE would still block. To guarantee
24744 * non-blocking behavior, you should always use
24745 * g_pollable_output_stream_write_nonblocking(), which will return a
24746 * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
24748 * 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.
24754 * g_pollable_output_stream_write_nonblocking:
24755 * @stream: a #GPollableOutputStream
24756 * @buffer: (array length=count) (element-type guint8): a buffer to write data from
24757 * @count: the number of bytes you want to write
24758 * @cancellable: (allow-none): a #GCancellable, or %NULL
24759 * @error: #GError for error reporting, or %NULL to ignore.
24761 * Attempts to write up to @count bytes from @buffer to @stream, as
24762 * with g_output_stream_write(). If @stream is not currently writable,
24763 * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
24764 * use g_pollable_output_stream_create_source() to create a #GSource
24765 * that will be triggered when @stream is writable.
24767 * Note that since this method never blocks, you cannot actually
24768 * use @cancellable to cancel it. However, it will return an error
24769 * if @cancellable has already been cancelled when you call, which
24770 * may happen if you call this method after a source triggers due
24771 * to having been cancelled.
24773 * Virtual: write_nonblocking
24774 * Returns: the number of bytes written, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
24779 * g_pollable_source_new:
24780 * @pollable_stream: the stream associated with the new source
24782 * Utility method for #GPollableInputStream and #GPollableOutputStream
24783 * implementations. Creates a new #GSource that expects a callback of
24784 * type #GPollableSourceFunc. The new source does not actually do
24785 * anything on its own; use g_source_add_child_source() to add other
24786 * sources to it to cause it to trigger.
24788 * Returns: (transfer full): the new #GSource.
24794 * g_pollable_source_new_full:
24795 * @pollable_stream: (type GObject): the stream associated with the new source
24796 * @child_source: (allow-none): optional child source to attach
24797 * @cancellable: (allow-none): optional #GCancellable to attach
24799 * Utility method for #GPollableInputStream and #GPollableOutputStream
24800 * implementations. Creates a new #GSource, as with
24801 * g_pollable_source_new(), but also attaching @child_source (with a
24802 * dummy callback), and @cancellable, if they are non-%NULL.
24804 * Returns: (transfer full): the new #GSource.
24810 * g_pollable_stream_read:
24811 * @stream: a #GInputStream
24812 * @buffer: a buffer to read data into
24813 * @count: the number of bytes to read
24814 * @blocking: whether to do blocking I/O
24815 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24816 * @error: location to store the error occurring, or %NULL to ignore
24818 * Tries to read from @stream, as with g_input_stream_read() (if
24819 * @blocking is %TRUE) or g_pollable_input_stream_read_nonblocking()
24820 * (if @blocking is %FALSE). This can be used to more easily share
24821 * code between blocking and non-blocking implementations of a method.
24823 * If @blocking is %FALSE, then @stream must be a
24824 * #GPollableInputStream for which g_pollable_input_stream_can_poll()
24825 * returns %TRUE, or else the behavior is undefined. If @blocking is
24826 * %TRUE, then @stream does not need to be a #GPollableInputStream.
24828 * Returns: the number of bytes read, or -1 on error.
24834 * g_pollable_stream_write:
24835 * @stream: a #GOutputStream.
24836 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24837 * @count: the number of bytes to write
24838 * @blocking: whether to do blocking I/O
24839 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24840 * @error: location to store the error occurring, or %NULL to ignore
24842 * Tries to write to @stream, as with g_output_stream_write() (if
24843 * @blocking is %TRUE) or g_pollable_output_stream_write_nonblocking()
24844 * (if @blocking is %FALSE). This can be used to more easily share
24845 * code between blocking and non-blocking implementations of a method.
24847 * If @blocking is %FALSE, then @stream must be a
24848 * #GPollableOutputStream for which
24849 * g_pollable_output_stream_can_poll() returns %TRUE or else the
24850 * behavior is undefined. If @blocking is %TRUE, then @stream does not
24851 * need to be a #GPollableOutputStream.
24853 * Returns: the number of bytes written, or -1 on error.
24859 * g_pollable_stream_write_all:
24860 * @stream: a #GOutputStream.
24861 * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24862 * @count: the number of bytes to write
24863 * @blocking: whether to do blocking I/O
24864 * @bytes_written: (out): location to store the number of bytes that was written to the stream
24865 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24866 * @error: location to store the error occurring, or %NULL to ignore
24868 * Tries to write @count bytes to @stream, as with
24869 * g_output_stream_write_all(), but using g_pollable_stream_write()
24870 * rather than g_output_stream_write().
24872 * On a successful write of @count bytes, %TRUE is returned, and
24873 * @bytes_written is set to @count.
24875 * If there is an error during the operation (including
24876 * %G_IO_ERROR_WOULD_BLOCK in the non-blocking case), %FALSE is
24877 * returned and @error is set to indicate the error status,
24878 * @bytes_written is updated to contain the number of bytes written
24879 * into the stream before the error occurred.
24881 * As with g_pollable_stream_write(), if @blocking is %FALSE, then
24882 * @stream must be a #GPollableOutputStream for which
24883 * g_pollable_output_stream_can_poll() returns %TRUE or else the
24884 * behavior is undefined. If @blocking is %TRUE, then @stream does not
24885 * need to be a #GPollableOutputStream.
24887 * Returns: %TRUE on success, %FALSE if there was an error
24893 * g_proxy_address_get_destination_hostname:
24894 * @proxy: a #GProxyAddress
24896 * Gets @proxy's destination hostname; that is, the name of the host
24897 * that will be connected to via the proxy, not the name of the proxy
24900 * Returns: the @proxy's destination hostname
24906 * g_proxy_address_get_destination_port:
24907 * @proxy: a #GProxyAddress
24909 * Gets @proxy's destination port; that is, the port on the
24910 * destination host that will be connected to via the proxy, not the
24911 * port number of the proxy itself.
24913 * Returns: the @proxy's destination port
24919 * g_proxy_address_get_destination_protocol:
24920 * @proxy: a #GProxyAddress
24922 * Gets the protocol that is being spoken to the destination
24923 * server; eg, "http" or "ftp".
24925 * Returns: the @proxy's destination protocol
24931 * g_proxy_address_get_password:
24932 * @proxy: a #GProxyAddress
24934 * Gets @proxy's password.
24936 * Returns: the @proxy's password
24942 * g_proxy_address_get_protocol:
24943 * @proxy: a #GProxyAddress
24945 * Gets @proxy's protocol. eg, "socks" or "http"
24947 * Returns: the @proxy's protocol
24953 * g_proxy_address_get_uri:
24954 * @proxy: a #GProxyAddress
24956 * Gets the proxy URI that @proxy was constructed from.
24958 * Returns: the @proxy's URI, or %NULL if unknown
24964 * g_proxy_address_get_username:
24965 * @proxy: a #GProxyAddress
24967 * Gets @proxy's username.
24969 * Returns: the @proxy's username
24975 * g_proxy_address_new:
24976 * @inetaddr: The proxy server #GInetAddress.
24977 * @port: The proxy server port.
24978 * @protocol: The proxy protocol to support, in lower case (e.g. socks, http).
24979 * @dest_hostname: The destination hostname the the proxy should tunnel to.
24980 * @dest_port: The destination port to tunnel to.
24981 * @username: (allow-none): The username to authenticate to the proxy server (or %NULL).
24982 * @password: (allow-none): The password to authenticate to the proxy server (or %NULL).
24984 * Creates a new #GProxyAddress for @inetaddr with @protocol that should
24985 * tunnel through @dest_hostname and @dest_port.
24987 * (Note that this method doesn't set the #GProxyAddress:uri or
24988 * #GProxyAddress:destination-protocol fields; use g_object_new()
24989 * directly if you want to set those.)
24991 * Returns: a new #GProxyAddress
24998 * @proxy: a #GProxy
24999 * @connection: a #GIOStream
25000 * @proxy_address: a #GProxyAddress
25001 * @cancellable: (allow-none): a #GCancellable
25002 * @error: return #GError
25004 * Given @connection to communicate with a proxy (eg, a
25005 * #GSocketConnection that is connected to the proxy server), this
25006 * does the necessary handshake to connect to @proxy_address, and if
25007 * required, wraps the #GIOStream to handle proxy payload.
25009 * Returns: (transfer full): a #GIOStream that will replace @connection. This might be the same as @connection, in which case a reference will be added.
25015 * g_proxy_connect_async:
25016 * @proxy: a #GProxy
25017 * @connection: a #GIOStream
25018 * @proxy_address: a #GProxyAddress
25019 * @cancellable: (allow-none): a #GCancellable
25020 * @callback: (scope async): a #GAsyncReadyCallback
25021 * @user_data: (closure): callback data
25023 * Asynchronous version of g_proxy_connect().
25030 * g_proxy_connect_finish:
25031 * @proxy: a #GProxy
25032 * @result: a #GAsyncResult
25033 * @error: return #GError
25035 * See g_proxy_connect().
25037 * Returns: (transfer full): a #GIOStream.
25043 * g_proxy_get_default_for_protocol:
25044 * @protocol: the proxy protocol name (e.g. http, socks, etc)
25046 * Lookup "gio-proxy" extension point for a proxy implementation that supports
25047 * specified protocol.
25049 * Returns: (transfer full): return a #GProxy or NULL if protocol is not supported.
25055 * g_proxy_resolver_get_default:
25057 * Gets the default #GProxyResolver for the system.
25059 * Returns: (transfer none): the default #GProxyResolver.
25065 * g_proxy_resolver_is_supported:
25066 * @resolver: a #GProxyResolver
25068 * Checks if @resolver can be used on this system. (This is used
25069 * internally; g_proxy_resolver_get_default() will only return a proxy
25070 * resolver that returns %TRUE for this method.)
25072 * Returns: %TRUE if @resolver is supported.
25078 * g_proxy_resolver_lookup:
25079 * @resolver: a #GProxyResolver
25080 * @uri: a URI representing the destination to connect to
25081 * @cancellable: (allow-none): a #GCancellable, or %NULL
25082 * @error: return location for a #GError, or %NULL
25084 * Looks into the system proxy configuration to determine what proxy,
25085 * if any, to use to connect to @uri. The returned proxy URIs are of the
25086 * form <literal><protocol>://[user[:password]@]host:port</literal>
25087 * or <literal>direct://</literal>, where <protocol> could be
25088 * http, rtsp, socks or other proxying protocol.
25090 * If you don't know what network protocol is being used on the
25091 * socket, you should use <literal>none</literal> as the URI protocol.
25092 * In this case, the resolver might still return a generic proxy type
25093 * (such as SOCKS), but would not return protocol-specific proxy types
25096 * <literal>direct://</literal> is used when no proxy is needed.
25097 * Direct connection should not be attempted unless it is part of the
25098 * returned array of proxies.
25100 * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
25106 * g_proxy_resolver_lookup_async:
25107 * @resolver: a #GProxyResolver
25108 * @uri: a URI representing the destination to connect to
25109 * @cancellable: (allow-none): a #GCancellable, or %NULL
25110 * @callback: (scope async): callback to call after resolution completes
25111 * @user_data: (closure): data for @callback
25113 * Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more
25121 * g_proxy_resolver_lookup_finish:
25122 * @resolver: a #GProxyResolver
25123 * @result: the result passed to your #GAsyncReadyCallback
25124 * @error: return location for a #GError, or %NULL
25126 * Call this function to obtain the array of proxy URIs when
25127 * g_proxy_resolver_lookup_async() is complete. See
25128 * g_proxy_resolver_lookup() for more details.
25130 * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
25136 * g_proxy_supports_hostname:
25137 * @proxy: a #GProxy
25139 * Some proxy protocols expect to be passed a hostname, which they
25140 * will resolve to an IP address themselves. Others, like SOCKS4, do
25141 * not allow this. This function will return %FALSE if @proxy is
25142 * implementing such a protocol. When %FALSE is returned, the caller
25143 * should resolve the destination hostname first, and then pass a
25144 * #GProxyAddress containing the stringified IP address to
25145 * g_proxy_connect() or g_proxy_connect_async().
25147 * Returns: %TRUE if hostname resolution is supported.
25153 * g_remote_action_group_activate_action_full:
25154 * @remote: a #GDBusActionGroup
25155 * @action_name: the name of the action to activate
25156 * @parameter: (allow-none): the optional parameter to the activation
25157 * @platform_data: the platform data to send
25159 * Activates the remote action.
25161 * This is the same as g_action_group_activate_action() except that it
25162 * allows for provision of "platform data" to be sent along with the
25163 * activation request. This typically contains details such as the user
25164 * interaction timestamp or startup notification information.
25166 * @platform_data must be non-%NULL and must have the type
25167 * %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed.
25174 * g_remote_action_group_change_action_state_full:
25175 * @remote: a #GRemoteActionGroup
25176 * @action_name: the name of the action to change the state of
25177 * @value: the new requested value for the state
25178 * @platform_data: the platform data to send
25180 * Changes the state of a remote action.
25182 * This is the same as g_action_group_change_action_state() except that
25183 * it allows for provision of "platform data" to be sent along with the
25184 * state change request. This typically contains details such as the
25185 * user interaction timestamp or startup notification information.
25187 * @platform_data must be non-%NULL and must have the type
25188 * %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed.
25195 * g_resolver_error_quark:
25197 * Gets the #GResolver Error Quark.
25199 * Returns: a #GQuark.
25205 * g_resolver_free_addresses: (skip)
25206 * @addresses: a #GList of #GInetAddress
25208 * Frees @addresses (which should be the return value from
25209 * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_finish()).
25210 * (This is a convenience method; you can also simply free the results
25218 * g_resolver_free_targets: (skip)
25219 * @targets: a #GList of #GSrvTarget
25221 * Frees @targets (which should be the return value from
25222 * g_resolver_lookup_service() or g_resolver_lookup_service_finish()).
25223 * (This is a convenience method; you can also simply free the
25224 * results by hand.)
25231 * g_resolver_get_default:
25233 * Gets the default #GResolver. You should unref it when you are done
25234 * with it. #GResolver may use its reference count as a hint about how
25235 * many threads it should allocate for concurrent DNS resolutions.
25237 * Returns: (transfer full): the default #GResolver.
25243 * g_resolver_lookup_by_address:
25244 * @resolver: a #GResolver
25245 * @address: the address to reverse-resolve
25246 * @cancellable: (allow-none): a #GCancellable, or %NULL
25247 * @error: return location for a #GError, or %NULL
25249 * Synchronously reverse-resolves @address to determine its
25250 * associated hostname.
25252 * If the DNS resolution fails, @error (if non-%NULL) will be set to
25253 * a value from #GResolverError.
25255 * If @cancellable is non-%NULL, it can be used to cancel the
25256 * operation, in which case @error (if non-%NULL) will be set to
25257 * %G_IO_ERROR_CANCELLED.
25259 * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
25265 * g_resolver_lookup_by_address_async:
25266 * @resolver: a #GResolver
25267 * @address: the address to reverse-resolve
25268 * @cancellable: (allow-none): a #GCancellable, or %NULL
25269 * @callback: (scope async): callback to call after resolution completes
25270 * @user_data: (closure): data for @callback
25272 * Begins asynchronously reverse-resolving @address to determine its
25273 * associated hostname, and eventually calls @callback, which must
25274 * call g_resolver_lookup_by_address_finish() to get the final result.
25281 * g_resolver_lookup_by_address_finish:
25282 * @resolver: a #GResolver
25283 * @result: the result passed to your #GAsyncReadyCallback
25284 * @error: return location for a #GError, or %NULL
25286 * Retrieves the result of a previous call to
25287 * g_resolver_lookup_by_address_async().
25289 * If the DNS resolution failed, @error (if non-%NULL) will be set to
25290 * a value from #GResolverError. If the operation was cancelled,
25291 * @error will be set to %G_IO_ERROR_CANCELLED.
25293 * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
25299 * g_resolver_lookup_by_name:
25300 * @resolver: a #GResolver
25301 * @hostname: the hostname to look up
25302 * @cancellable: (allow-none): a #GCancellable, or %NULL
25303 * @error: return location for a #GError, or %NULL
25305 * Synchronously resolves @hostname to determine its associated IP
25306 * address(es). @hostname may be an ASCII-only or UTF-8 hostname, or
25307 * the textual form of an IP address (in which case this just becomes
25308 * a wrapper around g_inet_address_new_from_string()).
25310 * On success, g_resolver_lookup_by_name() will return a #GList of
25311 * #GInetAddress, sorted in order of preference and guaranteed to not
25312 * contain duplicates. That is, if using the result to connect to
25313 * @hostname, you should attempt to connect to the first address
25314 * first, then the second if the first fails, etc. If you are using
25315 * the result to listen on a socket, it is appropriate to add each
25316 * result using e.g. g_socket_listener_add_address().
25318 * If the DNS resolution fails, @error (if non-%NULL) will be set to a
25319 * value from #GResolverError.
25321 * If @cancellable is non-%NULL, it can be used to cancel the
25322 * operation, in which case @error (if non-%NULL) will be set to
25323 * %G_IO_ERROR_CANCELLED.
25325 * If you are planning to connect to a socket on the resolved IP
25326 * address, it may be easier to create a #GNetworkAddress and use its
25327 * #GSocketConnectable interface.
25329 * 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.)
25335 * g_resolver_lookup_by_name_async:
25336 * @resolver: a #GResolver
25337 * @hostname: the hostname to look up the address of
25338 * @cancellable: (allow-none): a #GCancellable, or %NULL
25339 * @callback: (scope async): callback to call after resolution completes
25340 * @user_data: (closure): data for @callback
25342 * Begins asynchronously resolving @hostname to determine its
25343 * associated IP address(es), and eventually calls @callback, which
25344 * must call g_resolver_lookup_by_name_finish() to get the result.
25345 * See g_resolver_lookup_by_name() for more details.
25352 * g_resolver_lookup_by_name_finish:
25353 * @resolver: a #GResolver
25354 * @result: the result passed to your #GAsyncReadyCallback
25355 * @error: return location for a #GError, or %NULL
25357 * Retrieves the result of a call to
25358 * g_resolver_lookup_by_name_async().
25360 * If the DNS resolution failed, @error (if non-%NULL) will be set to
25361 * a value from #GResolverError. If the operation was cancelled,
25362 * @error will be set to %G_IO_ERROR_CANCELLED.
25364 * Returns: (element-type GInetAddress) (transfer full): a #GList of #GInetAddress, or %NULL on error. See g_resolver_lookup_by_name() for more details.
25370 * g_resolver_lookup_records:
25371 * @resolver: a #GResolver
25372 * @rrname: the DNS name to lookup the record for
25373 * @record_type: the type of DNS record to lookup
25374 * @cancellable: (allow-none): a #GCancellable, or %NULL
25375 * @error: return location for a #GError, or %NULL
25377 * Synchronously performs a DNS record lookup for the given @rrname and returns
25378 * a list of records as #GVariant tuples. See #GResolverRecordType for
25379 * information on what the records contain for each @record_type.
25381 * If the DNS resolution fails, @error (if non-%NULL) will be set to
25382 * a value from #GResolverError.
25384 * If @cancellable is non-%NULL, it can be used to cancel the
25385 * operation, in which case @error (if non-%NULL) will be set to
25386 * %G_IO_ERROR_CANCELLED.
25388 * 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.)
25394 * g_resolver_lookup_records_async:
25395 * @resolver: a #GResolver
25396 * @rrname: the DNS name to lookup the record for
25397 * @record_type: the type of DNS record to lookup
25398 * @cancellable: (allow-none): a #GCancellable, or %NULL
25399 * @callback: (scope async): callback to call after resolution completes
25400 * @user_data: (closure): data for @callback
25402 * Begins asynchronously performing a DNS lookup for the given
25403 * @rrname, and eventually calls @callback, which must call
25404 * g_resolver_lookup_records_finish() to get the final result. See
25405 * g_resolver_lookup_records() for more details.
25412 * g_resolver_lookup_records_finish:
25413 * @resolver: a #GResolver
25414 * @result: the result passed to your #GAsyncReadyCallback
25415 * @error: return location for a #GError, or %NULL
25417 * Retrieves the result of a previous call to
25418 * g_resolver_lookup_records_async(). Returns a list of records as #GVariant
25419 * tuples. See #GResolverRecordType for information on what the records contain.
25421 * If the DNS resolution failed, @error (if non-%NULL) will be set to
25422 * a value from #GResolverError. If the operation was cancelled,
25423 * @error will be set to %G_IO_ERROR_CANCELLED.
25425 * 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.)
25431 * g_resolver_lookup_service:
25432 * @resolver: a #GResolver
25433 * @service: the service type to look up (eg, "ldap")
25434 * @protocol: the networking protocol to use for @service (eg, "tcp")
25435 * @domain: the DNS domain to look up the service in
25436 * @cancellable: (allow-none): a #GCancellable, or %NULL
25437 * @error: return location for a #GError, or %NULL
25439 * Synchronously performs a DNS SRV lookup for the given @service and
25440 * @protocol in the given @domain and returns an array of #GSrvTarget.
25441 * @domain may be an ASCII-only or UTF-8 hostname. Note also that the
25442 * @service and @protocol arguments <emphasis>do not</emphasis>
25443 * include the leading underscore that appears in the actual DNS
25446 * On success, g_resolver_lookup_service() will return a #GList of
25447 * #GSrvTarget, sorted in order of preference. (That is, you should
25448 * attempt to connect to the first target first, then the second if
25449 * the first fails, etc.)
25451 * If the DNS resolution fails, @error (if non-%NULL) will be set to
25452 * a value from #GResolverError.
25454 * If @cancellable is non-%NULL, it can be used to cancel the
25455 * operation, in which case @error (if non-%NULL) will be set to
25456 * %G_IO_ERROR_CANCELLED.
25458 * If you are planning to connect to the service, it is usually easier
25459 * to create a #GNetworkService and use its #GSocketConnectable
25462 * 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.)
25468 * g_resolver_lookup_service_async:
25469 * @resolver: a #GResolver
25470 * @service: the service type to look up (eg, "ldap")
25471 * @protocol: the networking protocol to use for @service (eg, "tcp")
25472 * @domain: the DNS domain to look up the service in
25473 * @cancellable: (allow-none): a #GCancellable, or %NULL
25474 * @callback: (scope async): callback to call after resolution completes
25475 * @user_data: (closure): data for @callback
25477 * Begins asynchronously performing a DNS SRV lookup for the given
25478 * @service and @protocol in the given @domain, and eventually calls
25479 * @callback, which must call g_resolver_lookup_service_finish() to
25480 * get the final result. See g_resolver_lookup_service() for more
25488 * g_resolver_lookup_service_finish:
25489 * @resolver: a #GResolver
25490 * @result: the result passed to your #GAsyncReadyCallback
25491 * @error: return location for a #GError, or %NULL
25493 * Retrieves the result of a previous call to
25494 * g_resolver_lookup_service_async().
25496 * If the DNS resolution failed, @error (if non-%NULL) will be set to
25497 * a value from #GResolverError. If the operation was cancelled,
25498 * @error will be set to %G_IO_ERROR_CANCELLED.
25500 * Returns: (element-type GSrvTarget) (transfer full): a #GList of #GSrvTarget, or %NULL on error. See g_resolver_lookup_service() for more details.
25506 * g_resolver_set_default:
25507 * @resolver: the new default #GResolver
25509 * Sets @resolver to be the application's default resolver (reffing
25510 * @resolver, and unreffing the previous default resolver, if any).
25511 * Future calls to g_resolver_get_default() will return this resolver.
25513 * This can be used if an application wants to perform any sort of DNS
25514 * caching or "pinning"; it can implement its own #GResolver that
25515 * calls the original default resolver for DNS operations, and
25516 * implements its own cache policies on top of that, and then set
25517 * itself as the default resolver for all later code to use.
25524 * g_resource_enumerate_children:
25525 * @resource: A #GResource
25526 * @path: A pathname inside the resource
25527 * @lookup_flags: A #GResourceLookupFlags
25528 * @error: return location for a #GError, or %NULL
25530 * Returns all the names of children at the specified @path in the resource.
25531 * The return result is a %NULL terminated list of strings which should
25532 * be released with g_strfreev().
25534 * @lookup_flags controls the behaviour of the lookup.
25536 * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
25542 * g_resource_error_quark:
25544 * Gets the #GResource Error Quark.
25546 * Returns: a #GQuark
25552 * g_resource_get_info:
25553 * @resource: A #GResource
25554 * @path: A pathname inside the resource
25555 * @lookup_flags: A #GResourceLookupFlags
25556 * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
25557 * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
25558 * @error: return location for a #GError, or %NULL
25560 * Looks for a file at the specified @path in the resource and
25561 * if found returns information about it.
25563 * @lookup_flags controls the behaviour of the lookup.
25565 * Returns: %TRUE if the file was found. %FALSE if there were errors
25572 * @filename: (type filename): the path of a filename to load, in the GLib filename encoding
25573 * @error: return location for a #GError, or %NULL
25575 * Loads a binary resource bundle and creates a #GResource representation of it, allowing
25576 * you to query it for data.
25578 * If you want to use this resource in the global resource namespace you need
25579 * to register it with g_resources_register().
25581 * Returns: (transfer full): a new #GResource, or %NULL on error
25587 * g_resource_lookup_data:
25588 * @resource: A #GResource
25589 * @path: A pathname inside the resource
25590 * @lookup_flags: A #GResourceLookupFlags
25591 * @error: return location for a #GError, or %NULL
25593 * Looks for a file at the specified @path in the resource and
25594 * returns a #GBytes that lets you directly access the data in
25597 * The data is always followed by a zero byte, so you
25598 * can safely use the data as a C string. However, that byte
25599 * is not included in the size of the GBytes.
25601 * For uncompressed resource files this is a pointer directly into
25602 * the resource bundle, which is typically in some readonly data section
25603 * in the program binary. For compressed files we allocate memory on
25604 * the heap and automatically uncompress the data.
25606 * @lookup_flags controls the behaviour of the lookup.
25608 * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
25614 * g_resource_new_from_data:
25616 * @error: return location for a #GError, or %NULL
25618 * Creates a GResource from a reference to the binary resource bundle.
25619 * This will keep a reference to @data while the resource lives, so
25620 * the data should not be modified or freed.
25622 * If you want to use this resource in the global resource namespace you need
25623 * to register it with g_resources_register().
25625 * Returns: (transfer full): a new #GResource, or %NULL on error
25631 * g_resource_open_stream:
25632 * @resource: A #GResource
25633 * @path: A pathname inside the resource
25634 * @lookup_flags: A #GResourceLookupFlags
25635 * @error: return location for a #GError, or %NULL
25637 * Looks for a file at the specified @path in the resource and
25638 * returns a #GInputStream that lets you read the data.
25640 * @lookup_flags controls the behaviour of the lookup.
25642 * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
25649 * @resource: A #GResource
25651 * Atomically increments the reference count of @array by one. This
25652 * function is MT-safe and may be called from any thread.
25654 * Returns: The passed in #GResource
25660 * g_resource_unref:
25661 * @resource: A #GResource
25663 * Atomically decrements the reference count of @resource by one. If the
25664 * reference count drops to 0, all memory allocated by the array is
25665 * released. This function is MT-safe and may be called from any
25673 * g_resources_enumerate_children:
25674 * @path: A pathname inside the resource
25675 * @lookup_flags: A #GResourceLookupFlags
25676 * @error: return location for a #GError, or %NULL
25678 * Returns all the names of children at the specified @path in the set of
25679 * globally registred resources.
25680 * The return result is a %NULL terminated list of strings which should
25681 * be released with g_strfreev().
25683 * @lookup_flags controls the behaviour of the lookup.
25685 * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
25691 * g_resources_get_info:
25692 * @path: A pathname inside the resource
25693 * @lookup_flags: A #GResourceLookupFlags
25694 * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
25695 * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
25696 * @error: return location for a #GError, or %NULL
25698 * Looks for a file at the specified @path in the set of
25699 * globally registred resources and if found returns information about it.
25701 * @lookup_flags controls the behaviour of the lookup.
25703 * Returns: %TRUE if the file was found. %FALSE if there were errors
25709 * g_resources_lookup_data:
25710 * @path: A pathname inside the resource
25711 * @lookup_flags: A #GResourceLookupFlags
25712 * @error: return location for a #GError, or %NULL
25714 * Looks for a file at the specified @path in the set of
25715 * globally registred resources and returns a #GBytes that
25716 * lets you directly access the data in memory.
25718 * The data is always followed by a zero byte, so you
25719 * can safely use the data as a C string. However, that byte
25720 * is not included in the size of the GBytes.
25722 * For uncompressed resource files this is a pointer directly into
25723 * the resource bundle, which is typically in some readonly data section
25724 * in the program binary. For compressed files we allocate memory on
25725 * the heap and automatically uncompress the data.
25727 * @lookup_flags controls the behaviour of the lookup.
25729 * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
25735 * g_resources_open_stream:
25736 * @path: A pathname inside the resource
25737 * @lookup_flags: A #GResourceLookupFlags
25738 * @error: return location for a #GError, or %NULL
25740 * Looks for a file at the specified @path in the set of
25741 * globally registred resources and returns a #GInputStream
25742 * that lets you read the data.
25744 * @lookup_flags controls the behaviour of the lookup.
25746 * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
25752 * g_resources_register:
25753 * @resource: A #GResource
25755 * Registers the resource with the process-global set of resources.
25756 * Once a resource is registered the files in it can be accessed
25757 * with the global resource lookup functions like g_resources_lookup_data().
25764 * g_resources_unregister:
25765 * @resource: A #GResource
25767 * Unregisters the resource from the process-global set of resources.
25774 * g_seekable_can_seek:
25775 * @seekable: a #GSeekable.
25777 * Tests if the stream supports the #GSeekableIface.
25779 * Returns: %TRUE if @seekable can be seeked. %FALSE otherwise.
25784 * g_seekable_can_truncate:
25785 * @seekable: a #GSeekable.
25787 * Tests if the stream can be truncated.
25789 * Returns: %TRUE if the stream can be truncated, %FALSE otherwise.
25795 * @seekable: a #GSeekable.
25796 * @offset: a #goffset.
25797 * @type: a #GSeekType.
25798 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25799 * @error: a #GError location to store the error occurring, or %NULL to ignore.
25801 * Seeks in the stream by the given @offset, modified by @type.
25803 * If @cancellable is not %NULL, then the operation can be cancelled by
25804 * triggering the cancellable object from another thread. If the operation
25805 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
25807 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
25813 * @seekable: a #GSeekable.
25815 * Tells the current position within the stream.
25817 * Returns: the offset from the beginning of the buffer.
25822 * g_seekable_truncate:
25823 * @seekable: a #GSeekable.
25824 * @offset: a #goffset.
25825 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25826 * @error: a #GError location to store the error occurring, or %NULL to ignore.
25828 * Truncates a stream with a given #offset.
25830 * If @cancellable is not %NULL, then the operation can be cancelled by
25831 * triggering the cancellable object from another thread. If the operation
25832 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
25833 * operation was partially finished when the operation was cancelled the
25834 * partial result will be returned, without an error.
25836 * Virtual: truncate_fn
25837 * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
25842 * g_settings_apply:
25843 * @settings: a #GSettings instance
25845 * Applies any changes that have been made to the settings. This
25846 * function does nothing unless @settings is in 'delay-apply' mode;
25847 * see g_settings_delay(). In the normal case settings are always
25848 * applied immediately.
25853 * g_settings_backend_changed:
25854 * @backend: a #GSettingsBackend implementation
25855 * @key: the name of the key
25856 * @origin_tag: the origin tag
25858 * Signals that a single key has possibly changed. Backend
25859 * implementations should call this if a key has possibly changed its
25862 * @key must be a valid key (ie starting with a slash, not containing
25863 * '//', and not ending with a slash).
25865 * The implementation must call this function during any call to
25866 * g_settings_backend_write(), before the call returns (except in the
25867 * case that no keys are actually changed and it cares to detect this
25868 * fact). It may not rely on the existence of a mainloop for
25869 * dispatching the signal later.
25871 * The implementation may call this function at any other time it likes
25872 * in response to other events (such as changes occurring outside of the
25873 * program). These calls may originate from a mainloop or may originate
25874 * in response to any other action (including from calls to
25875 * g_settings_backend_write()).
25877 * In the case that this call is in response to a call to
25878 * g_settings_backend_write() then @origin_tag must be set to the same
25879 * value that was passed to that call.
25886 * g_settings_backend_changed_tree:
25887 * @backend: a #GSettingsBackend implementation
25888 * @tree: a #GTree containing the changes
25889 * @origin_tag: the origin tag
25891 * This call is a convenience wrapper. It gets the list of changes from
25892 * @tree, computes the longest common prefix and calls
25893 * g_settings_backend_changed().
25900 * g_settings_backend_flatten_tree:
25901 * @tree: a #GTree containing the changes
25902 * @path: (out): the location to save the path
25903 * @keys: (out) (transfer container) (array zero-terminated=1): the location to save the relative keys
25904 * @values: (out) (allow-none) (transfer container) (array zero-terminated=1): the location to save the values, or %NULL
25906 * Calculate the longest common prefix of all keys in a tree and write
25907 * out an array of the key names relative to that prefix and,
25908 * optionally, the value to store at each of those keys.
25910 * You must free the value returned in @path, @keys and @values using
25911 * g_free(). You should not attempt to free or unref the contents of
25912 * @keys or @values.
25919 * g_settings_backend_get_default:
25921 * Returns the default #GSettingsBackend. It is possible to override
25922 * the default by setting the <envar>GSETTINGS_BACKEND</envar>
25923 * environment variable to the name of a settings backend.
25925 * The user gets a reference to the backend.
25927 * Returns: (transfer full): the default #GSettingsBackend
25933 * g_settings_backend_keys_changed:
25934 * @backend: a #GSettingsBackend implementation
25935 * @path: the path containing the changes
25936 * @items: (array zero-terminated=1): the %NULL-terminated list of changed keys
25937 * @origin_tag: the origin tag
25939 * Signals that a list of keys have possibly changed. Backend
25940 * implementations should call this if keys have possibly changed their
25943 * @path must be a valid path (ie starting and ending with a slash and
25944 * not containing '//'). Each string in @items must form a valid key
25945 * name when @path is prefixed to it (ie: each item must not start or
25946 * end with '/' and must not contain '//').
25948 * The meaning of this signal is that any of the key names resulting
25949 * from the contatenation of @path with each item in @items may have
25952 * The same rules for when notifications must occur apply as per
25953 * g_settings_backend_changed(). These two calls can be used
25954 * interchangeably if exactly one item has changed (although in that
25955 * case g_settings_backend_changed() is definitely preferred).
25957 * For efficiency reasons, the implementation should strive for @path to
25958 * be as long as possible (ie: the longest common prefix of all of the
25959 * keys that were changed) but this is not strictly required.
25966 * g_settings_backend_path_changed:
25967 * @backend: a #GSettingsBackend implementation
25968 * @path: the path containing the changes
25969 * @origin_tag: the origin tag
25971 * Signals that all keys below a given path may have possibly changed.
25972 * Backend implementations should call this if an entire path of keys
25973 * have possibly changed their values.
25975 * @path must be a valid path (ie starting and ending with a slash and
25976 * not containing '//').
25978 * The meaning of this signal is that any of the key which has a name
25979 * starting with @path may have changed.
25981 * The same rules for when notifications must occur apply as per
25982 * g_settings_backend_changed(). This call might be an appropriate
25983 * reasponse to a 'reset' call but implementations are also free to
25984 * explicitly list the keys that were affected by that call if they can
25987 * For efficiency reasons, the implementation should strive for @path to
25988 * be as long as possible (ie: the longest common prefix of all of the
25989 * keys that were changed) but this is not strictly required. As an
25990 * example, if this function is called with the path of "/" then every
25991 * single key in the application will be notified of a possible change.
25998 * g_settings_backend_path_writable_changed:
25999 * @backend: a #GSettingsBackend implementation
26000 * @path: the name of the path
26002 * Signals that the writability of all keys below a given path may have
26005 * Since GSettings performs no locking operations for itself, this call
26006 * will always be made in response to external events.
26013 * g_settings_backend_writable_changed:
26014 * @backend: a #GSettingsBackend implementation
26015 * @key: the name of the key
26017 * Signals that the writability of a single key has possibly changed.
26019 * Since GSettings performs no locking operations for itself, this call
26020 * will always be made in response to external events.
26028 * @settings: a #GSettings object
26029 * @key: the key to bind
26030 * @object: (type GObject.Object): a #GObject
26031 * @property: the name of the property to bind
26032 * @flags: flags for the binding
26034 * Create a binding between the @key in the @settings object
26035 * and the property @property of @object.
26037 * The binding uses the default GIO mapping functions to map
26038 * between the settings and property values. These functions
26039 * handle booleans, numeric types and string types in a
26040 * straightforward way. Use g_settings_bind_with_mapping() if
26041 * you need a custom mapping, or map between types that are not
26042 * supported by the default mapping functions.
26044 * Unless the @flags include %G_SETTINGS_BIND_NO_SENSITIVITY, this
26045 * function also establishes a binding between the writability of
26046 * @key and the "sensitive" property of @object (if @object has
26047 * a boolean property by that name). See g_settings_bind_writable()
26048 * for more details about writable bindings.
26050 * Note that the lifecycle of the binding is tied to the object,
26051 * and that you can have only one binding per object property.
26052 * If you bind the same property twice on the same object, the second
26053 * binding overrides the first one.
26060 * g_settings_bind_with_mapping: (skip)
26061 * @settings: a #GSettings object
26062 * @key: the key to bind
26063 * @object: (type GObject.Object): a #GObject
26064 * @property: the name of the property to bind
26065 * @flags: flags for the binding
26066 * @get_mapping: a function that gets called to convert values from @settings to @object, or %NULL to use the default GIO mapping
26067 * @set_mapping: a function that gets called to convert values from @object to @settings, or %NULL to use the default GIO mapping
26068 * @user_data: data that gets passed to @get_mapping and @set_mapping
26069 * @destroy: #GDestroyNotify function for @user_data
26071 * Create a binding between the @key in the @settings object
26072 * and the property @property of @object.
26074 * The binding uses the provided mapping functions to map between
26075 * settings and property values.
26077 * Note that the lifecycle of the binding is tied to the object,
26078 * and that you can have only one binding per object property.
26079 * If you bind the same property twice on the same object, the second
26080 * binding overrides the first one.
26087 * g_settings_bind_writable:
26088 * @settings: a #GSettings object
26089 * @key: the key to bind
26090 * @object: (type GObject.Object): a #GObject
26091 * @property: the name of a boolean property to bind
26092 * @inverted: whether to 'invert' the value
26094 * Create a binding between the writability of @key in the
26095 * @settings object and the property @property of @object.
26096 * The property must be boolean; "sensitive" or "visible"
26097 * properties of widgets are the most likely candidates.
26099 * Writable bindings are always uni-directional; changes of the
26100 * writability of the setting will be propagated to the object
26101 * property, not the other way.
26103 * When the @inverted argument is %TRUE, the binding inverts the
26104 * value as it passes from the setting to the object, i.e. @property
26105 * will be set to %TRUE if the key is <emphasis>not</emphasis>
26108 * Note that the lifecycle of the binding is tied to the object,
26109 * and that you can have only one binding per object property.
26110 * If you bind the same property twice on the same object, the second
26111 * binding overrides the first one.
26118 * g_settings_create_action:
26119 * @settings: a #GSettings
26120 * @key: the name of a key in @settings
26122 * Creates a #GAction corresponding to a given #GSettings key.
26124 * The action has the same name as the key.
26126 * The value of the key becomes the state of the action and the action
26127 * is enabled when the key is writable. Changing the state of the
26128 * action results in the key being written to. Changes to the value or
26129 * writability of the key cause appropriate change notifications to be
26130 * emitted for the action.
26132 * For boolean-valued keys, action activations take no parameter and
26133 * result in the toggling of the value. For all other types,
26134 * activations take the new value for the key (which must have the
26137 * Returns: (transfer full): a new #GAction
26143 * g_settings_delay:
26144 * @settings: a #GSettings object
26146 * Changes the #GSettings object into 'delay-apply' mode. In this
26147 * mode, changes to @settings are not immediately propagated to the
26148 * backend, but kept locally until g_settings_apply() is called.
26156 * @settings: a #GSettings object
26157 * @key: the key to get the value for
26158 * @format: a #GVariant format string
26159 * @...: arguments as per @format
26161 * Gets the value that is stored at @key in @settings.
26163 * A convenience function that combines g_settings_get_value() with
26166 * It is a programmer error to give a @key that isn't contained in the
26167 * schema for @settings or for the #GVariantType of @format to mismatch
26168 * the type given in the schema.
26175 * g_settings_get_boolean:
26176 * @settings: a #GSettings object
26177 * @key: the key to get the value for
26179 * Gets the value that is stored at @key in @settings.
26181 * A convenience variant of g_settings_get() for booleans.
26183 * It is a programmer error to give a @key that isn't specified as
26184 * having a boolean type in the schema for @settings.
26186 * Returns: a boolean
26192 * g_settings_get_child:
26193 * @settings: a #GSettings object
26194 * @name: the name of the 'child' schema
26196 * Creates a 'child' settings object which has a base path of
26197 * <replaceable>base-path</replaceable>/@name, where
26198 * <replaceable>base-path</replaceable> is the base path of @settings.
26200 * The schema for the child settings object must have been declared
26201 * in the schema of @settings using a <tag class="starttag">child</tag> element.
26203 * Returns: (transfer full): a 'child' settings object
26209 * g_settings_get_double:
26210 * @settings: a #GSettings object
26211 * @key: the key to get the value for
26213 * Gets the value that is stored at @key in @settings.
26215 * A convenience variant of g_settings_get() for doubles.
26217 * It is a programmer error to give a @key that isn't specified as
26218 * having a 'double' type in the schema for @settings.
26220 * Returns: a double
26226 * g_settings_get_enum:
26227 * @settings: a #GSettings object
26228 * @key: the key to get the value for
26230 * Gets the value that is stored in @settings for @key and converts it
26231 * to the enum value that it represents.
26233 * In order to use this function the type of the value must be a string
26234 * and it must be marked in the schema file as an enumerated type.
26236 * It is a programmer error to give a @key that isn't contained in the
26237 * schema for @settings or is not marked as an enumerated type.
26239 * If the value stored in the configuration database is not a valid
26240 * value for the enumerated type then this function will return the
26243 * Returns: the enum value
26249 * g_settings_get_flags:
26250 * @settings: a #GSettings object
26251 * @key: the key to get the value for
26253 * Gets the value that is stored in @settings for @key and converts it
26254 * to the flags value that it represents.
26256 * In order to use this function the type of the value must be an array
26257 * of strings and it must be marked in the schema file as an flags type.
26259 * It is a programmer error to give a @key that isn't contained in the
26260 * schema for @settings or is not marked as a flags type.
26262 * If the value stored in the configuration database is not a valid
26263 * value for the flags type then this function will return the default
26266 * Returns: the flags value
26272 * g_settings_get_has_unapplied:
26273 * @settings: a #GSettings object
26275 * Returns whether the #GSettings object has any unapplied
26276 * changes. This can only be the case if it is in 'delayed-apply' mode.
26278 * Returns: %TRUE if @settings has unapplied changes
26284 * g_settings_get_int:
26285 * @settings: a #GSettings object
26286 * @key: the key to get the value for
26288 * Gets the value that is stored at @key in @settings.
26290 * A convenience variant of g_settings_get() for 32-bit integers.
26292 * It is a programmer error to give a @key that isn't specified as
26293 * having a int32 type in the schema for @settings.
26295 * Returns: an integer
26301 * g_settings_get_mapped:
26302 * @settings: a #GSettings object
26303 * @key: the key to get the value for
26304 * @mapping: (scope call): the function to map the value in the settings database to the value used by the application
26305 * @user_data: user data for @mapping
26307 * Gets the value that is stored at @key in @settings, subject to
26308 * application-level validation/mapping.
26310 * You should use this function when the application needs to perform
26311 * some processing on the value of the key (for example, parsing). The
26312 * @mapping function performs that processing. If the function
26313 * indicates that the processing was unsuccessful (due to a parse error,
26314 * for example) then the mapping is tried again with another value.
26316 * This allows a robust 'fall back to defaults' behaviour to be
26317 * implemented somewhat automatically.
26319 * The first value that is tried is the user's setting for the key. If
26320 * the mapping function fails to map this value, other values may be
26321 * tried in an unspecified order (system or site defaults, translated
26322 * schema default values, untranslated schema default values, etc).
26324 * If the mapping function fails for all possible values, one additional
26325 * attempt is made: the mapping function is called with a %NULL value.
26326 * If the mapping function still indicates failure at this point then
26327 * the application will be aborted.
26329 * The result parameter for the @mapping function is pointed to a
26330 * #gpointer which is initially set to %NULL. The same pointer is given
26331 * to each invocation of @mapping. The final value of that #gpointer is
26332 * what is returned by this function. %NULL is valid; it is returned
26333 * just as any other value would be.
26335 * Returns: (transfer full): the result, which may be %NULL
26340 * g_settings_get_range:
26341 * @settings: a #GSettings
26342 * @key: the key to query the range of
26344 * Queries the range of a key.
26346 * This function will return a #GVariant that fully describes the range
26347 * of values that are valid for @key.
26349 * The type of #GVariant returned is <literal>(sv)</literal>. The
26350 * string describes the type of range restriction in effect. The type
26351 * and meaning of the value contained in the variant depends on the
26354 * If the string is <literal>'type'</literal> then the variant contains
26355 * an empty array. The element type of that empty array is the expected
26356 * type of value and all values of that type are valid.
26358 * If the string is <literal>'enum'</literal> then the variant contains
26359 * an array enumerating the possible values. Each item in the array is
26360 * a possible valid value and no other values are valid.
26362 * If the string is <literal>'flags'</literal> then the variant contains
26363 * an array. Each item in the array is a value that may appear zero or
26364 * one times in an array to be used as the value for this key. For
26365 * example, if the variant contained the array <literal>['x',
26366 * 'y']</literal> then the valid values for the key would be
26367 * <literal>[]</literal>, <literal>['x']</literal>,
26368 * <literal>['y']</literal>, <literal>['x', 'y']</literal> and
26369 * <literal>['y', 'x']</literal>.
26371 * Finally, if the string is <literal>'range'</literal> then the variant
26372 * contains a pair of like-typed values -- the minimum and maximum
26373 * permissible values for this key.
26375 * This information should not be used by normal programs. It is
26376 * considered to be a hint for introspection purposes. Normal programs
26377 * should already know what is permitted by their own schema. The
26378 * format may change in any way in the future -- but particularly, new
26379 * forms may be added to the possibilities described above.
26381 * It is a programmer error to give a @key that isn't contained in the
26382 * schema for @settings.
26384 * You should free the returned value with g_variant_unref() when it is
26385 * no longer needed.
26387 * Returns: a #GVariant describing the range
26393 * g_settings_get_string:
26394 * @settings: a #GSettings object
26395 * @key: the key to get the value for
26397 * Gets the value that is stored at @key in @settings.
26399 * A convenience variant of g_settings_get() for strings.
26401 * It is a programmer error to give a @key that isn't specified as
26402 * having a string type in the schema for @settings.
26404 * Returns: a newly-allocated string
26410 * g_settings_get_strv:
26411 * @settings: a #GSettings object
26412 * @key: the key to get the value for
26414 * A convenience variant of g_settings_get() for string arrays.
26416 * It is a programmer error to give a @key that isn't specified as
26417 * having an array of strings type in the schema for @settings.
26419 * Returns: (array zero-terminated=1) (transfer full): a newly-allocated, %NULL-terminated array of strings, the value that is stored at @key in @settings.
26425 * g_settings_get_uint:
26426 * @settings: a #GSettings object
26427 * @key: the key to get the value for
26429 * Gets the value that is stored at @key in @settings.
26431 * A convenience variant of g_settings_get() for 32-bit unsigned
26434 * It is a programmer error to give a @key that isn't specified as
26435 * having a uint32 type in the schema for @settings.
26437 * Returns: an unsigned integer
26443 * g_settings_get_value:
26444 * @settings: a #GSettings object
26445 * @key: the key to get the value for
26447 * Gets the value that is stored in @settings for @key.
26449 * It is a programmer error to give a @key that isn't contained in the
26450 * schema for @settings.
26452 * Returns: a new #GVariant
26458 * g_settings_is_writable:
26459 * @settings: a #GSettings object
26460 * @name: the name of a key
26462 * Finds out if a key can be written or not
26464 * Returns: %TRUE if the key @name is writable
26470 * g_settings_list_children:
26471 * @settings: a #GSettings object
26473 * Gets the list of children on @settings.
26475 * The list is exactly the list of strings for which it is not an error
26476 * to call g_settings_get_child().
26478 * For GSettings objects that are lists, this value can change at any
26479 * time and you should connect to the "children-changed" signal to watch
26480 * for those changes. Note that there is a race condition here: you may
26481 * request a child after listing it only for it to have been destroyed
26482 * in the meantime. For this reason, g_settings_get_child() may return
26483 * %NULL even for a child that was listed by this function.
26485 * For GSettings objects that are not lists, you should probably not be
26486 * calling this function from "normal" code (since you should already
26487 * know what children are in your schema). This function may still be
26488 * useful there for introspection reasons, however.
26490 * You should free the return value with g_strfreev() when you are done
26493 * Returns: (transfer full) (element-type utf8): a list of the children on @settings
26498 * g_settings_list_keys:
26499 * @settings: a #GSettings object
26501 * Introspects the list of keys on @settings.
26503 * You should probably not be calling this function from "normal" code
26504 * (since you should already know what keys are in your schema). This
26505 * function is intended for introspection reasons.
26507 * You should free the return value with g_strfreev() when you are done
26510 * Returns: (transfer full) (element-type utf8): a list of the keys on @settings
26515 * g_settings_list_relocatable_schemas:
26517 * Gets a list of the relocatable #GSettings schemas installed on the
26518 * system. These are schemas that do not provide their own path. It is
26519 * usual to instantiate these schemas directly, but if you want to you
26520 * can use g_settings_new_with_path() to specify the path.
26522 * The output of this function, taken together with the output of
26523 * g_settings_list_schemas() represents the complete list of all
26524 * installed schemas.
26526 * Returns: (element-type utf8) (transfer none): a list of relocatable #GSettings schemas that are available. The list must not be modified or freed.
26532 * g_settings_list_schemas:
26534 * Gets a list of the #GSettings schemas installed on the system. The
26535 * returned list is exactly the list of schemas for which you may call
26536 * g_settings_new() without adverse effects.
26538 * This function does not list the schemas that do not provide their own
26539 * paths (ie: schemas for which you must use
26540 * g_settings_new_with_path()). See
26541 * g_settings_list_relocatable_schemas() for that.
26543 * Returns: (element-type utf8) (transfer none): a list of #GSettings schemas that are available. The list must not be modified or freed.
26550 * @schema_id: the id of the schema
26552 * Creates a new #GSettings object with the schema specified by
26555 * Signals on the newly created #GSettings object will be dispatched
26556 * via the thread-default #GMainContext in effect at the time of the
26557 * call to g_settings_new(). The new #GSettings will hold a reference
26558 * on the context. See g_main_context_push_thread_default().
26560 * Returns: a new #GSettings object
26566 * g_settings_new_full:
26567 * @schema: a #GSettingsSchema
26568 * @backend: (allow-none): a #GSettingsBackend
26569 * @path: (allow-none): the path to use
26571 * Creates a new #GSettings object with a given schema, backend and
26574 * It should be extremely rare that you ever want to use this function.
26575 * It is made available for advanced use-cases (such as plugin systems
26576 * that want to provide access to schemas loaded from custom locations,
26579 * At the most basic level, a #GSettings object is a pure composition of
26580 * 4 things: a #GSettingsSchema, a #GSettingsBackend, a path within that
26581 * backend, and a #GMainContext to which signals are dispatched.
26583 * This constructor therefore gives you full control over constructing
26584 * #GSettings instances. The first 4 parameters are given directly as
26585 * @schema, @backend and @path, and the main context is taken from the
26586 * thread-default (as per g_settings_new()).
26588 * If @backend is %NULL then the default backend is used.
26590 * If @path is %NULL then the path from the schema is used. It is an
26591 * error f @path is %NULL and the schema has no path of its own or if
26592 * @path is non-%NULL and not equal to the path that the schema does
26595 * Returns: a new #GSettings object
26601 * g_settings_new_with_backend:
26602 * @schema_id: the id of the schema
26603 * @backend: the #GSettingsBackend to use
26605 * Creates a new #GSettings object with the schema specified by
26606 * @schema_id and a given #GSettingsBackend.
26608 * Creating a #GSettings object with a different backend allows accessing
26609 * settings from a database other than the usual one. For example, it may make
26610 * sense to pass a backend corresponding to the "defaults" settings database on
26611 * the system to get a settings object that modifies the system default
26612 * settings instead of the settings for this user.
26614 * Returns: a new #GSettings object
26620 * g_settings_new_with_backend_and_path:
26621 * @schema_id: the id of the schema
26622 * @backend: the #GSettingsBackend to use
26623 * @path: the path to use
26625 * Creates a new #GSettings object with the schema specified by
26626 * @schema_id and a given #GSettingsBackend and path.
26628 * This is a mix of g_settings_new_with_backend() and
26629 * g_settings_new_with_path().
26631 * Returns: a new #GSettings object
26637 * g_settings_new_with_path:
26638 * @schema_id: the id of the schema
26639 * @path: the path to use
26641 * Creates a new #GSettings object with the relocatable schema specified
26642 * by @schema_id and a given path.
26644 * You only need to do this if you want to directly create a settings
26645 * object with a schema that doesn't have a specified path of its own.
26646 * That's quite rare.
26648 * It is a programmer error to call this function for a schema that
26649 * has an explicitly specified path.
26651 * Returns: a new #GSettings object
26657 * g_settings_range_check:
26658 * @settings: a #GSettings
26659 * @key: the key to check
26660 * @value: the value to check
26662 * Checks if the given @value is of the correct type and within the
26663 * permitted range for @key.
26665 * This API is not intended to be used by normal programs -- they should
26666 * already know what is permitted by their own schemas. This API is
26667 * meant to be used by programs such as editors or commandline tools.
26669 * It is a programmer error to give a @key that isn't contained in the
26670 * schema for @settings.
26672 * Returns: %TRUE if @value is valid for @key
26678 * g_settings_reset:
26679 * @settings: a #GSettings object
26680 * @key: the name of a key
26682 * Resets @key to its default value.
26684 * This call resets the key, as much as possible, to its default value.
26685 * That might the value specified in the schema or the one set by the
26691 * g_settings_revert:
26692 * @settings: a #GSettings instance
26694 * Reverts all non-applied changes to the settings. This function
26695 * does nothing unless @settings is in 'delay-apply' mode; see
26696 * g_settings_delay(). In the normal case settings are always applied
26699 * Change notifications will be emitted for affected keys.
26704 * g_settings_schema_get_id:
26705 * @schema: a #GSettingsSchema
26707 * Get the ID of @schema.
26709 * Returns: (transfer none): the ID
26714 * g_settings_schema_get_path:
26715 * @schema: a #GSettingsSchema
26717 * Gets the path associated with @schema, or %NULL.
26719 * Schemas may be single-instance or relocatable. Single-instance
26720 * schemas correspond to exactly one set of keys in the backend
26721 * database: those located at the path returned by this function.
26723 * Relocatable schemas can be referenced by other schemas and can
26724 * threfore describe multiple sets of keys at different locations. For
26725 * relocatable schemas, this function will return %NULL.
26727 * Returns: (transfer none): the path of the schema, or %NULL
26733 * g_settings_schema_ref:
26734 * @schema: a #GSettingsSchema
26736 * Increase the reference count of @schema, returning a new reference.
26738 * Returns: a new reference to @schema
26744 * g_settings_schema_source_get_default:
26746 * Gets the default system schema source.
26748 * This function is not required for normal uses of #GSettings but it
26749 * may be useful to authors of plugin management systems or to those who
26750 * want to introspect the content of schemas.
26752 * If no schemas are installed, %NULL will be returned.
26754 * The returned source may actually consist of multiple schema sources
26755 * from different directories, depending on which directories were given
26756 * in <envar>XDG_DATA_DIRS</envar> and
26757 * <envar>GSETTINGS_SCHEMA_DIR</envar>. For this reason, all lookups
26758 * performed against the default source should probably be done
26761 * Returns: (transfer none): the default schema source
26767 * g_settings_schema_source_lookup:
26768 * @source: a #GSettingsSchemaSource
26769 * @schema_id: a schema ID
26770 * @recursive: %TRUE if the lookup should be recursive
26772 * Looks up a schema with the identifier @schema_id in @source.
26774 * This function is not required for normal uses of #GSettings but it
26775 * may be useful to authors of plugin management systems or to those who
26776 * want to introspect the content of schemas.
26778 * If the schema isn't found directly in @source and @recursive is %TRUE
26779 * then the parent sources will also be checked.
26781 * If the schema isn't found, %NULL is returned.
26783 * Returns: (transfer full): a new #GSettingsSchema
26789 * g_settings_schema_source_new_from_directory:
26790 * @directory: the filename of a directory
26791 * @parent: (allow-none): a #GSettingsSchemaSource, or %NULL
26792 * @trusted: %TRUE, if the directory is trusted
26793 * @error: a pointer to a #GError pointer set to %NULL, or %NULL
26795 * Attempts to create a new schema source corresponding to the contents
26796 * of the given directory.
26798 * This function is not required for normal uses of #GSettings but it
26799 * may be useful to authors of plugin management systems.
26801 * The directory should contain a file called
26802 * <filename>gschemas.compiled</filename> as produced by
26803 * <command>glib-compile-schemas</command>.
26805 * If @trusted is %TRUE then <filename>gschemas.compiled</filename> is
26806 * trusted not to be corrupted. This assumption has a performance
26807 * advantage, but can result in crashes or inconsistent behaviour in the
26808 * case of a corrupted file. Generally, you should set @trusted to
26809 * %TRUE for files installed by the system and to %FALSE for files in
26810 * the home directory.
26812 * If @parent is non-%NULL then there are two effects.
26814 * First, if g_settings_schema_source_lookup() is called with the
26815 * @recursive flag set to %TRUE and the schema can not be found in the
26816 * source, the lookup will recurse to the parent.
26818 * Second, any references to other schemas specified within this
26819 * source (ie: <literal>child</literal> or <literal>extents</literal>)
26820 * references may be resolved from the @parent.
26822 * For this second reason, except in very unusual situations, the
26823 * @parent should probably be given as the default schema source, as
26824 * returned by g_settings_schema_source_get_default().
26831 * g_settings_schema_source_ref:
26832 * @source: a #GSettingsSchemaSource
26834 * Increase the reference count of @source, returning a new reference.
26836 * Returns: a new reference to @source
26842 * g_settings_schema_source_unref:
26843 * @source: a #GSettingsSchemaSource
26845 * Decrease the reference count of @source, possibly freeing it.
26852 * g_settings_schema_unref:
26853 * @schema: a #GSettingsSchema
26855 * Decrease the reference count of @schema, possibly freeing it.
26863 * @settings: a #GSettings object
26864 * @key: the name of the key to set
26865 * @format: a #GVariant format string
26866 * @...: arguments as per @format
26868 * Sets @key in @settings to @value.
26870 * A convenience function that combines g_settings_set_value() with
26873 * It is a programmer error to give a @key that isn't contained in the
26874 * schema for @settings or for the #GVariantType of @format to mismatch
26875 * the type given in the schema.
26877 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26883 * g_settings_set_boolean:
26884 * @settings: a #GSettings object
26885 * @key: the name of the key to set
26886 * @value: the value to set it to
26888 * Sets @key in @settings to @value.
26890 * A convenience variant of g_settings_set() for booleans.
26892 * It is a programmer error to give a @key that isn't specified as
26893 * having a boolean type in the schema for @settings.
26895 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26901 * g_settings_set_double:
26902 * @settings: a #GSettings object
26903 * @key: the name of the key to set
26904 * @value: the value to set it to
26906 * Sets @key in @settings to @value.
26908 * A convenience variant of g_settings_set() for doubles.
26910 * It is a programmer error to give a @key that isn't specified as
26911 * having a 'double' type in the schema for @settings.
26913 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26919 * g_settings_set_enum:
26920 * @settings: a #GSettings object
26921 * @key: a key, within @settings
26922 * @value: an enumerated value
26924 * Looks up the enumerated type nick for @value and writes it to @key,
26925 * within @settings.
26927 * It is a programmer error to give a @key that isn't contained in the
26928 * schema for @settings or is not marked as an enumerated type, or for
26929 * @value not to be a valid value for the named type.
26931 * After performing the write, accessing @key directly with
26932 * g_settings_get_string() will return the 'nick' associated with
26935 * Returns: %TRUE, if the set succeeds
26940 * g_settings_set_flags:
26941 * @settings: a #GSettings object
26942 * @key: a key, within @settings
26943 * @value: a flags value
26945 * Looks up the flags type nicks for the bits specified by @value, puts
26946 * them in an array of strings and writes the array to @key, within
26949 * It is a programmer error to give a @key that isn't contained in the
26950 * schema for @settings or is not marked as a flags type, or for @value
26951 * to contain any bits that are not value for the named type.
26953 * After performing the write, accessing @key directly with
26954 * g_settings_get_strv() will return an array of 'nicks'; one for each
26957 * Returns: %TRUE, if the set succeeds
26962 * g_settings_set_int:
26963 * @settings: a #GSettings object
26964 * @key: the name of the key to set
26965 * @value: the value to set it to
26967 * Sets @key in @settings to @value.
26969 * A convenience variant of g_settings_set() for 32-bit integers.
26971 * It is a programmer error to give a @key that isn't specified as
26972 * having a int32 type in the schema for @settings.
26974 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26980 * g_settings_set_string:
26981 * @settings: a #GSettings object
26982 * @key: the name of the key to set
26983 * @value: the value to set it to
26985 * Sets @key in @settings to @value.
26987 * A convenience variant of g_settings_set() for strings.
26989 * It is a programmer error to give a @key that isn't specified as
26990 * having a string type in the schema for @settings.
26992 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26998 * g_settings_set_strv:
26999 * @settings: a #GSettings object
27000 * @key: the name of the key to set
27001 * @value: (allow-none) (array zero-terminated=1): the value to set it to, or %NULL
27003 * Sets @key in @settings to @value.
27005 * A convenience variant of g_settings_set() for string arrays. If
27006 * @value is %NULL, then @key is set to be the empty array.
27008 * It is a programmer error to give a @key that isn't specified as
27009 * having an array of strings type in the schema for @settings.
27011 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27017 * g_settings_set_uint:
27018 * @settings: a #GSettings object
27019 * @key: the name of the key to set
27020 * @value: the value to set it to
27022 * Sets @key in @settings to @value.
27024 * A convenience variant of g_settings_set() for 32-bit unsigned
27027 * It is a programmer error to give a @key that isn't specified as
27028 * having a uint32 type in the schema for @settings.
27030 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27036 * g_settings_set_value:
27037 * @settings: a #GSettings object
27038 * @key: the name of the key to set
27039 * @value: a #GVariant of the correct type
27041 * Sets @key in @settings to @value.
27043 * It is a programmer error to give a @key that isn't contained in the
27044 * schema for @settings or for @value to have the incorrect type, per
27047 * If @value is floating then this function consumes the reference.
27049 * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27057 * Ensures that all pending operations for the given are complete for
27058 * the default backend.
27060 * Writes made to a #GSettings are handled asynchronously. For this
27061 * reason, it is very unlikely that the changes have it to disk by the
27062 * time g_settings_set() returns.
27064 * This call will block until all of the writes have made it to the
27065 * backend. Since the mainloop is not running, no change notifications
27066 * will be dispatched during this call (but some may be queued by the
27067 * time the call is done).
27072 * g_settings_unbind:
27073 * @object: the object
27074 * @property: the property whose binding is removed
27076 * Removes an existing binding for @property on @object.
27078 * Note that bindings are automatically removed when the
27079 * object is finalized, so it is rarely necessary to call this
27087 * g_simple_action_group_add_entries:
27088 * @simple: a #GSimpleActionGroup
27089 * @entries: (array length=n_entries): a pointer to the first item in an array of #GActionEntry structs
27090 * @n_entries: the length of @entries, or -1
27091 * @user_data: the user data for signal connections
27093 * A convenience function for creating multiple #GSimpleAction instances
27094 * and adding them to the action group.
27101 * g_simple_action_group_insert:
27102 * @simple: a #GSimpleActionGroup
27103 * @action: a #GAction
27105 * Adds an action to the action group.
27107 * If the action group already contains an action with the same name as
27108 * @action then the old action is dropped from the group.
27110 * The action group takes its own reference on @action.
27117 * g_simple_action_group_lookup:
27118 * @simple: a #GSimpleActionGroup
27119 * @action_name: the name of an action
27121 * Looks up the action with the name @action_name in the group.
27123 * If no such action exists, returns %NULL.
27125 * Returns: (transfer none): a #GAction, or %NULL
27131 * g_simple_action_group_new:
27133 * Creates a new, empty, #GSimpleActionGroup.
27135 * Returns: a new #GSimpleActionGroup
27141 * g_simple_action_group_remove:
27142 * @simple: a #GSimpleActionGroup
27143 * @action_name: the name of the action
27145 * Removes the named action from the action group.
27147 * If no action of this name is in the group then nothing happens.
27154 * g_simple_action_new:
27155 * @name: the name of the action
27156 * @parameter_type: (allow-none): the type of parameter to the activate function
27158 * Creates a new action.
27160 * The created action is stateless. See g_simple_action_new_stateful().
27162 * Returns: a new #GSimpleAction
27168 * g_simple_action_new_stateful:
27169 * @name: the name of the action
27170 * @parameter_type: (allow-none): the type of the parameter to the activate function
27171 * @state: the initial state of the action
27173 * Creates a new stateful action.
27175 * @state is the initial state of the action. All future state values
27176 * must have the same #GVariantType as the initial state.
27178 * If the @state GVariant is floating, it is consumed.
27180 * Returns: a new #GSimpleAction
27186 * g_simple_action_set_enabled:
27187 * @simple: a #GSimpleAction
27188 * @enabled: whether the action is enabled
27190 * Sets the action as enabled or not.
27192 * An action must be enabled in order to be activated or in order to
27193 * have its state changed from outside callers.
27195 * This should only be called by the implementor of the action. Users
27196 * of the action should not attempt to modify its enabled flag.
27203 * g_simple_action_set_state:
27204 * @simple: a #GSimpleAction
27205 * @value: the new #GVariant for the state
27207 * Sets the state of the action.
27209 * This directly updates the 'state' property to the given value.
27211 * This should only be called by the implementor of the action. Users
27212 * of the action should not attempt to directly modify the 'state'
27213 * property. Instead, they should call g_action_change_state() to
27214 * request the change.
27221 * g_simple_async_report_error_in_idle: (skip)
27222 * @object: (allow-none): a #GObject, or %NULL.
27223 * @callback: a #GAsyncReadyCallback.
27224 * @user_data: user data passed to @callback.
27225 * @domain: a #GQuark containing the error domain (usually #G_IO_ERROR).
27226 * @code: a specific error code.
27227 * @format: a formatted error reporting string.
27228 * @...: a list of variables to fill in @format.
27230 * Reports an error in an asynchronous function in an idle function by
27231 * directly setting the contents of the #GAsyncResult with the given error
27237 * g_simple_async_report_gerror_in_idle:
27238 * @object: (allow-none): a #GObject, or %NULL
27239 * @callback: (scope async): a #GAsyncReadyCallback.
27240 * @user_data: (closure): user data passed to @callback.
27241 * @error: the #GError to report
27243 * Reports an error in an idle function. Similar to
27244 * g_simple_async_report_error_in_idle(), but takes a #GError rather
27245 * than building a new one.
27250 * g_simple_async_report_take_gerror_in_idle: (skip)
27251 * @object: (allow-none): a #GObject, or %NULL
27252 * @callback: a #GAsyncReadyCallback.
27253 * @user_data: user data passed to @callback.
27254 * @error: the #GError to report
27256 * Reports an error in an idle function. Similar to
27257 * g_simple_async_report_gerror_in_idle(), but takes over the caller's
27258 * ownership of @error, so the caller does not have to free it any more.
27265 * g_simple_async_result_complete:
27266 * @simple: a #GSimpleAsyncResult.
27268 * Completes an asynchronous I/O job immediately. Must be called in
27269 * the thread where the asynchronous result was to be delivered, as it
27270 * invokes the callback directly. If you are in a different thread use
27271 * g_simple_async_result_complete_in_idle().
27273 * Calling this function takes a reference to @simple for as long as
27274 * is needed to complete the call.
27279 * g_simple_async_result_complete_in_idle:
27280 * @simple: a #GSimpleAsyncResult.
27282 * Completes an asynchronous function in an idle handler in the <link
27283 * linkend="g-main-context-push-thread-default">thread-default main
27284 * loop</link> of the thread that @simple was initially created in
27285 * (and re-pushes that context around the invocation of the callback).
27287 * Calling this function takes a reference to @simple for as long as
27288 * is needed to complete the call.
27293 * g_simple_async_result_get_op_res_gboolean:
27294 * @simple: a #GSimpleAsyncResult.
27296 * Gets the operation result boolean from within the asynchronous result.
27298 * Returns: %TRUE if the operation's result was %TRUE, %FALSE if the operation's result was %FALSE.
27303 * g_simple_async_result_get_op_res_gpointer: (skip)
27304 * @simple: a #GSimpleAsyncResult.
27306 * Gets a pointer result as returned by the asynchronous function.
27308 * Returns: a pointer from the result.
27313 * g_simple_async_result_get_op_res_gssize:
27314 * @simple: a #GSimpleAsyncResult.
27316 * Gets a gssize from the asynchronous result.
27318 * Returns: a gssize returned from the asynchronous function.
27323 * g_simple_async_result_get_source_tag: (skip)
27324 * @simple: a #GSimpleAsyncResult.
27326 * Gets the source tag for the #GSimpleAsyncResult.
27328 * Returns: a #gpointer to the source object for the #GSimpleAsyncResult.
27333 * g_simple_async_result_is_valid:
27334 * @result: the #GAsyncResult passed to the _finish function.
27335 * @source: the #GObject passed to the _finish function.
27336 * @source_tag: the asynchronous function.
27338 * Ensures that the data passed to the _finish function of an async
27339 * operation is consistent. Three checks are performed.
27341 * First, @result is checked to ensure that it is really a
27342 * #GSimpleAsyncResult. Second, @source is checked to ensure that it
27343 * matches the source object of @result. Third, @source_tag is
27344 * checked to ensure that it is either %NULL (as it is when the result was
27345 * created by g_simple_async_report_error_in_idle() or
27346 * g_simple_async_report_gerror_in_idle()) or equal to the
27347 * @source_tag argument given to g_simple_async_result_new() (which, by
27348 * convention, is a pointer to the _async function corresponding to the
27349 * _finish function from which this function is called).
27351 * Returns: #TRUE if all checks passed or #FALSE if any failed.
27357 * g_simple_async_result_new:
27358 * @source_object: (allow-none): a #GObject, or %NULL.
27359 * @callback: (scope async): a #GAsyncReadyCallback.
27360 * @user_data: (closure): user data passed to @callback.
27361 * @source_tag: the asynchronous function.
27363 * Creates a #GSimpleAsyncResult.
27365 * The common convention is to create the #GSimpleAsyncResult in the
27366 * function that starts the asynchronous operation and use that same
27367 * function as the @source_tag.
27369 * If your operation supports cancellation with #GCancellable (which it
27370 * probably should) then you should provide the user's cancellable to
27371 * g_simple_async_result_set_check_cancellable() immediately after
27372 * this function returns.
27374 * Returns: a #GSimpleAsyncResult.
27379 * g_simple_async_result_new_error:
27380 * @source_object: (allow-none): a #GObject, or %NULL.
27381 * @callback: (scope async): a #GAsyncReadyCallback.
27382 * @user_data: (closure): user data passed to @callback.
27383 * @domain: a #GQuark.
27384 * @code: an error code.
27385 * @format: a string with format characters.
27386 * @...: a list of values to insert into @format.
27388 * Creates a new #GSimpleAsyncResult with a set error.
27390 * Returns: a #GSimpleAsyncResult.
27395 * g_simple_async_result_new_from_error:
27396 * @source_object: (allow-none): a #GObject, or %NULL.
27397 * @callback: (scope async): a #GAsyncReadyCallback.
27398 * @user_data: (closure): user data passed to @callback.
27399 * @error: a #GError
27401 * Creates a #GSimpleAsyncResult from an error condition.
27403 * Returns: a #GSimpleAsyncResult.
27408 * g_simple_async_result_new_take_error: (skip)
27409 * @source_object: (allow-none): a #GObject, or %NULL
27410 * @callback: (scope async): a #GAsyncReadyCallback
27411 * @user_data: (closure): user data passed to @callback
27412 * @error: a #GError
27414 * Creates a #GSimpleAsyncResult from an error condition, and takes over the
27415 * caller's ownership of @error, so the caller does not need to free it anymore.
27417 * Returns: a #GSimpleAsyncResult
27423 * g_simple_async_result_propagate_error:
27424 * @simple: a #GSimpleAsyncResult.
27425 * @dest: (out): a location to propagate the error to.
27427 * Propagates an error from within the simple asynchronous result to
27428 * a given destination.
27430 * If the #GCancellable given to a prior call to
27431 * g_simple_async_result_set_check_cancellable() is cancelled then this
27432 * function will return %TRUE with @dest set appropriately.
27434 * Returns: %TRUE if the error was propagated to @dest. %FALSE otherwise.
27439 * g_simple_async_result_run_in_thread: (skip)
27440 * @simple: a #GSimpleAsyncResult.
27441 * @func: a #GSimpleAsyncThreadFunc.
27442 * @io_priority: the io priority of the request.
27443 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27445 * Runs the asynchronous job in a separate thread and then calls
27446 * g_simple_async_result_complete_in_idle() on @simple to return
27447 * the result to the appropriate main loop.
27449 * Calling this function takes a reference to @simple for as long as
27450 * is needed to run the job and report its completion.
27455 * g_simple_async_result_set_check_cancellable:
27456 * @simple: a #GSimpleAsyncResult
27457 * @check_cancellable: (allow-none): a #GCancellable to check, or %NULL to unset
27459 * Sets a #GCancellable to check before dispatching results.
27461 * This function has one very specific purpose: the provided cancellable
27462 * is checked at the time of g_simple_async_result_propagate_error() If
27463 * it is cancelled, these functions will return an "Operation was
27464 * cancelled" error (%G_IO_ERROR_CANCELLED).
27466 * Implementors of cancellable asynchronous functions should use this in
27467 * order to provide a guarantee to their callers that cancelling an
27468 * async operation will reliably result in an error being returned for
27469 * that operation (even if a positive result for the operation has
27470 * already been sent as an idle to the main context to be dispatched).
27472 * The checking described above is done regardless of any call to the
27473 * unrelated g_simple_async_result_set_handle_cancellation() function.
27480 * g_simple_async_result_set_error: (skip)
27481 * @simple: a #GSimpleAsyncResult.
27482 * @domain: a #GQuark (usually #G_IO_ERROR).
27483 * @code: an error code.
27484 * @format: a formatted error reporting string.
27485 * @...: a list of variables to fill in @format.
27487 * Sets an error within the asynchronous result without a #GError.
27492 * g_simple_async_result_set_error_va: (skip)
27493 * @simple: a #GSimpleAsyncResult.
27494 * @domain: a #GQuark (usually #G_IO_ERROR).
27495 * @code: an error code.
27496 * @format: a formatted error reporting string.
27497 * @args: va_list of arguments.
27499 * Sets an error within the asynchronous result without a #GError.
27500 * Unless writing a binding, see g_simple_async_result_set_error().
27505 * g_simple_async_result_set_from_error:
27506 * @simple: a #GSimpleAsyncResult.
27509 * Sets the result from a #GError.
27514 * g_simple_async_result_set_handle_cancellation:
27515 * @simple: a #GSimpleAsyncResult.
27516 * @handle_cancellation: a #gboolean.
27518 * Sets whether to handle cancellation within the asynchronous operation.
27520 * This function has nothing to do with
27521 * g_simple_async_result_set_check_cancellable(). It only refers to the
27522 * #GCancellable passed to g_simple_async_result_run_in_thread().
27527 * g_simple_async_result_set_op_res_gboolean:
27528 * @simple: a #GSimpleAsyncResult.
27529 * @op_res: a #gboolean.
27531 * Sets the operation result to a boolean within the asynchronous result.
27536 * g_simple_async_result_set_op_res_gpointer: (skip)
27537 * @simple: a #GSimpleAsyncResult.
27538 * @op_res: a pointer result from an asynchronous function.
27539 * @destroy_op_res: a #GDestroyNotify function.
27541 * Sets the operation result within the asynchronous result to a pointer.
27546 * g_simple_async_result_set_op_res_gssize:
27547 * @simple: a #GSimpleAsyncResult.
27548 * @op_res: a #gssize.
27550 * Sets the operation result within the asynchronous result to
27551 * the given @op_res.
27556 * g_simple_async_result_take_error: (skip)
27557 * @simple: a #GSimpleAsyncResult
27558 * @error: a #GError
27560 * Sets the result from @error, and takes over the caller's ownership
27561 * of @error, so the caller does not need to free it any more.
27568 * g_simple_permission_new:
27569 * @allowed: %TRUE if the action is allowed
27571 * Creates a new #GPermission instance that represents an action that is
27572 * either always or never allowed.
27574 * Returns: the #GSimplePermission, as a #GPermission
27581 * @socket: a #GSocket.
27582 * @cancellable: (allow-none): a %GCancellable or %NULL
27583 * @error: #GError for error reporting, or %NULL to ignore.
27585 * Accept incoming connections on a connection-based socket. This removes
27586 * the first outstanding connection request from the listening socket and
27587 * creates a #GSocket object for it.
27589 * The @socket must be bound to a local address with g_socket_bind() and
27590 * must be listening for incoming connections (g_socket_listen()).
27592 * If there are no outstanding connections then the operation will block
27593 * or return %G_IO_ERROR_WOULD_BLOCK if non-blocking I/O is enabled.
27594 * To be notified of an incoming connection, wait for the %G_IO_IN condition.
27596 * Returns: (transfer full): a new #GSocket, or %NULL on error. Free the returned object with g_object_unref().
27602 * g_socket_address_enumerator_next:
27603 * @enumerator: a #GSocketAddressEnumerator
27604 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27605 * @error: a #GError.
27607 * Retrieves the next #GSocketAddress from @enumerator. Note that this
27608 * may block for some amount of time. (Eg, a #GNetworkAddress may need
27609 * to do a DNS lookup before it can return an address.) Use
27610 * g_socket_address_enumerator_next_async() if you need to avoid
27613 * If @enumerator is expected to yield addresses, but for some reason
27614 * is unable to (eg, because of a DNS error), then the first call to
27615 * g_socket_address_enumerator_next() will return an appropriate error
27616 * in *@error. However, if the first call to
27617 * g_socket_address_enumerator_next() succeeds, then any further
27618 * internal errors (other than @cancellable being triggered) will be
27621 * 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.
27626 * g_socket_address_enumerator_next_async:
27627 * @enumerator: a #GSocketAddressEnumerator
27628 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27629 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
27630 * @user_data: (closure): the data to pass to callback function
27632 * Asynchronously retrieves the next #GSocketAddress from @enumerator
27633 * and then calls @callback, which must call
27634 * g_socket_address_enumerator_next_finish() to get the result.
27639 * g_socket_address_enumerator_next_finish:
27640 * @enumerator: a #GSocketAddressEnumerator
27641 * @result: a #GAsyncResult
27642 * @error: a #GError
27644 * Retrieves the result of a completed call to
27645 * g_socket_address_enumerator_next_async(). See
27646 * g_socket_address_enumerator_next() for more information about
27649 * 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.
27654 * g_socket_address_get_family:
27655 * @address: a #GSocketAddress
27657 * Gets the socket family type of @address.
27659 * Returns: the socket family type of @address.
27665 * g_socket_address_get_native_size:
27666 * @address: a #GSocketAddress
27668 * Gets the size of @address's native <type>struct sockaddr</type>.
27669 * You can use this to allocate memory to pass to
27670 * g_socket_address_to_native().
27672 * Returns: the size of the native <type>struct sockaddr</type> that @address represents
27678 * g_socket_address_new_from_native:
27679 * @native: a pointer to a <type>struct sockaddr</type>
27680 * @len: the size of the memory location pointed to by @native
27682 * Creates a #GSocketAddress subclass corresponding to the native
27683 * <type>struct sockaddr</type> @native.
27685 * Returns: a new #GSocketAddress if @native could successfully be converted, otherwise %NULL.
27691 * g_socket_address_to_native:
27692 * @address: a #GSocketAddress
27693 * @dest: a pointer to a memory location that will contain the native <type>struct sockaddr</type>.
27694 * @destlen: the size of @dest. Must be at least as large as g_socket_address_get_native_size().
27695 * @error: #GError for error reporting, or %NULL to ignore.
27697 * Converts a #GSocketAddress to a native <type>struct
27698 * sockaddr</type>, which can be passed to low-level functions like
27699 * connect() or bind().
27701 * If not enough space is available, a %G_IO_ERROR_NO_SPACE error is
27702 * returned. If the address type is not known on the system
27703 * then a %G_IO_ERROR_NOT_SUPPORTED error is returned.
27705 * Returns: %TRUE if @dest was filled in, %FALSE on error
27712 * @socket: a #GSocket.
27713 * @address: a #GSocketAddress specifying the local address.
27714 * @allow_reuse: whether to allow reusing this address
27715 * @error: #GError for error reporting, or %NULL to ignore.
27717 * When a socket is created it is attached to an address family, but it
27718 * doesn't have an address in this family. g_socket_bind() assigns the
27719 * address (sometimes called name) of the socket.
27721 * It is generally required to bind to a local address before you can
27722 * receive connections. (See g_socket_listen() and g_socket_accept() ).
27723 * In certain situations, you may also want to bind a socket that will be
27724 * used to initiate connections, though this is not normally required.
27726 * @allow_reuse should be %TRUE for server sockets (sockets that you will
27727 * eventually call g_socket_accept() on), and %FALSE for client sockets.
27728 * (Specifically, if it is %TRUE, then g_socket_bind() will set the
27729 * %SO_REUSEADDR flag on the socket, allowing it to bind @address even if
27730 * that address was previously used by another socket that has not yet been
27731 * fully cleaned-up by the kernel. Failing to set this flag on a server
27732 * socket may cause the bind call to return %G_IO_ERROR_ADDRESS_IN_USE if
27733 * the server program is stopped and then immediately restarted.)
27735 * Returns: %TRUE on success, %FALSE on error.
27741 * g_socket_check_connect_result:
27742 * @socket: a #GSocket
27743 * @error: #GError for error reporting, or %NULL to ignore.
27745 * Checks and resets the pending connect error for the socket.
27746 * This is used to check for errors when g_socket_connect() is
27747 * used in non-blocking mode.
27749 * Returns: %TRUE if no error, %FALSE otherwise, setting @error to the error
27755 * g_socket_client_add_application_proxy:
27756 * @client: a #GSocketClient
27757 * @protocol: The proxy protocol
27759 * Enable proxy protocols to be handled by the application. When the
27760 * indicated proxy protocol is returned by the #GProxyResolver,
27761 * #GSocketClient will consider this protocol as supported but will
27762 * not try to find a #GProxy instance to handle handshaking. The
27763 * application must check for this case by calling
27764 * g_socket_connection_get_remote_address() on the returned
27765 * #GSocketConnection, and seeing if it's a #GProxyAddress of the
27766 * appropriate type, to determine whether or not it needs to handle
27767 * the proxy handshaking itself.
27769 * This should be used for proxy protocols that are dialects of
27770 * another protocol such as HTTP proxy. It also allows cohabitation of
27771 * proxy protocols that are reused between protocols. A good example
27772 * is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also
27773 * be use as generic socket proxy through the HTTP CONNECT method.
27775 * When the proxy is detected as being an application proxy, TLS handshake
27776 * will be skipped. This is required to let the application do the proxy
27777 * specific handshake.
27782 * g_socket_client_connect:
27783 * @client: a #GSocketClient.
27784 * @connectable: a #GSocketConnectable specifying the remote address.
27785 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27786 * @error: #GError for error reporting, or %NULL to ignore.
27788 * Tries to resolve the @connectable and make a network connection to it.
27790 * Upon a successful connection, a new #GSocketConnection is constructed
27791 * and returned. The caller owns this new object and must drop their
27792 * reference to it when finished with it.
27794 * The type of the #GSocketConnection object returned depends on the type of
27795 * the underlying socket that is used. For instance, for a TCP/IP connection
27796 * it will be a #GTcpConnection.
27798 * The socket created will be the same family as the address that the
27799 * @connectable resolves to, unless family is set with g_socket_client_set_family()
27800 * or indirectly via g_socket_client_set_local_address(). The socket type
27801 * defaults to %G_SOCKET_TYPE_STREAM but can be set with
27802 * g_socket_client_set_socket_type().
27804 * If a local address is specified with g_socket_client_set_local_address() the
27805 * socket will be bound to this address before connecting.
27807 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27813 * g_socket_client_connect_async:
27814 * @client: a #GSocketClient
27815 * @connectable: a #GSocketConnectable specifying the remote address.
27816 * @cancellable: (allow-none): a #GCancellable, or %NULL
27817 * @callback: (scope async): a #GAsyncReadyCallback
27818 * @user_data: (closure): user data for the callback
27820 * This is the asynchronous version of g_socket_client_connect().
27822 * When the operation is finished @callback will be
27823 * called. You can then call g_socket_client_connect_finish() to get
27824 * the result of the operation.
27831 * g_socket_client_connect_finish:
27832 * @client: a #GSocketClient.
27833 * @result: a #GAsyncResult.
27834 * @error: a #GError location to store the error occurring, or %NULL to ignore.
27836 * Finishes an async connect operation. See g_socket_client_connect_async()
27838 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27844 * g_socket_client_connect_to_host:
27845 * @client: a #GSocketClient
27846 * @host_and_port: the name and optionally port of the host to connect to
27847 * @default_port: the default port to connect to
27848 * @cancellable: (allow-none): a #GCancellable, or %NULL
27849 * @error: a pointer to a #GError, or %NULL
27851 * This is a helper function for g_socket_client_connect().
27853 * Attempts to create a TCP connection to the named host.
27855 * @host_and_port may be in any of a number of recognized formats; an IPv6
27856 * address, an IPv4 address, or a domain name (in which case a DNS
27857 * lookup is performed). Quoting with [] is supported for all address
27858 * types. A port override may be specified in the usual way with a
27859 * colon. Ports may be given as decimal numbers or symbolic names (in
27860 * which case an /etc/services lookup is performed).
27862 * If no port override is given in @host_and_port then @default_port will be
27863 * used as the port number to connect to.
27865 * In general, @host_and_port is expected to be provided by the user (allowing
27866 * them to give the hostname, and a port override if necessary) and
27867 * @default_port is expected to be provided by the application.
27869 * In the case that an IP address is given, a single connection
27870 * attempt is made. In the case that a name is given, multiple
27871 * connection attempts may be made, in turn and according to the
27872 * number of address records in DNS, until a connection succeeds.
27874 * Upon a successful connection, a new #GSocketConnection is constructed
27875 * and returned. The caller owns this new object and must drop their
27876 * reference to it when finished with it.
27878 * In the event of any failure (DNS error, service not found, no hosts
27879 * connectable) %NULL is returned and @error (if non-%NULL) is set
27882 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27888 * g_socket_client_connect_to_host_async:
27889 * @client: a #GSocketClient
27890 * @host_and_port: the name and optionally the port of the host to connect to
27891 * @default_port: the default port to connect to
27892 * @cancellable: (allow-none): a #GCancellable, or %NULL
27893 * @callback: (scope async): a #GAsyncReadyCallback
27894 * @user_data: (closure): user data for the callback
27896 * This is the asynchronous version of g_socket_client_connect_to_host().
27898 * When the operation is finished @callback will be
27899 * called. You can then call g_socket_client_connect_to_host_finish() to get
27900 * the result of the operation.
27907 * g_socket_client_connect_to_host_finish:
27908 * @client: a #GSocketClient.
27909 * @result: a #GAsyncResult.
27910 * @error: a #GError location to store the error occurring, or %NULL to ignore.
27912 * Finishes an async connect operation. See g_socket_client_connect_to_host_async()
27914 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27920 * g_socket_client_connect_to_service:
27921 * @client: a #GSocketConnection
27922 * @domain: a domain name
27923 * @service: the name of the service to connect to
27924 * @cancellable: (allow-none): a #GCancellable, or %NULL
27925 * @error: a pointer to a #GError, or %NULL
27927 * Attempts to create a TCP connection to a service.
27929 * This call looks up the SRV record for @service at @domain for the
27930 * "tcp" protocol. It then attempts to connect, in turn, to each of
27931 * the hosts providing the service until either a connection succeeds
27932 * or there are no hosts remaining.
27934 * Upon a successful connection, a new #GSocketConnection is constructed
27935 * and returned. The caller owns this new object and must drop their
27936 * reference to it when finished with it.
27938 * In the event of any failure (DNS error, service not found, no hosts
27939 * connectable) %NULL is returned and @error (if non-%NULL) is set
27942 * Returns: (transfer full): a #GSocketConnection if successful, or %NULL on error
27947 * g_socket_client_connect_to_service_async:
27948 * @client: a #GSocketClient
27949 * @domain: a domain name
27950 * @service: the name of the service to connect to
27951 * @cancellable: (allow-none): a #GCancellable, or %NULL
27952 * @callback: (scope async): a #GAsyncReadyCallback
27953 * @user_data: (closure): user data for the callback
27955 * This is the asynchronous version of
27956 * g_socket_client_connect_to_service().
27963 * g_socket_client_connect_to_service_finish:
27964 * @client: a #GSocketClient.
27965 * @result: a #GAsyncResult.
27966 * @error: a #GError location to store the error occurring, or %NULL to ignore.
27968 * Finishes an async connect operation. See g_socket_client_connect_to_service_async()
27970 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27976 * g_socket_client_connect_to_uri:
27977 * @client: a #GSocketClient
27978 * @uri: A network URI
27979 * @default_port: the default port to connect to
27980 * @cancellable: (allow-none): a #GCancellable, or %NULL
27981 * @error: a pointer to a #GError, or %NULL
27983 * This is a helper function for g_socket_client_connect().
27985 * Attempts to create a TCP connection with a network URI.
27987 * @uri may be any valid URI containing an "authority" (hostname/port)
27988 * component. If a port is not specified in the URI, @default_port
27989 * will be used. TLS will be negotiated if #GSocketClient:tls is %TRUE.
27990 * (#GSocketClient does not know to automatically assume TLS for
27991 * certain URI schemes.)
27993 * Using this rather than g_socket_client_connect() or
27994 * g_socket_client_connect_to_host() allows #GSocketClient to
27995 * determine when to use application-specific proxy protocols.
27997 * Upon a successful connection, a new #GSocketConnection is constructed
27998 * and returned. The caller owns this new object and must drop their
27999 * reference to it when finished with it.
28001 * In the event of any failure (DNS error, service not found, no hosts
28002 * connectable) %NULL is returned and @error (if non-%NULL) is set
28005 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28011 * g_socket_client_connect_to_uri_async:
28012 * @client: a #GSocketClient
28013 * @uri: a network uri
28014 * @default_port: the default port to connect to
28015 * @cancellable: (allow-none): a #GCancellable, or %NULL
28016 * @callback: (scope async): a #GAsyncReadyCallback
28017 * @user_data: (closure): user data for the callback
28019 * This is the asynchronous version of g_socket_client_connect_to_uri().
28021 * When the operation is finished @callback will be
28022 * called. You can then call g_socket_client_connect_to_uri_finish() to get
28023 * the result of the operation.
28030 * g_socket_client_connect_to_uri_finish:
28031 * @client: a #GSocketClient.
28032 * @result: a #GAsyncResult.
28033 * @error: a #GError location to store the error occurring, or %NULL to ignore.
28035 * Finishes an async connect operation. See g_socket_client_connect_to_uri_async()
28037 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28043 * g_socket_client_get_enable_proxy:
28044 * @client: a #GSocketClient.
28046 * Gets the proxy enable state; see g_socket_client_set_enable_proxy()
28048 * Returns: whether proxying is enabled
28054 * g_socket_client_get_family:
28055 * @client: a #GSocketClient.
28057 * Gets the socket family of the socket client.
28059 * See g_socket_client_set_family() for details.
28061 * Returns: a #GSocketFamily
28067 * g_socket_client_get_local_address:
28068 * @client: a #GSocketClient.
28070 * Gets the local address of the socket client.
28072 * See g_socket_client_set_local_address() for details.
28074 * Returns: (transfer none): a #GSocketAddress or %NULL. Do not free.
28080 * g_socket_client_get_protocol:
28081 * @client: a #GSocketClient
28083 * Gets the protocol name type of the socket client.
28085 * See g_socket_client_set_protocol() for details.
28087 * Returns: a #GSocketProtocol
28093 * g_socket_client_get_socket_type:
28094 * @client: a #GSocketClient.
28096 * Gets the socket type of the socket client.
28098 * See g_socket_client_set_socket_type() for details.
28100 * Returns: a #GSocketFamily
28106 * g_socket_client_get_timeout:
28107 * @client: a #GSocketClient
28109 * Gets the I/O timeout time for sockets created by @client.
28111 * See g_socket_client_set_timeout() for details.
28113 * Returns: the timeout in seconds
28119 * g_socket_client_get_tls:
28120 * @client: a #GSocketClient.
28122 * Gets whether @client creates TLS connections. See
28123 * g_socket_client_set_tls() for details.
28125 * Returns: whether @client uses TLS
28131 * g_socket_client_get_tls_validation_flags:
28132 * @client: a #GSocketClient.
28134 * Gets the TLS validation flags used creating TLS connections via
28137 * Returns: the TLS validation flags
28143 * g_socket_client_new:
28145 * Creates a new #GSocketClient with the default options.
28147 * Returns: a #GSocketClient. Free the returned object with g_object_unref().
28153 * g_socket_client_set_enable_proxy:
28154 * @client: a #GSocketClient.
28155 * @enable: whether to enable proxies
28157 * Sets whether or not @client attempts to make connections via a
28158 * proxy server. When enabled (the default), #GSocketClient will use a
28159 * #GProxyResolver to determine if a proxy protocol such as SOCKS is
28160 * needed, and automatically do the necessary proxy negotiation.
28167 * g_socket_client_set_family:
28168 * @client: a #GSocketClient.
28169 * @family: a #GSocketFamily
28171 * Sets the socket family of the socket client.
28172 * If this is set to something other than %G_SOCKET_FAMILY_INVALID
28173 * then the sockets created by this object will be of the specified
28176 * This might be useful for instance if you want to force the local
28177 * connection to be an ipv4 socket, even though the address might
28178 * be an ipv6 mapped to ipv4 address.
28185 * g_socket_client_set_local_address:
28186 * @client: a #GSocketClient.
28187 * @address: (allow-none): a #GSocketAddress, or %NULL
28189 * Sets the local address of the socket client.
28190 * The sockets created by this object will bound to the
28191 * specified address (if not %NULL) before connecting.
28193 * This is useful if you want to ensure that the local
28194 * side of the connection is on a specific port, or on
28195 * a specific interface.
28202 * g_socket_client_set_protocol:
28203 * @client: a #GSocketClient.
28204 * @protocol: a #GSocketProtocol
28206 * Sets the protocol of the socket client.
28207 * The sockets created by this object will use of the specified
28210 * If @protocol is %0 that means to use the default
28211 * protocol for the socket family and type.
28218 * g_socket_client_set_socket_type:
28219 * @client: a #GSocketClient.
28220 * @type: a #GSocketType
28222 * Sets the socket type of the socket client.
28223 * The sockets created by this object will be of the specified
28226 * It doesn't make sense to specify a type of %G_SOCKET_TYPE_DATAGRAM,
28227 * as GSocketClient is used for connection oriented services.
28234 * g_socket_client_set_timeout:
28235 * @client: a #GSocketClient.
28236 * @timeout: the timeout
28238 * Sets the I/O timeout for sockets created by @client. @timeout is a
28239 * time in seconds, or 0 for no timeout (the default).
28241 * The timeout value affects the initial connection attempt as well,
28242 * so setting this may cause calls to g_socket_client_connect(), etc,
28243 * to fail with %G_IO_ERROR_TIMED_OUT.
28250 * g_socket_client_set_tls:
28251 * @client: a #GSocketClient.
28252 * @tls: whether to use TLS
28254 * Sets whether @client creates TLS (aka SSL) connections. If @tls is
28255 * %TRUE, @client will wrap its connections in a #GTlsClientConnection
28256 * and perform a TLS handshake when connecting.
28258 * Note that since #GSocketClient must return a #GSocketConnection,
28259 * but #GTlsClientConnection is not a #GSocketConnection, this
28260 * actually wraps the resulting #GTlsClientConnection in a
28261 * #GTcpWrapperConnection when returning it. You can use
28262 * g_tcp_wrapper_connection_get_base_io_stream() on the return value
28263 * to extract the #GTlsClientConnection.
28265 * If you need to modify the behavior of the TLS handshake (eg, by
28266 * setting a client-side certificate to use, or connecting to the
28267 * #GTlsConnection::accept-certificate signal), you can connect to
28268 * @client's #GSocketClient::event signal and wait for it to be
28269 * emitted with %G_SOCKET_CLIENT_TLS_HANDSHAKING, which will give you
28270 * a chance to see the #GTlsClientConnection before the handshake
28278 * g_socket_client_set_tls_validation_flags:
28279 * @client: a #GSocketClient.
28280 * @flags: the validation flags
28282 * Sets the TLS validation flags used when creating TLS connections
28283 * via @client. The default value is %G_TLS_CERTIFICATE_VALIDATE_ALL.
28291 * @socket: a #GSocket
28292 * @error: #GError for error reporting, or %NULL to ignore.
28294 * Closes the socket, shutting down any active connection.
28296 * Closing a socket does not wait for all outstanding I/O operations
28297 * to finish, so the caller should not rely on them to be guaranteed
28298 * to complete even if the close returns with no error.
28300 * Once the socket is closed, all other operations will return
28301 * %G_IO_ERROR_CLOSED. Closing a socket multiple times will not
28304 * Sockets will be automatically closed when the last reference
28305 * is dropped, but you might want to call this function to make sure
28306 * resources are released as early as possible.
28308 * Beware that due to the way that TCP works, it is possible for
28309 * recently-sent data to be lost if either you close a socket while the
28310 * %G_IO_IN condition is set, or else if the remote connection tries to
28311 * send something to you after you close the socket but before it has
28312 * finished reading all of the data you sent. There is no easy generic
28313 * way to avoid this problem; the easiest fix is to design the network
28314 * protocol such that the client will never send data "out of turn".
28315 * Another solution is for the server to half-close the connection by
28316 * calling g_socket_shutdown() with only the @shutdown_write flag set,
28317 * and then wait for the client to notice this and close its side of the
28318 * connection, after which the server can safely call g_socket_close().
28319 * (This is what #GTcpConnection does if you call
28320 * g_tcp_connection_set_graceful_disconnect(). But of course, this
28321 * only works if the client will close its connection after the server
28324 * Returns: %TRUE on success, %FALSE on error
28330 * g_socket_condition_check:
28331 * @socket: a #GSocket
28332 * @condition: a #GIOCondition mask to check
28334 * Checks on the readiness of @socket to perform operations.
28335 * The operations specified in @condition are checked for and masked
28336 * against the currently-satisfied conditions on @socket. The result
28339 * Note that on Windows, it is possible for an operation to return
28340 * %G_IO_ERROR_WOULD_BLOCK even immediately after
28341 * g_socket_condition_check() has claimed that the socket is ready for
28342 * writing. Rather than calling g_socket_condition_check() and then
28343 * writing to the socket if it succeeds, it is generally better to
28344 * simply try writing to the socket right away, and try again later if
28345 * the initial attempt returns %G_IO_ERROR_WOULD_BLOCK.
28347 * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in condition;
28348 * these conditions will always be set in the output if they are true.
28350 * This call never blocks.
28352 * Returns: the @GIOCondition mask of the current state
28358 * g_socket_condition_timed_wait:
28359 * @socket: a #GSocket
28360 * @condition: a #GIOCondition mask to wait for
28361 * @timeout: the maximum time (in microseconds) to wait, or -1
28362 * @cancellable: (allow-none): a #GCancellable, or %NULL
28363 * @error: a #GError pointer, or %NULL
28365 * Waits for up to @timeout microseconds for @condition to become true
28366 * on @socket. If the condition is met, %TRUE is returned.
28368 * If @cancellable is cancelled before the condition is met, or if
28369 * @timeout (or the socket's #GSocket:timeout) is reached before the
28370 * condition is met, then %FALSE is returned and @error, if non-%NULL,
28371 * is set to the appropriate value (%G_IO_ERROR_CANCELLED or
28372 * %G_IO_ERROR_TIMED_OUT).
28374 * If you don't want a timeout, use g_socket_condition_wait().
28375 * (Alternatively, you can pass -1 for @timeout.)
28377 * Note that although @timeout is in microseconds for consistency with
28378 * other GLib APIs, this function actually only has millisecond
28379 * resolution, and the behavior is undefined if @timeout is not an
28380 * exact number of milliseconds.
28382 * Returns: %TRUE if the condition was met, %FALSE otherwise
28388 * g_socket_condition_wait:
28389 * @socket: a #GSocket
28390 * @condition: a #GIOCondition mask to wait for
28391 * @cancellable: (allow-none): a #GCancellable, or %NULL
28392 * @error: a #GError pointer, or %NULL
28394 * Waits for @condition to become true on @socket. When the condition
28395 * is met, %TRUE is returned.
28397 * If @cancellable is cancelled before the condition is met, or if the
28398 * socket has a timeout set and it is reached before the condition is
28399 * met, then %FALSE is returned and @error, if non-%NULL, is set to
28400 * the appropriate value (%G_IO_ERROR_CANCELLED or
28401 * %G_IO_ERROR_TIMED_OUT).
28403 * See also g_socket_condition_timed_wait().
28405 * Returns: %TRUE if the condition was met, %FALSE otherwise
28411 * g_socket_connect:
28412 * @socket: a #GSocket.
28413 * @address: a #GSocketAddress specifying the remote address.
28414 * @cancellable: (allow-none): a %GCancellable or %NULL
28415 * @error: #GError for error reporting, or %NULL to ignore.
28417 * Connect the socket to the specified remote address.
28419 * For connection oriented socket this generally means we attempt to make
28420 * a connection to the @address. For a connection-less socket it sets
28421 * the default address for g_socket_send() and discards all incoming datagrams
28422 * from other sources.
28424 * Generally connection oriented sockets can only connect once, but
28425 * connection-less sockets can connect multiple times to change the
28428 * If the connect call needs to do network I/O it will block, unless
28429 * non-blocking I/O is enabled. Then %G_IO_ERROR_PENDING is returned
28430 * and the user can be notified of the connection finishing by waiting
28431 * for the G_IO_OUT condition. The result of the connection must then be
28432 * checked with g_socket_check_connect_result().
28434 * Returns: %TRUE if connected, %FALSE on error.
28440 * g_socket_connectable_enumerate:
28441 * @connectable: a #GSocketConnectable
28443 * Creates a #GSocketAddressEnumerator for @connectable.
28445 * Returns: (transfer full): a new #GSocketAddressEnumerator.
28451 * g_socket_connectable_proxy_enumerate:
28452 * @connectable: a #GSocketConnectable
28454 * Creates a #GSocketAddressEnumerator for @connectable that will
28455 * return #GProxyAddress<!-- -->es for addresses that you must connect
28458 * If @connectable does not implement
28459 * g_socket_connectable_proxy_enumerate(), this will fall back to
28460 * calling g_socket_connectable_enumerate().
28462 * Returns: (transfer full): a new #GSocketAddressEnumerator.
28468 * g_socket_connection_connect:
28469 * @connection: a #GSocketConnection
28470 * @address: a #GSocketAddress specifying the remote address.
28471 * @cancellable: (allow-none): a %GCancellable or %NULL
28472 * @error: #GError for error reporting, or %NULL to ignore.
28474 * Connect @connection to the specified remote address.
28476 * Returns: %TRUE if the connection succeeded, %FALSE on error
28482 * g_socket_connection_connect_async:
28483 * @connection: a #GSocketConnection
28484 * @address: a #GSocketAddress specifying the remote address.
28485 * @cancellable: (allow-none): a %GCancellable or %NULL
28486 * @callback: (scope async): a #GAsyncReadyCallback
28487 * @user_data: (closure): user data for the callback
28489 * Asynchronously connect @connection to the specified remote address.
28491 * This clears the #GSocket:blocking flag on @connection's underlying
28492 * socket if it is currently set.
28494 * Use g_socket_connection_connect_finish() to retrieve the result.
28501 * g_socket_connection_connect_finish:
28502 * @connection: a #GSocketConnection
28503 * @result: the #GAsyncResult
28504 * @error: #GError for error reporting, or %NULL to ignore.
28506 * Gets the result of a g_socket_connection_connect_async() call.
28508 * Returns: %TRUE if the connection succeeded, %FALSE on error
28514 * g_socket_connection_factory_create_connection:
28515 * @socket: a #GSocket
28517 * Creates a #GSocketConnection subclass of the right type for
28520 * Returns: (transfer full): a #GSocketConnection
28526 * g_socket_connection_factory_lookup_type:
28527 * @family: a #GSocketFamily
28528 * @type: a #GSocketType
28529 * @protocol_id: a protocol id
28531 * Looks up the #GType to be used when creating socket connections on
28532 * sockets with the specified @family, @type and @protocol_id.
28534 * If no type is registered, the #GSocketConnection base type is returned.
28536 * Returns: a #GType
28542 * g_socket_connection_factory_register_type:
28543 * @g_type: a #GType, inheriting from %G_TYPE_SOCKET_CONNECTION
28544 * @family: a #GSocketFamily
28545 * @type: a #GSocketType
28546 * @protocol: a protocol id
28548 * Looks up the #GType to be used when creating socket connections on
28549 * sockets with the specified @family, @type and @protocol.
28551 * If no type is registered, the #GSocketConnection base type is returned.
28558 * g_socket_connection_get_local_address:
28559 * @connection: a #GSocketConnection
28560 * @error: #GError for error reporting, or %NULL to ignore.
28562 * Try to get the local address of a socket connection.
28564 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28570 * g_socket_connection_get_remote_address:
28571 * @connection: a #GSocketConnection
28572 * @error: #GError for error reporting, or %NULL to ignore.
28574 * Try to get the remote address of a socket connection.
28576 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28582 * g_socket_connection_get_socket:
28583 * @connection: a #GSocketConnection
28585 * Gets the underlying #GSocket object of the connection.
28586 * This can be useful if you want to do something unusual on it
28587 * not supported by the #GSocketConnection APIs.
28589 * Returns: (transfer none): a #GSocketAddress or %NULL on error.
28595 * g_socket_connection_is_connected:
28596 * @connection: a #GSocketConnection
28598 * Checks if @connection is connected. This is equivalent to calling
28599 * g_socket_is_connected() on @connection's underlying #GSocket.
28601 * Returns: whether @connection is connected
28607 * g_socket_control_message_deserialize:
28608 * @level: a socket level
28609 * @type: a socket control message type for the given @level
28610 * @size: the size of the data in bytes
28611 * @data: (array length=size) (element-type guint8): pointer to the message data
28613 * Tries to deserialize a socket control message of a given
28614 * @level and @type. This will ask all known (to GType) subclasses
28615 * of #GSocketControlMessage if they can understand this kind
28616 * of message and if so deserialize it into a #GSocketControlMessage.
28618 * If there is no implementation for this kind of control message, %NULL
28619 * will be returned.
28621 * Returns: (transfer full): the deserialized message or %NULL
28627 * g_socket_control_message_get_level:
28628 * @message: a #GSocketControlMessage
28630 * Returns the "level" (i.e. the originating protocol) of the control message.
28631 * This is often SOL_SOCKET.
28633 * Returns: an integer describing the level
28639 * g_socket_control_message_get_msg_type:
28640 * @message: a #GSocketControlMessage
28642 * Returns the protocol specific type of the control message.
28643 * For instance, for UNIX fd passing this would be SCM_RIGHTS.
28645 * Returns: an integer describing the type of control message
28651 * g_socket_control_message_get_size:
28652 * @message: a #GSocketControlMessage
28654 * Returns the space required for the control message, not including
28655 * headers or alignment.
28657 * Returns: The number of bytes required.
28663 * g_socket_control_message_serialize:
28664 * @message: a #GSocketControlMessage
28665 * @data: A buffer to write data to
28667 * Converts the data in the message to bytes placed in the
28670 * @data is guaranteed to have enough space to fit the size
28671 * returned by g_socket_control_message_get_size() on this
28679 * g_socket_create_source: (skip)
28680 * @socket: a #GSocket
28681 * @condition: a #GIOCondition mask to monitor
28682 * @cancellable: (allow-none): a %GCancellable or %NULL
28684 * Creates a %GSource that can be attached to a %GMainContext to monitor
28685 * for the availibility of the specified @condition on the socket.
28687 * The callback on the source is of the #GSocketSourceFunc type.
28689 * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in @condition;
28690 * these conditions will always be reported output if they are true.
28692 * @cancellable if not %NULL can be used to cancel the source, which will
28693 * cause the source to trigger, reporting the current condition (which
28694 * is likely 0 unless cancellation happened at the same time as a
28695 * condition change). You can check for this in the callback using
28696 * g_cancellable_is_cancelled().
28698 * If @socket has a timeout set, and it is reached before @condition
28699 * occurs, the source will then trigger anyway, reporting %G_IO_IN or
28700 * %G_IO_OUT depending on @condition. However, @socket will have been
28701 * marked as having had a timeout, and so the next #GSocket I/O method
28702 * you call will then fail with a %G_IO_ERROR_TIMED_OUT.
28704 * Returns: (transfer full): a newly allocated %GSource, free with g_source_unref().
28710 * g_socket_get_available_bytes:
28711 * @socket: a #GSocket
28713 * Get the amount of data pending in the OS input buffer.
28715 * Returns: the number of bytes that can be read from the socket without blocking or -1 on error.
28721 * g_socket_get_blocking:
28722 * @socket: a #GSocket.
28724 * Gets the blocking mode of the socket. For details on blocking I/O,
28725 * see g_socket_set_blocking().
28727 * Returns: %TRUE if blocking I/O is used, %FALSE otherwise.
28733 * g_socket_get_broadcast:
28734 * @socket: a #GSocket.
28736 * Gets the broadcast setting on @socket; if %TRUE,
28737 * it is possible to send packets to broadcast
28738 * addresses or receive from broadcast addresses.
28740 * Returns: the broadcast setting on @socket
28746 * g_socket_get_credentials:
28747 * @socket: a #GSocket.
28748 * @error: #GError for error reporting, or %NULL to ignore.
28750 * Returns the credentials of the foreign process connected to this
28751 * socket, if any (e.g. it is only supported for %G_SOCKET_FAMILY_UNIX
28754 * If this operation isn't supported on the OS, the method fails with
28755 * the %G_IO_ERROR_NOT_SUPPORTED error. On Linux this is implemented
28756 * by reading the %SO_PEERCRED option on the underlying socket.
28758 * Other ways to obtain credentials from a foreign peer includes the
28759 * #GUnixCredentialsMessage type and
28760 * g_unix_connection_send_credentials() /
28761 * g_unix_connection_receive_credentials() functions.
28763 * Returns: (transfer full): %NULL if @error is set, otherwise a #GCredentials object that must be freed with g_object_unref().
28769 * g_socket_get_family:
28770 * @socket: a #GSocket.
28772 * Gets the socket family of the socket.
28774 * Returns: a #GSocketFamily
28781 * @socket: a #GSocket.
28783 * Returns the underlying OS socket object. On unix this
28784 * is a socket file descriptor, and on windows this is
28785 * a Winsock2 SOCKET handle. This may be useful for
28786 * doing platform specific or otherwise unusual operations
28789 * Returns: the file descriptor of the socket.
28795 * g_socket_get_keepalive:
28796 * @socket: a #GSocket.
28798 * Gets the keepalive mode of the socket. For details on this,
28799 * see g_socket_set_keepalive().
28801 * Returns: %TRUE if keepalive is active, %FALSE otherwise.
28807 * g_socket_get_listen_backlog:
28808 * @socket: a #GSocket.
28810 * Gets the listen backlog setting of the socket. For details on this,
28811 * see g_socket_set_listen_backlog().
28813 * Returns: the maximum number of pending connections.
28819 * g_socket_get_local_address:
28820 * @socket: a #GSocket.
28821 * @error: #GError for error reporting, or %NULL to ignore.
28823 * Try to get the local address of a bound socket. This is only
28824 * useful if the socket has been bound to a local address,
28825 * either explicitly or implicitly when connecting.
28827 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28833 * g_socket_get_multicast_loopback:
28834 * @socket: a #GSocket.
28836 * Gets the multicast loopback setting on @socket; if %TRUE (the
28837 * default), outgoing multicast packets will be looped back to
28838 * multicast listeners on the same host.
28840 * Returns: the multicast loopback setting on @socket
28846 * g_socket_get_multicast_ttl:
28847 * @socket: a #GSocket.
28849 * Gets the multicast time-to-live setting on @socket; see
28850 * g_socket_set_multicast_ttl() for more details.
28852 * Returns: the multicast time-to-live setting on @socket
28858 * g_socket_get_protocol:
28859 * @socket: a #GSocket.
28861 * Gets the socket protocol id the socket was created with.
28862 * In case the protocol is unknown, -1 is returned.
28864 * Returns: a protocol id, or -1 if unknown
28870 * g_socket_get_remote_address:
28871 * @socket: a #GSocket.
28872 * @error: #GError for error reporting, or %NULL to ignore.
28874 * Try to get the remove address of a connected socket. This is only
28875 * useful for connection oriented sockets that have been connected.
28877 * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28883 * g_socket_get_socket_type:
28884 * @socket: a #GSocket.
28886 * Gets the socket type of the socket.
28888 * Returns: a #GSocketType
28894 * g_socket_get_timeout:
28895 * @socket: a #GSocket.
28897 * Gets the timeout setting of the socket. For details on this, see
28898 * g_socket_set_timeout().
28900 * Returns: the timeout in seconds
28906 * g_socket_get_ttl:
28907 * @socket: a #GSocket.
28909 * Gets the unicast time-to-live setting on @socket; see
28910 * g_socket_set_ttl() for more details.
28912 * Returns: the time-to-live setting on @socket
28918 * g_socket_is_closed:
28919 * @socket: a #GSocket
28921 * Checks whether a socket is closed.
28923 * Returns: %TRUE if socket is closed, %FALSE otherwise
28929 * g_socket_is_connected:
28930 * @socket: a #GSocket.
28932 * Check whether the socket is connected. This is only useful for
28933 * connection-oriented sockets.
28935 * Returns: %TRUE if socket is connected, %FALSE otherwise.
28941 * g_socket_join_multicast_group:
28942 * @socket: a #GSocket.
28943 * @group: a #GInetAddress specifying the group address to join.
28944 * @iface: (allow-none): Name of the interface to use, or %NULL
28945 * @source_specific: %TRUE if source-specific multicast should be used
28946 * @error: #GError for error reporting, or %NULL to ignore.
28948 * Registers @socket to receive multicast messages sent to @group.
28949 * @socket must be a %G_SOCKET_TYPE_DATAGRAM socket, and must have
28950 * been bound to an appropriate interface and port with
28953 * If @iface is %NULL, the system will automatically pick an interface
28954 * to bind to based on @group.
28956 * If @source_specific is %TRUE, source-specific multicast as defined
28957 * in RFC 4604 is used. Note that on older platforms this may fail
28958 * with a %G_IO_ERROR_NOT_SUPPORTED error.
28960 * Returns: %TRUE on success, %FALSE on error.
28966 * g_socket_leave_multicast_group:
28967 * @socket: a #GSocket.
28968 * @group: a #GInetAddress specifying the group address to leave.
28969 * @iface: (allow-none): Interface used
28970 * @source_specific: %TRUE if source-specific multicast was used
28971 * @error: #GError for error reporting, or %NULL to ignore.
28973 * Removes @socket from the multicast group defined by @group, @iface,
28974 * and @source_specific (which must all have the same values they had
28975 * when you joined the group).
28977 * @socket remains bound to its address and port, and can still receive
28978 * unicast messages after calling this.
28980 * Returns: %TRUE on success, %FALSE on error.
28987 * @socket: a #GSocket.
28988 * @error: #GError for error reporting, or %NULL to ignore.
28990 * Marks the socket as a server socket, i.e. a socket that is used
28991 * to accept incoming requests using g_socket_accept().
28993 * Before calling this the socket must be bound to a local address using
28996 * To set the maximum amount of outstanding clients, use
28997 * g_socket_set_listen_backlog().
28999 * Returns: %TRUE on success, %FALSE on error.
29005 * g_socket_listener_accept:
29006 * @listener: a #GSocketListener
29007 * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL
29008 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29009 * @error: #GError for error reporting, or %NULL to ignore.
29011 * Blocks waiting for a client to connect to any of the sockets added
29012 * to the listener. Returns a #GSocketConnection for the socket that was
29015 * If @source_object is not %NULL it will be filled out with the source
29016 * object specified when the corresponding socket or address was added
29019 * If @cancellable is not %NULL, then the operation can be cancelled by
29020 * triggering the cancellable object from another thread. If the operation
29021 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29023 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29029 * g_socket_listener_accept_async:
29030 * @listener: a #GSocketListener
29031 * @cancellable: (allow-none): a #GCancellable, or %NULL
29032 * @callback: (scope async): a #GAsyncReadyCallback
29033 * @user_data: (closure): user data for the callback
29035 * This is the asynchronous version of g_socket_listener_accept().
29037 * When the operation is finished @callback will be
29038 * called. You can then call g_socket_listener_accept_socket()
29039 * to get the result of the operation.
29046 * g_socket_listener_accept_finish:
29047 * @listener: a #GSocketListener
29048 * @result: a #GAsyncResult.
29049 * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29050 * @error: a #GError location to store the error occurring, or %NULL to ignore.
29052 * Finishes an async accept operation. See g_socket_listener_accept_async()
29054 * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29060 * g_socket_listener_accept_socket:
29061 * @listener: a #GSocketListener
29062 * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL.
29063 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29064 * @error: #GError for error reporting, or %NULL to ignore.
29066 * Blocks waiting for a client to connect to any of the sockets added
29067 * to the listener. Returns the #GSocket that was accepted.
29069 * If you want to accept the high-level #GSocketConnection, not a #GSocket,
29070 * which is often the case, then you should use g_socket_listener_accept()
29073 * If @source_object is not %NULL it will be filled out with the source
29074 * object specified when the corresponding socket or address was added
29077 * If @cancellable is not %NULL, then the operation can be cancelled by
29078 * triggering the cancellable object from another thread. If the operation
29079 * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29081 * Returns: (transfer full): a #GSocket on success, %NULL on error.
29087 * g_socket_listener_accept_socket_async:
29088 * @listener: a #GSocketListener
29089 * @cancellable: (allow-none): a #GCancellable, or %NULL
29090 * @callback: (scope async): a #GAsyncReadyCallback
29091 * @user_data: (closure): user data for the callback
29093 * This is the asynchronous version of g_socket_listener_accept_socket().
29095 * When the operation is finished @callback will be
29096 * called. You can then call g_socket_listener_accept_socket_finish()
29097 * to get the result of the operation.
29104 * g_socket_listener_accept_socket_finish:
29105 * @listener: a #GSocketListener
29106 * @result: a #GAsyncResult.
29107 * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29108 * @error: a #GError location to store the error occurring, or %NULL to ignore.
29110 * Finishes an async accept operation. See g_socket_listener_accept_socket_async()
29112 * Returns: (transfer full): a #GSocket on success, %NULL on error.
29118 * g_socket_listener_add_address:
29119 * @listener: a #GSocketListener
29120 * @address: a #GSocketAddress
29121 * @type: a #GSocketType
29122 * @protocol: a #GSocketProtocol
29123 * @source_object: (allow-none): Optional #GObject identifying this source
29124 * @effective_address: (out) (allow-none): location to store the address that was bound to, or %NULL.
29125 * @error: #GError for error reporting, or %NULL to ignore.
29127 * Creates a socket of type @type and protocol @protocol, binds
29128 * it to @address and adds it to the set of sockets we're accepting
29131 * Note that adding an IPv6 address, depending on the platform,
29132 * may or may not result in a listener that also accepts IPv4
29133 * connections. For more deterministic behavior, see
29134 * g_socket_listener_add_inet_port().
29136 * @source_object will be passed out in the various calls
29137 * to accept to identify this particular source, which is
29138 * useful if you're listening on multiple addresses and do
29139 * different things depending on what address is connected to.
29141 * If successful and @effective_address is non-%NULL then it will
29142 * be set to the address that the binding actually occurred at. This
29143 * is helpful for determining the port number that was used for when
29144 * requesting a binding to port 0 (ie: "any port"). This address, if
29145 * requested, belongs to the caller and must be freed.
29147 * Returns: %TRUE on success, %FALSE on error.
29153 * g_socket_listener_add_any_inet_port:
29154 * @listener: a #GSocketListener
29155 * @source_object: (allow-none): Optional #GObject identifying this source
29156 * @error: a #GError location to store the error occurring, or %NULL to ignore.
29158 * Listens for TCP connections on any available port number for both
29159 * IPv6 and IPv4 (if each is available).
29161 * This is useful if you need to have a socket for incoming connections
29162 * but don't care about the specific port number.
29164 * @source_object will be passed out in the various calls
29165 * to accept to identify this particular source, which is
29166 * useful if you're listening on multiple addresses and do
29167 * different things depending on what address is connected to.
29169 * Returns: the port number, or 0 in case of failure.
29175 * g_socket_listener_add_inet_port:
29176 * @listener: a #GSocketListener
29177 * @port: an IP port number (non-zero)
29178 * @source_object: (allow-none): Optional #GObject identifying this source
29179 * @error: #GError for error reporting, or %NULL to ignore.
29181 * Helper function for g_socket_listener_add_address() that
29182 * creates a TCP/IP socket listening on IPv4 and IPv6 (if
29183 * supported) on the specified port on all interfaces.
29185 * @source_object will be passed out in the various calls
29186 * to accept to identify this particular source, which is
29187 * useful if you're listening on multiple addresses and do
29188 * different things depending on what address is connected to.
29190 * Returns: %TRUE on success, %FALSE on error.
29196 * g_socket_listener_add_socket:
29197 * @listener: a #GSocketListener
29198 * @socket: a listening #GSocket
29199 * @source_object: (allow-none): Optional #GObject identifying this source
29200 * @error: #GError for error reporting, or %NULL to ignore.
29202 * Adds @socket to the set of sockets that we try to accept
29203 * new clients from. The socket must be bound to a local
29204 * address and listened to.
29206 * @source_object will be passed out in the various calls
29207 * to accept to identify this particular source, which is
29208 * useful if you're listening on multiple addresses and do
29209 * different things depending on what address is connected to.
29211 * Returns: %TRUE on success, %FALSE on error.
29217 * g_socket_listener_close:
29218 * @listener: a #GSocketListener
29220 * Closes all the sockets in the listener.
29227 * g_socket_listener_new:
29229 * Creates a new #GSocketListener with no sockets to listen for.
29230 * New listeners can be added with e.g. g_socket_listener_add_address()
29231 * or g_socket_listener_add_inet_port().
29233 * Returns: a new #GSocketListener.
29239 * g_socket_listener_set_backlog:
29240 * @listener: a #GSocketListener
29241 * @listen_backlog: an integer
29243 * Sets the listen backlog on the sockets in the listener.
29245 * See g_socket_set_listen_backlog() for details
29253 * @family: the socket family to use, e.g. %G_SOCKET_FAMILY_IPV4.
29254 * @type: the socket type to use.
29255 * @protocol: the id of the protocol to use, or 0 for default.
29256 * @error: #GError for error reporting, or %NULL to ignore.
29258 * Creates a new #GSocket with the defined family, type and protocol.
29259 * If @protocol is 0 (%G_SOCKET_PROTOCOL_DEFAULT) the default protocol type
29260 * for the family and type is used.
29262 * The @protocol is a family and type specific int that specifies what
29263 * kind of protocol to use. #GSocketProtocol lists several common ones.
29264 * Many families only support one protocol, and use 0 for this, others
29265 * support several and using 0 means to use the default protocol for
29266 * the family and type.
29268 * The protocol id is passed directly to the operating
29269 * system, so you can use protocols not listed in #GSocketProtocol if you
29270 * know the protocol number used for it.
29272 * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
29278 * g_socket_new_from_fd:
29279 * @fd: a native socket file descriptor.
29280 * @error: #GError for error reporting, or %NULL to ignore.
29282 * Creates a new #GSocket from a native file descriptor
29283 * or winsock SOCKET handle.
29285 * This reads all the settings from the file descriptor so that
29286 * all properties should work. Note that the file descriptor
29287 * will be set to non-blocking mode, independent on the blocking
29288 * mode of the #GSocket.
29290 * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
29296 * g_socket_receive:
29297 * @socket: a #GSocket
29298 * @buffer: a buffer to read data into (which should be at least @size bytes long).
29299 * @size: the number of bytes you want to read from the socket
29300 * @cancellable: (allow-none): a %GCancellable or %NULL
29301 * @error: #GError for error reporting, or %NULL to ignore.
29303 * Receive data (up to @size bytes) from a socket. This is mainly used by
29304 * connection-oriented sockets; it is identical to g_socket_receive_from()
29305 * with @address set to %NULL.
29307 * For %G_SOCKET_TYPE_DATAGRAM and %G_SOCKET_TYPE_SEQPACKET sockets,
29308 * g_socket_receive() will always read either 0 or 1 complete messages from
29309 * the socket. If the received message is too large to fit in @buffer, then
29310 * the data beyond @size bytes will be discarded, without any explicit
29311 * indication that this has occurred.
29313 * For %G_SOCKET_TYPE_STREAM sockets, g_socket_receive() can return any
29314 * number of bytes, up to @size. If more than @size bytes have been
29315 * received, the additional data will be returned in future calls to
29316 * g_socket_receive().
29318 * If the socket is in blocking mode the call will block until there
29319 * is some data to receive, the connection is closed, or there is an
29320 * error. If there is no data available and the socket is in
29321 * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
29322 * returned. To be notified when data is available, wait for the
29323 * %G_IO_IN condition.
29325 * On error -1 is returned and @error is set accordingly.
29327 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29333 * g_socket_receive_from:
29334 * @socket: a #GSocket
29335 * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
29336 * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
29337 * @size: the number of bytes you want to read from the socket
29338 * @cancellable: (allow-none): a %GCancellable or %NULL
29339 * @error: #GError for error reporting, or %NULL to ignore.
29341 * Receive data (up to @size bytes) from a socket.
29343 * If @address is non-%NULL then @address will be set equal to the
29344 * source address of the received packet.
29345 * @address is owned by the caller.
29347 * See g_socket_receive() for additional information.
29349 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29355 * g_socket_receive_message:
29356 * @socket: a #GSocket
29357 * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
29358 * @vectors: (array length=num_vectors): an array of #GInputVector structs
29359 * @num_vectors: the number of elements in @vectors, or -1
29360 * @messages: (array length=num_messages) (allow-none): a pointer which may be filled with an array of #GSocketControlMessages, or %NULL
29361 * @num_messages: a pointer which will be filled with the number of elements in @messages, or %NULL
29362 * @flags: a pointer to an int containing #GSocketMsgFlags flags
29363 * @cancellable: (allow-none): a %GCancellable or %NULL
29364 * @error: a #GError pointer, or %NULL
29366 * Receive data from a socket. This is the most complicated and
29367 * fully-featured version of this call. For easier use, see
29368 * g_socket_receive() and g_socket_receive_from().
29370 * If @address is non-%NULL then @address will be set equal to the
29371 * source address of the received packet.
29372 * @address is owned by the caller.
29374 * @vector must point to an array of #GInputVector structs and
29375 * @num_vectors must be the length of this array. These structs
29376 * describe the buffers that received data will be scattered into.
29377 * If @num_vectors is -1, then @vectors is assumed to be terminated
29378 * by a #GInputVector with a %NULL buffer pointer.
29380 * As a special case, if @num_vectors is 0 (in which case, @vectors
29381 * may of course be %NULL), then a single byte is received and
29382 * discarded. This is to facilitate the common practice of sending a
29383 * single '\0' byte for the purposes of transferring ancillary data.
29385 * @messages, if non-%NULL, will be set to point to a newly-allocated
29386 * array of #GSocketControlMessage instances or %NULL if no such
29387 * messages was received. These correspond to the control messages
29388 * received from the kernel, one #GSocketControlMessage per message
29389 * from the kernel. This array is %NULL-terminated and must be freed
29390 * by the caller using g_free() after calling g_object_unref() on each
29391 * element. If @messages is %NULL, any control messages received will
29394 * @num_messages, if non-%NULL, will be set to the number of control
29395 * messages received.
29397 * If both @messages and @num_messages are non-%NULL, then
29398 * @num_messages gives the number of #GSocketControlMessage instances
29399 * in @messages (ie: not including the %NULL terminator).
29401 * @flags is an in/out parameter. The commonly available arguments
29402 * for this are available in the #GSocketMsgFlags enum, but the
29403 * values there are the same as the system values, and the flags
29404 * are passed in as-is, so you can pass in system-specific flags too
29405 * (and g_socket_receive_message() may pass system-specific flags out).
29407 * As with g_socket_receive(), data may be discarded if @socket is
29408 * %G_SOCKET_TYPE_DATAGRAM or %G_SOCKET_TYPE_SEQPACKET and you do not
29409 * provide enough buffer space to read a complete message. You can pass
29410 * %G_SOCKET_MSG_PEEK in @flags to peek at the current message without
29411 * removing it from the receive queue, but there is no portable way to find
29412 * out the length of the message other than by reading it into a
29413 * sufficiently-large buffer.
29415 * If the socket is in blocking mode the call will block until there
29416 * is some data to receive, the connection is closed, or there is an
29417 * error. If there is no data available and the socket is in
29418 * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
29419 * returned. To be notified when data is available, wait for the
29420 * %G_IO_IN condition.
29422 * On error -1 is returned and @error is set accordingly.
29424 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29430 * g_socket_receive_with_blocking:
29431 * @socket: a #GSocket
29432 * @buffer: a buffer to read data into (which should be at least @size bytes long).
29433 * @size: the number of bytes you want to read from the socket
29434 * @blocking: whether to do blocking or non-blocking I/O
29435 * @cancellable: (allow-none): a %GCancellable or %NULL
29436 * @error: #GError for error reporting, or %NULL to ignore.
29438 * This behaves exactly the same as g_socket_receive(), except that
29439 * the choice of blocking or non-blocking behavior is determined by
29440 * the @blocking argument rather than by @socket's properties.
29442 * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29449 * @socket: a #GSocket
29450 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29451 * @size: the number of bytes to send
29452 * @cancellable: (allow-none): a %GCancellable or %NULL
29453 * @error: #GError for error reporting, or %NULL to ignore.
29455 * Tries to send @size bytes from @buffer on the socket. This is
29456 * mainly used by connection-oriented sockets; it is identical to
29457 * g_socket_send_to() with @address set to %NULL.
29459 * If the socket is in blocking mode the call will block until there is
29460 * space for the data in the socket queue. If there is no space available
29461 * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
29462 * will be returned. To be notified when space is available, wait for the
29463 * %G_IO_OUT condition. Note though that you may still receive
29464 * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
29465 * notified of a %G_IO_OUT condition. (On Windows in particular, this is
29466 * very common due to the way the underlying APIs work.)
29468 * On error -1 is returned and @error is set accordingly.
29470 * Returns: Number of bytes written (which may be less than @size), or -1 on error
29476 * g_socket_send_message:
29477 * @socket: a #GSocket
29478 * @address: (allow-none): a #GSocketAddress, or %NULL
29479 * @vectors: (array length=num_vectors): an array of #GOutputVector structs
29480 * @num_vectors: the number of elements in @vectors, or -1
29481 * @messages: (array length=num_messages) (allow-none): a pointer to an array of #GSocketControlMessages, or %NULL.
29482 * @num_messages: number of elements in @messages, or -1.
29483 * @flags: an int containing #GSocketMsgFlags flags
29484 * @cancellable: (allow-none): a %GCancellable or %NULL
29485 * @error: #GError for error reporting, or %NULL to ignore.
29487 * Send data to @address on @socket. This is the most complicated and
29488 * fully-featured version of this call. For easier use, see
29489 * g_socket_send() and g_socket_send_to().
29491 * If @address is %NULL then the message is sent to the default receiver
29492 * (set by g_socket_connect()).
29494 * @vectors must point to an array of #GOutputVector structs and
29495 * @num_vectors must be the length of this array. (If @num_vectors is -1,
29496 * then @vectors is assumed to be terminated by a #GOutputVector with a
29497 * %NULL buffer pointer.) The #GOutputVector structs describe the buffers
29498 * that the sent data will be gathered from. Using multiple
29499 * #GOutputVector<!-- -->s is more memory-efficient than manually copying
29500 * data from multiple sources into a single buffer, and more
29501 * network-efficient than making multiple calls to g_socket_send().
29503 * @messages, if non-%NULL, is taken to point to an array of @num_messages
29504 * #GSocketControlMessage instances. These correspond to the control
29505 * messages to be sent on the socket.
29506 * If @num_messages is -1 then @messages is treated as a %NULL-terminated
29509 * @flags modify how the message is sent. The commonly available arguments
29510 * for this are available in the #GSocketMsgFlags enum, but the
29511 * values there are the same as the system values, and the flags
29512 * are passed in as-is, so you can pass in system-specific flags too.
29514 * If the socket is in blocking mode the call will block until there is
29515 * space for the data in the socket queue. If there is no space available
29516 * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
29517 * will be returned. To be notified when space is available, wait for the
29518 * %G_IO_OUT condition. Note though that you may still receive
29519 * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
29520 * notified of a %G_IO_OUT condition. (On Windows in particular, this is
29521 * very common due to the way the underlying APIs work.)
29523 * On error -1 is returned and @error is set accordingly.
29525 * Returns: Number of bytes written (which may be less than @size), or -1 on error
29531 * g_socket_send_to:
29532 * @socket: a #GSocket
29533 * @address: (allow-none): a #GSocketAddress, or %NULL
29534 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29535 * @size: the number of bytes to send
29536 * @cancellable: (allow-none): a %GCancellable or %NULL
29537 * @error: #GError for error reporting, or %NULL to ignore.
29539 * Tries to send @size bytes from @buffer to @address. If @address is
29540 * %NULL then the message is sent to the default receiver (set by
29541 * g_socket_connect()).
29543 * See g_socket_send() for additional information.
29545 * Returns: Number of bytes written (which may be less than @size), or -1 on error
29551 * g_socket_send_with_blocking:
29552 * @socket: a #GSocket
29553 * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29554 * @size: the number of bytes to send
29555 * @blocking: whether to do blocking or non-blocking I/O
29556 * @cancellable: (allow-none): a %GCancellable or %NULL
29557 * @error: #GError for error reporting, or %NULL to ignore.
29559 * This behaves exactly the same as g_socket_send(), except that
29560 * the choice of blocking or non-blocking behavior is determined by
29561 * the @blocking argument rather than by @socket's properties.
29563 * Returns: Number of bytes written (which may be less than @size), or -1 on error
29569 * g_socket_service_is_active:
29570 * @service: a #GSocketService
29572 * Check whether the service is active or not. An active
29573 * service will accept new clients that connect, while
29574 * a non-active service will let connecting clients queue
29575 * up until the service is started.
29577 * Returns: %TRUE if the service is active, %FALSE otherwise
29583 * g_socket_service_new:
29585 * Creates a new #GSocketService with no sockets to listen for.
29586 * New listeners can be added with e.g. g_socket_listener_add_address()
29587 * or g_socket_listener_add_inet_port().
29589 * Returns: a new #GSocketService.
29595 * g_socket_service_start:
29596 * @service: a #GSocketService
29598 * Starts the service, i.e. start accepting connections
29599 * from the added sockets when the mainloop runs.
29601 * This call is thread-safe, so it may be called from a thread
29602 * handling an incoming client request.
29609 * g_socket_service_stop:
29610 * @service: a #GSocketService
29612 * Stops the service, i.e. stops accepting connections
29613 * from the added sockets when the mainloop runs.
29615 * This call is thread-safe, so it may be called from a thread
29616 * handling an incoming client request.
29623 * g_socket_set_blocking:
29624 * @socket: a #GSocket.
29625 * @blocking: Whether to use blocking I/O or not.
29627 * Sets the blocking mode of the socket. In blocking mode
29628 * all operations block until they succeed or there is an error. In
29629 * non-blocking mode all functions return results immediately or
29630 * with a %G_IO_ERROR_WOULD_BLOCK error.
29632 * All sockets are created in blocking mode. However, note that the
29633 * platform level socket is always non-blocking, and blocking mode
29634 * is a GSocket level feature.
29641 * g_socket_set_broadcast:
29642 * @socket: a #GSocket.
29643 * @broadcast: whether @socket should allow sending to and receiving from broadcast addresses
29645 * Sets whether @socket should allow sending to and receiving from
29646 * broadcast addresses. This is %FALSE by default.
29653 * g_socket_set_keepalive:
29654 * @socket: a #GSocket.
29655 * @keepalive: Value for the keepalive flag
29657 * Sets or unsets the %SO_KEEPALIVE flag on the underlying socket. When
29658 * this flag is set on a socket, the system will attempt to verify that the
29659 * remote socket endpoint is still present if a sufficiently long period of
29660 * time passes with no data being exchanged. If the system is unable to
29661 * verify the presence of the remote endpoint, it will automatically close
29664 * This option is only functional on certain kinds of sockets. (Notably,
29665 * %G_SOCKET_PROTOCOL_TCP sockets.)
29667 * The exact time between pings is system- and protocol-dependent, but will
29668 * normally be at least two hours. Most commonly, you would set this flag
29669 * on a server socket if you want to allow clients to remain idle for long
29670 * periods of time, but also want to ensure that connections are eventually
29671 * garbage-collected if clients crash or become unreachable.
29678 * g_socket_set_listen_backlog:
29679 * @socket: a #GSocket.
29680 * @backlog: the maximum number of pending connections.
29682 * Sets the maximum number of outstanding connections allowed
29683 * when listening on this socket. If more clients than this are
29684 * connecting to the socket and the application is not handling them
29685 * on time then the new connections will be refused.
29687 * Note that this must be called before g_socket_listen() and has no
29688 * effect if called after that.
29695 * g_socket_set_multicast_loopback:
29696 * @socket: a #GSocket.
29697 * @loopback: whether @socket should receive messages sent to its multicast groups from the local host
29699 * Sets whether outgoing multicast packets will be received by sockets
29700 * listening on that multicast address on the same host. This is %TRUE
29708 * g_socket_set_multicast_ttl:
29709 * @socket: a #GSocket.
29710 * @ttl: the time-to-live value for all multicast datagrams on @socket
29712 * Sets the time-to-live for outgoing multicast datagrams on @socket.
29713 * By default, this is 1, meaning that multicast packets will not leave
29714 * the local network.
29721 * g_socket_set_timeout:
29722 * @socket: a #GSocket.
29723 * @timeout: the timeout for @socket, in seconds, or 0 for none
29725 * Sets the time in seconds after which I/O operations on @socket will
29726 * time out if they have not yet completed.
29728 * On a blocking socket, this means that any blocking #GSocket
29729 * operation will time out after @timeout seconds of inactivity,
29730 * returning %G_IO_ERROR_TIMED_OUT.
29732 * On a non-blocking socket, calls to g_socket_condition_wait() will
29733 * also fail with %G_IO_ERROR_TIMED_OUT after the given time. Sources
29734 * created with g_socket_create_source() will trigger after
29735 * @timeout seconds of inactivity, with the requested condition
29736 * set, at which point calling g_socket_receive(), g_socket_send(),
29737 * g_socket_check_connect_result(), etc, will fail with
29738 * %G_IO_ERROR_TIMED_OUT.
29740 * If @timeout is 0 (the default), operations will never time out
29743 * Note that if an I/O operation is interrupted by a signal, this may
29744 * cause the timeout to be reset.
29751 * g_socket_set_ttl:
29752 * @socket: a #GSocket.
29753 * @ttl: the time-to-live value for all unicast packets on @socket
29755 * Sets the time-to-live for outgoing unicast packets on @socket.
29756 * By default the platform-specific default value is used.
29763 * g_socket_shutdown:
29764 * @socket: a #GSocket
29765 * @shutdown_read: whether to shut down the read side
29766 * @shutdown_write: whether to shut down the write side
29767 * @error: #GError for error reporting, or %NULL to ignore.
29769 * Shut down part of a full-duplex connection.
29771 * If @shutdown_read is %TRUE then the receiving side of the connection
29772 * is shut down, and further reading is disallowed.
29774 * If @shutdown_write is %TRUE then the sending side of the connection
29775 * is shut down, and further writing is disallowed.
29777 * It is allowed for both @shutdown_read and @shutdown_write to be %TRUE.
29779 * One example where this is used is graceful disconnect for TCP connections
29780 * where you close the sending side, then wait for the other side to close
29781 * the connection, thus ensuring that the other side saw all sent data.
29783 * Returns: %TRUE on success, %FALSE on error
29789 * g_socket_speaks_ipv4:
29790 * @socket: a #GSocket
29792 * Checks if a socket is capable of speaking IPv4.
29794 * IPv4 sockets are capable of speaking IPv4. On some operating systems
29795 * and under some combinations of circumstances IPv6 sockets are also
29796 * capable of speaking IPv4. See RFC 3493 section 3.7 for more
29799 * No other types of sockets are currently considered as being capable
29800 * of speaking IPv4.
29802 * Returns: %TRUE if this socket can be used with IPv4.
29808 * g_srv_target_copy:
29809 * @target: a #GSrvTarget
29813 * Returns: a copy of @target
29819 * g_srv_target_free:
29820 * @target: a #GSrvTarget
29829 * g_srv_target_get_hostname:
29830 * @target: a #GSrvTarget
29832 * Gets @target's hostname (in ASCII form; if you are going to present
29833 * this to the user, you should use g_hostname_is_ascii_encoded() to
29834 * check if it contains encoded Unicode segments, and use
29835 * g_hostname_to_unicode() to convert it if it does.)
29837 * Returns: @target's hostname
29843 * g_srv_target_get_port:
29844 * @target: a #GSrvTarget
29846 * Gets @target's port
29848 * Returns: @target's port
29854 * g_srv_target_get_priority:
29855 * @target: a #GSrvTarget
29857 * Gets @target's priority. You should not need to look at this;
29858 * #GResolver already sorts the targets according to the algorithm in
29861 * Returns: @target's priority
29867 * g_srv_target_get_weight:
29868 * @target: a #GSrvTarget
29870 * Gets @target's weight. You should not need to look at this;
29871 * #GResolver already sorts the targets according to the algorithm in
29874 * Returns: @target's weight
29880 * g_srv_target_list_sort: (skip)
29881 * @targets: a #GList of #GSrvTarget
29883 * Sorts @targets in place according to the algorithm in RFC 2782.
29885 * Returns: (transfer full): the head of the sorted list.
29891 * g_srv_target_new:
29892 * @hostname: the host that the service is running on
29893 * @port: the port that the service is running on
29894 * @priority: the target's priority
29895 * @weight: the target's weight
29897 * Creates a new #GSrvTarget with the given parameters.
29899 * You should not need to use this; normally #GSrvTarget<!-- -->s are
29900 * created by #GResolver.
29902 * Returns: a new #GSrvTarget.
29908 * g_static_resource_fini:
29909 * @static_resource: pointer to a static #GStaticResource
29911 * Finalized a GResource initialized by g_static_resource_init().
29913 * This is normally used by code generated by
29914 * <link linkend="glib-compile-resources">glib-compile-resources</link>
29915 * and is not typically used by other code.
29922 * g_static_resource_get_resource:
29923 * @static_resource: pointer to a static #GStaticResource
29925 * Gets the GResource that was registred by a call to g_static_resource_init().
29927 * This is normally used by code generated by
29928 * <link linkend="glib-compile-resources">glib-compile-resources</link>
29929 * and is not typically used by other code.
29931 * Returns: (transfer none): a #GResource
29937 * g_static_resource_init:
29938 * @static_resource: pointer to a static #GStaticResource
29940 * Initializes a GResource from static data using a
29943 * This is normally used by code generated by
29944 * <link linkend="glib-compile-resources">glib-compile-resources</link>
29945 * and is not typically used by other code.
29952 * g_tcp_connection_get_graceful_disconnect:
29953 * @connection: a #GTcpConnection
29955 * Checks if graceful disconnects are used. See
29956 * g_tcp_connection_set_graceful_disconnect().
29958 * Returns: %TRUE if graceful disconnect is used on close, %FALSE otherwise
29964 * g_tcp_connection_set_graceful_disconnect:
29965 * @connection: a #GTcpConnection
29966 * @graceful_disconnect: Whether to do graceful disconnects or not
29968 * This enabled graceful disconnects on close. A graceful disconnect
29969 * means that we signal the receiving end that the connection is terminated
29970 * and wait for it to close the connection before closing the connection.
29972 * A graceful disconnect means that we can be sure that we successfully sent
29973 * all the outstanding data to the other end, or get an error reported.
29974 * However, it also means we have to wait for all the data to reach the
29975 * other side and for it to acknowledge this by closing the socket, which may
29976 * take a while. For this reason it is disabled by default.
29983 * g_tcp_wrapper_connection_get_base_io_stream:
29984 * @conn: a #GTcpWrapperConnection
29986 * Get's @conn's base #GIOStream
29988 * Returns: (transfer none): @conn's base #GIOStream
29993 * g_tcp_wrapper_connection_new:
29994 * @base_io_stream: the #GIOStream to wrap
29995 * @socket: the #GSocket associated with @base_io_stream
29997 * Wraps @base_io_stream and @socket together as a #GSocketConnection.
29999 * Returns: the new #GSocketConnection.
30005 * g_test_dbus_add_service_dir:
30006 * @self: a #GTestDBus
30007 * @path: path to a directory containing .service files
30009 * Add a path where dbus-daemon will lookup for .services files. This can't be
30010 * called after g_test_dbus_up().
30015 * g_test_dbus_down:
30016 * @self: a #GTestDBus
30018 * Stop the session bus started by g_test_dbus_up().
30020 * This will wait for the singleton returned by g_bus_get() or g_bus_get_sync()
30021 * is destroyed. This is done to ensure that the next unit test won't get a
30022 * leaked singleton from this test.
30027 * g_test_dbus_get_bus_address:
30028 * @self: a #GTestDBus
30030 * Get the address on which dbus-daemon is running. if g_test_dbus_up() has not
30031 * been called yet, %NULL is returned. This can be used with
30032 * g_dbus_connection_new_for_address()
30034 * Returns: the address of the bus, or %NULL.
30039 * g_test_dbus_get_flags:
30040 * @self: a #GTestDBus
30044 * Returns: the value of #GTestDBus:flags property
30050 * @flags: a #GTestDBusFlags
30052 * Create a new #GTestDBus object.
30054 * Returns: (transfer full): a new #GTestDBus.
30059 * g_test_dbus_stop:
30060 * @self: a #GTestDBus
30062 * Stop the session bus started by g_test_dbus_up().
30064 * Unlike g_test_dbus_down(), this won't verify the #GDBusConnection
30065 * singleton returned by g_bus_get() or g_bus_get_sync() is destroyed. Unit
30066 * tests wanting to verify behaviour after the session bus has been stopped
30067 * can use this function but should still call g_test_dbus_down() when done.
30072 * g_test_dbus_unset:
30074 * Unset DISPLAY and DBUS_SESSION_BUS_ADDRESS env variables to ensure the test
30075 * won't use user's session bus.
30077 * This is useful for unit tests that want to verify behaviour when no session
30078 * bus is running. It is not necessary to call this if unit test already calls
30079 * g_test_dbus_up() before acquiring the session bus.
30085 * @self: a #GTestDBus
30087 * Start a dbus-daemon instance and set DBUS_SESSION_BUS_ADDRESS. After this
30088 * call, it is safe for unit tests to start sending messages on the session bug.
30090 * If this function is called from setup callback of g_test_add(),
30091 * g_test_dbus_down() must be called in its teardown callback.
30093 * If this function is called from unit test's main(), then g_test_dbus_down()
30094 * must be called after g_test_run().
30099 * g_themed_icon_append_name:
30100 * @icon: a #GThemedIcon
30101 * @iconname: name of icon to append to list of icons from within @icon.
30103 * Append a name to the list of icons from within @icon.
30106 * Note that doing so invalidates the hash computed by prior calls
30107 * to g_icon_hash().
30113 * g_themed_icon_get_names:
30114 * @icon: a #GThemedIcon.
30116 * Gets the names of icons from within @icon.
30118 * Returns: (transfer none): a list of icon names.
30123 * g_themed_icon_new:
30124 * @iconname: a string containing an icon name.
30126 * Creates a new themed icon for @iconname.
30128 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
30133 * g_themed_icon_new_from_names:
30134 * @iconnames: (array length=len): an array of strings containing icon names.
30135 * @len: the length of the @iconnames array, or -1 if @iconnames is %NULL-terminated
30137 * Creates a new themed icon for @iconnames.
30139 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon
30144 * g_themed_icon_new_with_default_fallbacks:
30145 * @iconname: a string containing an icon name
30147 * Creates a new themed icon for @iconname, and all the names
30148 * that can be created by shortening @iconname at '-' characters.
30150 * In the following example, @icon1 and @icon2 are equivalent:
30152 * const char *names[] = {
30153 * "gnome-dev-cdrom-audio",
30154 * "gnome-dev-cdrom",
30159 * icon1 = g_themed_icon_new_from_names (names, 4);
30160 * icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
30163 * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
30168 * g_themed_icon_prepend_name:
30169 * @icon: a #GThemedIcon
30170 * @iconname: name of icon to prepend to list of icons from within @icon.
30172 * Prepend a name to the list of icons from within @icon.
30175 * Note that doing so invalidates the hash computed by prior calls
30176 * to g_icon_hash().
30184 * g_threaded_socket_service_new:
30185 * @max_threads: the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit
30187 * Creates a new #GThreadedSocketService with no listeners. Listeners
30188 * must be added with one of the #GSocketListener "add" methods.
30190 * Returns: a new #GSocketService.
30196 * g_tls_backend_get_certificate_type:
30197 * @backend: the #GTlsBackend
30199 * Gets the #GType of @backend's #GTlsCertificate implementation.
30201 * Returns: the #GType of @backend's #GTlsCertificate implementation.
30207 * g_tls_backend_get_client_connection_type:
30208 * @backend: the #GTlsBackend
30210 * Gets the #GType of @backend's #GTlsClientConnection implementation.
30212 * Returns: the #GType of @backend's #GTlsClientConnection implementation.
30218 * g_tls_backend_get_default:
30220 * Gets the default #GTlsBackend for the system.
30222 * Returns: (transfer none): a #GTlsBackend
30228 * g_tls_backend_get_default_database:
30229 * @backend: the #GTlsBackend
30231 * Gets the default #GTlsDatabase used to verify TLS connections.
30233 * Returns: (transfer full): the default database, which should be unreffed when done.
30239 * g_tls_backend_get_file_database_type:
30240 * @backend: the #GTlsBackend
30242 * Gets the #GType of @backend's #GTlsFileDatabase implementation.
30244 * Returns: the #GType of backend's #GTlsFileDatabase implementation.
30250 * g_tls_backend_get_server_connection_type:
30251 * @backend: the #GTlsBackend
30253 * Gets the #GType of @backend's #GTlsServerConnection implementation.
30255 * Returns: the #GType of @backend's #GTlsServerConnection implementation.
30261 * g_tls_backend_supports_tls:
30262 * @backend: the #GTlsBackend
30264 * Checks if TLS is supported; if this returns %FALSE for the default
30265 * #GTlsBackend, it means no "real" TLS backend is available.
30267 * Returns: whether or not TLS is supported
30273 * g_tls_certificate_get_issuer:
30274 * @cert: a #GTlsCertificate
30276 * Gets the #GTlsCertificate representing @cert's issuer, if known
30278 * Returns: (transfer none): The certificate of @cert's issuer, or %NULL if @cert is self-signed or signed with an unknown certificate.
30284 * g_tls_certificate_list_new_from_file:
30285 * @file: file containing PEM-encoded certificates to import
30286 * @error: #GError for error reporting, or %NULL to ignore.
30288 * Creates one or more #GTlsCertificate<!-- -->s from the PEM-encoded
30289 * data in @file. If @file cannot be read or parsed, the function will
30290 * return %NULL and set @error. If @file does not contain any
30291 * PEM-encoded certificates, this will return an empty list and not
30294 * 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.
30300 * g_tls_certificate_new_from_file:
30301 * @file: file containing a PEM-encoded certificate to import
30302 * @error: #GError for error reporting, or %NULL to ignore.
30304 * Creates a #GTlsCertificate from the PEM-encoded data in @file. If
30305 * @file cannot be read or parsed, the function will return %NULL and
30306 * set @error. Otherwise, this behaves like
30307 * g_tls_certificate_new_from_pem().
30309 * Returns: the new certificate, or %NULL on error
30315 * g_tls_certificate_new_from_files:
30316 * @cert_file: file containing a PEM-encoded certificate to import
30317 * @key_file: file containing a PEM-encoded private key to import
30318 * @error: #GError for error reporting, or %NULL to ignore.
30320 * Creates a #GTlsCertificate from the PEM-encoded data in @cert_file
30321 * and @key_file. If either file cannot be read or parsed, the
30322 * function will return %NULL and set @error. Otherwise, this behaves
30323 * like g_tls_certificate_new_from_pem().
30325 * Returns: the new certificate, or %NULL on error
30331 * g_tls_certificate_new_from_pem:
30332 * @data: PEM-encoded certificate data
30333 * @length: the length of @data, or -1 if it's 0-terminated.
30334 * @error: #GError for error reporting, or %NULL to ignore.
30336 * Creates a new #GTlsCertificate from the PEM-encoded data in @data.
30337 * If @data includes both a certificate and a private key, then the
30338 * returned certificate will include the private key data as well. (See
30339 * the #GTlsCertificate:private-key-pem property for information about
30340 * supported formats.)
30342 * If @data includes multiple certificates, only the first one will be
30345 * Returns: the new certificate, or %NULL if @data is invalid
30351 * g_tls_certificate_verify:
30352 * @cert: a #GTlsCertificate
30353 * @identity: (allow-none): the expected peer identity
30354 * @trusted_ca: (allow-none): the certificate of a trusted authority
30356 * This verifies @cert and returns a set of #GTlsCertificateFlags
30357 * indicating any problems found with it. This can be used to verify a
30358 * certificate outside the context of making a connection, or to
30359 * check a certificate against a CA that is not part of the system
30362 * If @identity is not %NULL, @cert's name(s) will be compared against
30363 * it, and %G_TLS_CERTIFICATE_BAD_IDENTITY will be set in the return
30364 * value if it does not match. If @identity is %NULL, that bit will
30365 * never be set in the return value.
30367 * If @trusted_ca is not %NULL, then @cert (or one of the certificates
30368 * in its chain) must be signed by it, or else
30369 * %G_TLS_CERTIFICATE_UNKNOWN_CA will be set in the return value. If
30370 * @trusted_ca is %NULL, that bit will never be set in the return
30373 * (All other #GTlsCertificateFlags values will always be set or unset
30376 * Returns: the appropriate #GTlsCertificateFlags
30382 * g_tls_client_connection_get_accepted_cas:
30383 * @conn: the #GTlsClientConnection
30385 * Gets the list of distinguished names of the Certificate Authorities
30386 * that the server will accept certificates from. This will be set
30387 * during the TLS handshake if the server requests a certificate.
30388 * Otherwise, it will be %NULL.
30390 * Each item in the list is a #GByteArray which contains the complete
30391 * subject DN of the certificate authority.
30393 * 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().
30399 * g_tls_client_connection_get_server_identity:
30400 * @conn: the #GTlsClientConnection
30402 * Gets @conn's expected server identity
30404 * Returns: (transfer none): a #GSocketConnectable describing the expected server identity, or %NULL if the expected identity is not known.
30410 * g_tls_client_connection_get_use_ssl3:
30411 * @conn: the #GTlsClientConnection
30413 * Gets whether @conn will use SSL 3.0 rather than the
30414 * highest-supported version of TLS; see
30415 * g_tls_client_connection_set_use_ssl3().
30417 * Returns: whether @conn will use SSL 3.0
30423 * g_tls_client_connection_get_validation_flags:
30424 * @conn: the #GTlsClientConnection
30426 * Gets @conn's validation flags
30428 * Returns: the validation flags
30434 * g_tls_client_connection_new:
30435 * @base_io_stream: the #GIOStream to wrap
30436 * @server_identity: (allow-none): the expected identity of the server
30437 * @error: #GError for error reporting, or %NULL to ignore.
30439 * Creates a new #GTlsClientConnection wrapping @base_io_stream (which
30440 * must have pollable input and output streams) which is assumed to
30441 * communicate with the server identified by @server_identity.
30443 * Returns: (transfer full) (type GTlsClientConnection): the new #GTlsClientConnection, or %NULL on error
30449 * g_tls_client_connection_set_server_identity:
30450 * @conn: the #GTlsClientConnection
30451 * @identity: a #GSocketConnectable describing the expected server identity
30453 * Sets @conn's expected server identity, which is used both to tell
30454 * servers on virtual hosts which certificate to present, and also
30455 * to let @conn know what name to look for in the certificate when
30456 * performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
30463 * g_tls_client_connection_set_use_ssl3:
30464 * @conn: the #GTlsClientConnection
30465 * @use_ssl3: whether to use SSL 3.0
30467 * If @use_ssl3 is %TRUE, this forces @conn to use SSL 3.0 rather than
30468 * trying to properly negotiate the right version of TLS or SSL to use.
30469 * This can be used when talking to servers that do not implement the
30470 * fallbacks correctly and which will therefore fail to handshake with
30471 * a "modern" TLS handshake attempt.
30478 * g_tls_client_connection_set_validation_flags:
30479 * @conn: the #GTlsClientConnection
30480 * @flags: the #GTlsCertificateFlags to use
30482 * Sets @conn's validation flags, to override the default set of
30483 * checks performed when validating a server certificate. By default,
30484 * %G_TLS_CERTIFICATE_VALIDATE_ALL is used.
30491 * g_tls_connection_emit_accept_certificate:
30492 * @conn: a #GTlsConnection
30493 * @peer_cert: the peer's #GTlsCertificate
30494 * @errors: the problems with @peer_cert
30496 * Used by #GTlsConnection implementations to emit the
30497 * #GTlsConnection::accept-certificate signal.
30499 * Returns: %TRUE if one of the signal handlers has returned %TRUE to accept @peer_cert
30505 * g_tls_connection_get_certificate:
30506 * @conn: a #GTlsConnection
30508 * Gets @conn's certificate, as set by
30509 * g_tls_connection_set_certificate().
30511 * Returns: (transfer none): @conn's certificate, or %NULL
30517 * g_tls_connection_get_database:
30518 * @conn: a #GTlsConnection
30520 * Gets the certificate database that @conn uses to verify
30521 * peer certificates. See g_tls_connection_set_database().
30523 * Returns: (transfer none): the certificate database that @conn uses or %NULL
30529 * g_tls_connection_get_interaction:
30530 * @conn: a connection
30532 * Get the object that will be used to interact with the user. It will be used
30533 * for things like prompting the user for passwords. If %NULL is returned, then
30534 * no user interaction will occur for this connection.
30536 * Returns: (transfer none): The interaction object.
30542 * g_tls_connection_get_peer_certificate:
30543 * @conn: a #GTlsConnection
30545 * Gets @conn's peer's certificate after the handshake has completed.
30546 * (It is not set during the emission of
30547 * #GTlsConnection::accept-certificate.)
30549 * Returns: (transfer none): @conn's peer's certificate, or %NULL
30555 * g_tls_connection_get_peer_certificate_errors:
30556 * @conn: a #GTlsConnection
30558 * Gets the errors associated with validating @conn's peer's
30559 * certificate, after the handshake has completed. (It is not set
30560 * during the emission of #GTlsConnection::accept-certificate.)
30562 * Returns: @conn's peer's certificate errors
30568 * g_tls_connection_get_rehandshake_mode:
30569 * @conn: a #GTlsConnection
30571 * Gets @conn rehandshaking mode. See
30572 * g_tls_connection_set_rehandshake_mode() for details.
30574 * Returns: @conn's rehandshaking mode
30580 * g_tls_connection_get_require_close_notify:
30581 * @conn: a #GTlsConnection
30583 * Tests whether or not @conn expects a proper TLS close notification
30584 * when the connection is closed. See
30585 * g_tls_connection_set_require_close_notify() for details.
30587 * Returns: %TRUE if @conn requires a proper TLS close notification.
30593 * g_tls_connection_get_use_system_certdb:
30594 * @conn: a #GTlsConnection
30596 * Gets whether @conn uses the system certificate database to verify
30597 * peer certificates. See g_tls_connection_set_use_system_certdb().
30599 * Returns: whether @conn uses the system certificate database
30600 * Deprecated: 2.30: Use g_tls_connection_get_database() instead
30605 * g_tls_connection_handshake:
30606 * @conn: a #GTlsConnection
30607 * @cancellable: (allow-none): a #GCancellable, or %NULL
30608 * @error: a #GError, or %NULL
30610 * Attempts a TLS handshake on @conn.
30612 * On the client side, it is never necessary to call this method;
30613 * although the connection needs to perform a handshake after
30614 * connecting (or after sending a "STARTTLS"-type command) and may
30615 * need to rehandshake later if the server requests it,
30616 * #GTlsConnection will handle this for you automatically when you try
30617 * to send or receive data on the connection. However, you can call
30618 * g_tls_connection_handshake() manually if you want to know for sure
30619 * whether the initial handshake succeeded or failed (as opposed to
30620 * just immediately trying to write to @conn's output stream, in which
30621 * case if it fails, it may not be possible to tell if it failed
30622 * before or after completing the handshake).
30624 * Likewise, on the server side, although a handshake is necessary at
30625 * the beginning of the communication, you do not need to call this
30626 * function explicitly unless you want clearer error reporting.
30627 * However, you may call g_tls_connection_handshake() later on to
30628 * renegotiate parameters (encryption methods, etc) with the client.
30630 * #GTlsConnection::accept_certificate may be emitted during the
30633 * Returns: success or failure
30639 * g_tls_connection_handshake_async:
30640 * @conn: a #GTlsConnection
30641 * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
30642 * @cancellable: (allow-none): a #GCancellable, or %NULL
30643 * @callback: callback to call when the handshake is complete
30644 * @user_data: the data to pass to the callback function
30646 * Asynchronously performs a TLS handshake on @conn. See
30647 * g_tls_connection_handshake() for more information.
30654 * g_tls_connection_handshake_finish:
30655 * @conn: a #GTlsConnection
30656 * @result: a #GAsyncResult.
30657 * @error: a #GError pointer, or %NULL
30659 * Finish an asynchronous TLS handshake operation. See
30660 * g_tls_connection_handshake() for more information.
30662 * Returns: %TRUE on success, %FALSE on failure, in which case @error will be set.
30668 * g_tls_connection_set_certificate:
30669 * @conn: a #GTlsConnection
30670 * @certificate: the certificate to use for @conn
30672 * This sets the certificate that @conn will present to its peer
30673 * during the TLS handshake. For a #GTlsServerConnection, it is
30674 * mandatory to set this, and that will normally be done at construct
30677 * For a #GTlsClientConnection, this is optional. If a handshake fails
30678 * with %G_TLS_ERROR_CERTIFICATE_REQUIRED, that means that the server
30679 * requires a certificate, and if you try connecting again, you should
30680 * call this method first. You can call
30681 * g_tls_client_connection_get_accepted_cas() on the failed connection
30682 * to get a list of Certificate Authorities that the server will
30683 * accept certificates from.
30685 * (It is also possible that a server will allow the connection with
30686 * or without a certificate; in that case, if you don't provide a
30687 * certificate, you can tell that the server requested one by the fact
30688 * that g_tls_client_connection_get_accepted_cas() will return
30696 * g_tls_connection_set_database:
30697 * @conn: a #GTlsConnection
30698 * @database: a #GTlsDatabase
30700 * Sets the certificate database that is used to verify peer certificates.
30701 * This is set to the default database by default. See
30702 * g_tls_backend_get_default_database(). If set to %NULL, then
30703 * peer certificate validation will always set the
30704 * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
30705 * #GTlsConnection::accept-certificate will always be emitted on
30706 * client-side connections, unless that bit is not set in
30707 * #GTlsClientConnection:validation-flags).
30714 * g_tls_connection_set_interaction:
30715 * @conn: a connection
30716 * @interaction: (allow-none): an interaction object, or %NULL
30718 * Set the object that will be used to interact with the user. It will be used
30719 * for things like prompting the user for passwords.
30721 * The @interaction argument will normally be a derived subclass of
30722 * #GTlsInteraction. %NULL can also be provided if no user interaction
30723 * should occur for this connection.
30730 * g_tls_connection_set_rehandshake_mode:
30731 * @conn: a #GTlsConnection
30732 * @mode: the rehandshaking mode
30734 * Sets how @conn behaves with respect to rehandshaking requests.
30736 * %G_TLS_REHANDSHAKE_NEVER means that it will never agree to
30737 * rehandshake after the initial handshake is complete. (For a client,
30738 * this means it will refuse rehandshake requests from the server, and
30739 * for a server, this means it will close the connection with an error
30740 * if the client attempts to rehandshake.)
30742 * %G_TLS_REHANDSHAKE_SAFELY means that the connection will allow a
30743 * rehandshake only if the other end of the connection supports the
30744 * TLS <literal>renegotiation_info</literal> extension. This is the
30745 * default behavior, but means that rehandshaking will not work
30746 * against older implementations that do not support that extension.
30748 * %G_TLS_REHANDSHAKE_UNSAFELY means that the connection will allow
30749 * rehandshaking even without the
30750 * <literal>renegotiation_info</literal> extension. On the server side
30751 * in particular, this is not recommended, since it leaves the server
30752 * open to certain attacks. However, this mode is necessary if you
30753 * need to allow renegotiation with older client software.
30760 * g_tls_connection_set_require_close_notify:
30761 * @conn: a #GTlsConnection
30762 * @require_close_notify: whether or not to require close notification
30764 * Sets whether or not @conn expects a proper TLS close notification
30765 * before the connection is closed. If this is %TRUE (the default),
30766 * then @conn will expect to receive a TLS close notification from its
30767 * peer before the connection is closed, and will return a
30768 * %G_TLS_ERROR_EOF error if the connection is closed without proper
30769 * notification (since this may indicate a network error, or
30770 * man-in-the-middle attack).
30772 * In some protocols, the application will know whether or not the
30773 * connection was closed cleanly based on application-level data
30774 * (because the application-level data includes a length field, or is
30775 * somehow self-delimiting); in this case, the close notify is
30776 * redundant and sometimes omitted. (TLS 1.1 explicitly allows this;
30777 * in TLS 1.0 it is technically an error, but often done anyway.) You
30778 * can use g_tls_connection_set_require_close_notify() to tell @conn
30779 * to allow an "unannounced" connection close, in which case the close
30780 * will show up as a 0-length read, as in a non-TLS
30781 * #GSocketConnection, and it is up to the application to check that
30782 * the data has been fully received.
30784 * Note that this only affects the behavior when the peer closes the
30785 * connection; when the application calls g_io_stream_close() itself
30786 * on @conn, this will send a close notification regardless of the
30787 * setting of this property. If you explicitly want to do an unclean
30788 * close, you can close @conn's #GTlsConnection:base-io-stream rather
30789 * than closing @conn itself.
30796 * g_tls_connection_set_use_system_certdb:
30797 * @conn: a #GTlsConnection
30798 * @use_system_certdb: whether to use the system certificate database
30800 * Sets whether @conn uses the system certificate database to verify
30801 * peer certificates. This is %TRUE by default. If set to %FALSE, then
30802 * peer certificate validation will always set the
30803 * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
30804 * #GTlsConnection::accept-certificate will always be emitted on
30805 * client-side connections, unless that bit is not set in
30806 * #GTlsClientConnection:validation-flags).
30808 * Deprecated: 2.30: Use g_tls_connection_set_database() instead
30813 * g_tls_database_create_certificate_handle:
30814 * @self: a #GTlsDatabase
30815 * @certificate: certificate for which to create a handle.
30817 * Create a handle string for the certificate. The database will only be able
30818 * to create a handle for certificates that originate from the database. In
30819 * cases where the database cannot create a handle for a certificate, %NULL
30820 * will be returned.
30822 * This handle should be stable across various instances of the application,
30823 * and between applications. If a certificate is modified in the database,
30824 * then it is not guaranteed that this handle will continue to point to it.
30826 * Returns: (allow-none): a newly allocated string containing the handle.
30832 * g_tls_database_lookup_certificate_for_handle:
30833 * @self: a #GTlsDatabase
30834 * @handle: a certificate handle
30835 * @interaction: (allow-none): used to interact with the user if necessary
30836 * @flags: Flags which affect the lookup.
30837 * @cancellable: (allow-none): a #GCancellable, or %NULL
30838 * @error: (allow-none): a #GError, or %NULL
30840 * Lookup a certificate by its handle.
30842 * The handle should have been created by calling
30843 * g_tls_database_create_certificate_handle() on a #GTlsDatabase object of
30844 * the same TLS backend. The handle is designed to remain valid across
30845 * instantiations of the database.
30847 * If the handle is no longer valid, or does not point to a certificate in
30848 * this database, then %NULL will be returned.
30850 * This function can block, use g_tls_database_lookup_certificate_for_handle_async() to perform
30851 * the lookup operation asynchronously.
30853 * Returns: (transfer full) (allow-none): a newly allocated #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
30859 * g_tls_database_lookup_certificate_for_handle_async:
30860 * @self: a #GTlsDatabase
30861 * @handle: a certificate handle
30862 * @interaction: (allow-none): used to interact with the user if necessary
30863 * @flags: Flags which affect the lookup.
30864 * @cancellable: (allow-none): a #GCancellable, or %NULL
30865 * @callback: callback to call when the operation completes
30866 * @user_data: the data to pass to the callback function
30868 * Asynchronously lookup a certificate by its handle in the database. See
30869 * g_tls_database_lookup_certificate_for_handle() for more information.
30876 * g_tls_database_lookup_certificate_for_handle_finish:
30877 * @self: a #GTlsDatabase
30878 * @result: a #GAsyncResult.
30879 * @error: a #GError pointer, or %NULL
30881 * Finish an asynchronous lookup of a certificate by its handle. See
30882 * g_tls_database_lookup_certificate_handle() for more information.
30884 * If the handle is no longer valid, or does not point to a certificate in
30885 * this database, then %NULL will be returned.
30887 * Returns: (transfer full): a newly allocated #GTlsCertificate object. Use g_object_unref() to release the certificate.
30893 * g_tls_database_lookup_certificate_issuer:
30894 * @self: a #GTlsDatabase
30895 * @certificate: a #GTlsCertificate
30896 * @interaction: (allow-none): used to interact with the user if necessary
30897 * @flags: flags which affect the lookup operation
30898 * @cancellable: (allow-none): a #GCancellable, or %NULL
30899 * @error: (allow-none): a #GError, or %NULL
30901 * Lookup the issuer of @certificate in the database.
30903 * The %issuer property
30904 * of @certificate is not modified, and the two certificates are not hooked
30907 * This function can block, use g_tls_database_lookup_certificate_issuer_async() to perform
30908 * the lookup operation asynchronously.
30910 * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
30916 * g_tls_database_lookup_certificate_issuer_async:
30917 * @self: a #GTlsDatabase
30918 * @certificate: a #GTlsCertificate
30919 * @interaction: (allow-none): used to interact with the user if necessary
30920 * @flags: flags which affect the lookup operation
30921 * @cancellable: (allow-none): a #GCancellable, or %NULL
30922 * @callback: callback to call when the operation completes
30923 * @user_data: the data to pass to the callback function
30925 * Asynchronously lookup the issuer of @certificate in the database. See
30926 * g_tls_database_lookup_certificate_issuer() for more information.
30933 * g_tls_database_lookup_certificate_issuer_finish:
30934 * @self: a #GTlsDatabase
30935 * @result: a #GAsyncResult.
30936 * @error: a #GError pointer, or %NULL
30938 * Finish an asynchronous lookup issuer operation. See
30939 * g_tls_database_lookup_certificate_issuer() for more information.
30941 * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
30947 * g_tls_database_lookup_certificates_issued_by:
30948 * @self: a #GTlsDatabase
30949 * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
30950 * @interaction: (allow-none): used to interact with the user if necessary
30951 * @flags: Flags which affect the lookup operation.
30952 * @cancellable: (allow-none): a #GCancellable, or %NULL
30953 * @error: (allow-none): a #GError, or %NULL
30955 * Lookup certificates issued by this issuer in the database.
30957 * This function can block, use g_tls_database_lookup_certificates_issued_by_async() to perform
30958 * the lookup operation asynchronously.
30960 * 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.
30966 * g_tls_database_lookup_certificates_issued_by_async:
30967 * @self: a #GTlsDatabase
30968 * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
30969 * @interaction: (allow-none): used to interact with the user if necessary
30970 * @flags: Flags which affect the lookup operation.
30971 * @cancellable: (allow-none): a #GCancellable, or %NULL
30972 * @callback: callback to call when the operation completes
30973 * @user_data: the data to pass to the callback function
30975 * Asynchronously lookup certificates issued by this issuer in the database. See
30976 * g_tls_database_lookup_certificates_issued_by() for more information.
30978 * The database may choose to hold a reference to the issuer byte array for the duration
30979 * of of this asynchronous operation. The byte array should not be modified during
30987 * g_tls_database_lookup_certificates_issued_by_finish:
30988 * @self: a #GTlsDatabase
30989 * @result: a #GAsyncResult.
30990 * @error: a #GError pointer, or %NULL
30992 * Finish an asynchronous lookup of certificates. See
30993 * g_tls_database_lookup_certificates_issued_by() for more information.
30995 * 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.
31001 * g_tls_database_verify_chain:
31002 * @self: a #GTlsDatabase
31003 * @chain: a #GTlsCertificate chain
31004 * @purpose: the purpose that this certificate chain will be used for.
31005 * @identity: (allow-none): the expected peer identity
31006 * @interaction: (allow-none): used to interact with the user if necessary
31007 * @flags: additional verify flags
31008 * @cancellable: (allow-none): a #GCancellable, or %NULL
31009 * @error: (allow-none): a #GError, or %NULL
31011 * Verify's a certificate chain after looking up and adding any missing
31012 * certificates to the chain.
31014 * @chain is a chain of #GTlsCertificate objects each pointing to the next
31015 * certificate in the chain by its %issuer property. The chain may initially
31016 * consist of one or more certificates. After the verification process is
31017 * complete, @chain may be modified by adding missing certificates, or removing
31018 * extra certificates. If a certificate anchor was found, then it is added to
31021 * @purpose describes the purpose (or usage) for which the certificate
31022 * is being used. Typically @purpose will be set to #G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER
31023 * which means that the certificate is being used to authenticate a server
31024 * (and we are acting as the client).
31026 * The @identity is used to check for pinned certificates (trust exceptions)
31027 * in the database. These will override the normal verification process on a
31028 * host by host basis.
31030 * Currently there are no @flags, and %G_TLS_DATABASE_VERIFY_NONE should be
31033 * This function can block, use g_tls_database_verify_chain_async() to perform
31034 * the verification operation asynchronously.
31036 * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
31042 * g_tls_database_verify_chain_async:
31043 * @self: a #GTlsDatabase
31044 * @chain: a #GTlsCertificate chain
31045 * @purpose: the purpose that this certificate chain will be used for.
31046 * @identity: (allow-none): the expected peer identity
31047 * @interaction: (allow-none): used to interact with the user if necessary
31048 * @flags: additional verify flags
31049 * @cancellable: (allow-none): a #GCancellable, or %NULL
31050 * @callback: callback to call when the operation completes
31051 * @user_data: the data to pass to the callback function
31053 * Asynchronously verify's a certificate chain after looking up and adding
31054 * any missing certificates to the chain. See g_tls_database_verify_chain()
31055 * for more information.
31062 * g_tls_database_verify_chain_finish:
31063 * @self: a #GTlsDatabase
31064 * @result: a #GAsyncResult.
31065 * @error: a #GError pointer, or %NULL
31067 * Finish an asynchronous verify chain operation. See
31068 * g_tls_database_verify_chain() for more information. *
31070 * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
31076 * g_tls_error_quark:
31078 * Gets the TLS error quark.
31080 * Returns: a #GQuark.
31086 * g_tls_file_database_new:
31087 * @anchors: filename of anchor certificate authorities.
31088 * @error: #GError for error reporting, or %NULL to ignore.
31090 * Creates a new #GTlsFileDatabase which uses anchor certificate authorities
31091 * in @anchors to verify certificate chains.
31093 * The certificates in @anchors must be PEM encoded.
31095 * Returns: (transfer full) (type GTlsFileDatabase): the new #GTlsFileDatabase, or %NULL on error
31101 * g_tls_interaction_ask_password:
31102 * @interaction: a #GTlsInteraction object
31103 * @password: a #GTlsPassword object
31104 * @cancellable: an optional #GCancellable cancellation object
31105 * @error: an optional location to place an error on failure
31107 * Run synchronous interaction to ask the user for a password. In general,
31108 * g_tls_interaction_invoke_ask_password() should be used instead of this
31111 * Derived subclasses usually implement a password prompt, although they may
31112 * also choose to provide a password from elsewhere. The @password value will
31113 * be filled in and then @callback will be called. Alternatively the user may
31114 * abort this password request, which will usually abort the TLS connection.
31116 * If the interaction is cancelled by the cancellation object, or by the
31117 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31118 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31119 * not support immediate cancellation.
31121 * Returns: The status of the ask password interaction.
31127 * g_tls_interaction_ask_password_async:
31128 * @interaction: a #GTlsInteraction object
31129 * @password: a #GTlsPassword object
31130 * @cancellable: an optional #GCancellable cancellation object
31131 * @callback: (allow-none): will be called when the interaction completes
31132 * @user_data: (allow-none): data to pass to the @callback
31134 * Run asynchronous interaction to ask the user for a password. In general,
31135 * g_tls_interaction_invoke_ask_password() should be used instead of this
31138 * Derived subclasses usually implement a password prompt, although they may
31139 * also choose to provide a password from elsewhere. The @password value will
31140 * be filled in and then @callback will be called. Alternatively the user may
31141 * abort this password request, which will usually abort the TLS connection.
31143 * If the interaction is cancelled by the cancellation object, or by the
31144 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31145 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31146 * not support immediate cancellation.
31148 * Certain implementations may not support immediate cancellation.
31155 * g_tls_interaction_ask_password_finish:
31156 * @interaction: a #GTlsInteraction object
31157 * @result: the result passed to the callback
31158 * @error: an optional location to place an error on failure
31160 * Complete an ask password user interaction request. This should be once
31161 * the g_tls_interaction_ask_password_async() completion callback is called.
31163 * If %G_TLS_INTERACTION_HANDLED is returned, then the #GTlsPassword passed
31164 * to g_tls_interaction_ask_password() will have its password filled in.
31166 * If the interaction is cancelled by the cancellation object, or by the
31167 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31168 * contains a %G_IO_ERROR_CANCELLED error code.
31170 * Returns: The status of the ask password interaction.
31176 * g_tls_interaction_invoke_ask_password:
31177 * @interaction: a #GTlsInteraction object
31178 * @password: a #GTlsPassword object
31179 * @cancellable: an optional #GCancellable cancellation object
31180 * @error: an optional location to place an error on failure
31182 * Invoke the interaction to ask the user for a password. It invokes this
31183 * interaction in the main loop, specifically the #GMainContext returned by
31184 * g_main_context_get_thread_default() when the interaction is created. This
31185 * is called by called by #GTlsConnection or #GTlsDatabase to ask the user
31188 * Derived subclasses usually implement a password prompt, although they may
31189 * also choose to provide a password from elsewhere. The @password value will
31190 * be filled in and then @callback will be called. Alternatively the user may
31191 * abort this password request, which will usually abort the TLS connection.
31193 * The implementation can either be a synchronous (eg: modal dialog) or an
31194 * asynchronous one (eg: modeless dialog). This function will take care of
31195 * calling which ever one correctly.
31197 * If the interaction is cancelled by the cancellation object, or by the
31198 * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31199 * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31200 * not support immediate cancellation.
31202 * Returns: The status of the ask password interaction.
31208 * g_tls_password_get_description:
31209 * @password: a #GTlsPassword object
31211 * Get a description string about what the password will be used for.
31213 * Returns: The description of the password.
31219 * g_tls_password_get_flags:
31220 * @password: a #GTlsPassword object
31222 * Get flags about the password.
31224 * Returns: The flags about the password.
31230 * g_tls_password_get_value:
31231 * @password: a #GTlsPassword object
31232 * @length: (allow-none): location to place the length of the password.
31234 * Get the password value. If @length is not %NULL then it will be
31235 * filled in with the length of the password value. (Note that the
31236 * password value is not nul-terminated, so you can only pass %NULL
31237 * for @length in contexts where you know the password will have a
31238 * certain fixed length.)
31240 * Returns: The password value (owned by the password object).
31246 * g_tls_password_get_warning:
31247 * @password: a #GTlsPassword object
31249 * Get a user readable translated warning. Usually this warning is a
31250 * representation of the password flags returned from
31251 * g_tls_password_get_flags().
31253 * Returns: The warning.
31259 * g_tls_password_new:
31260 * @flags: the password flags
31261 * @description: description of what the password is for
31263 * Create a new #GTlsPassword object.
31265 * Returns: (transfer full): The newly allocated password object
31270 * g_tls_password_set_description:
31271 * @password: a #GTlsPassword object
31272 * @description: The description of the password
31274 * Set a description string about what the password will be used for.
31281 * g_tls_password_set_flags:
31282 * @password: a #GTlsPassword object
31283 * @flags: The flags about the password
31285 * Set flags about the password.
31292 * g_tls_password_set_value:
31293 * @password: a #GTlsPassword object
31294 * @value: the new password value
31295 * @length: the length of the password, or -1
31297 * Set the value for this password. The @value will be copied by the password
31300 * Specify the @length, for a non-nul-terminated password. Pass -1 as
31301 * @length if using a nul-terminated password, and @length will be
31302 * calculated automatically. (Note that the terminating nul is not
31303 * considered part of the password in this case.)
31310 * g_tls_password_set_value_full:
31311 * @password: a #GTlsPassword object
31312 * @value: the value for the password
31313 * @length: the length of the password, or -1
31314 * @destroy: (allow-none): a function to use to free the password.
31316 * Provide the value for this password.
31318 * The @value will be owned by the password object, and later freed using
31319 * the @destroy function callback.
31321 * Specify the @length, for a non-nul-terminated password. Pass -1 as
31322 * @length if using a nul-terminated password, and @length will be
31323 * calculated automatically. (Note that the terminating nul is not
31324 * considered part of the password in this case.)
31326 * Virtual: set_value
31332 * g_tls_password_set_warning:
31333 * @password: a #GTlsPassword object
31334 * @warning: The user readable warning
31336 * Set a user readable translated warning. Usually this warning is a
31337 * representation of the password flags returned from
31338 * g_tls_password_get_flags().
31345 * g_tls_server_connection_new:
31346 * @base_io_stream: the #GIOStream to wrap
31347 * @certificate: (allow-none): the default server certificate, or %NULL
31348 * @error: #GError for error reporting, or %NULL to ignore.
31350 * Creates a new #GTlsServerConnection wrapping @base_io_stream (which
31351 * must have pollable input and output streams).
31353 * Returns: (transfer full) (type GTlsServerConnection): the new #GTlsServerConnection, or %NULL on error
31359 * g_unix_connection_receive_credentials:
31360 * @connection: A #GUnixConnection.
31361 * @cancellable: (allow-none): A #GCancellable or %NULL.
31362 * @error: Return location for error or %NULL.
31364 * Receives credentials from the sending end of the connection. The
31365 * sending end has to call g_unix_connection_send_credentials() (or
31366 * similar) for this to work.
31368 * As well as reading the credentials this also reads (and discards) a
31369 * single byte from the stream, as this is required for credentials
31370 * passing to work on some implementations.
31372 * Other ways to exchange credentials with a foreign peer includes the
31373 * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
31375 * Returns: (transfer full): Received credentials on success (free with g_object_unref()), %NULL if @error is set.
31381 * g_unix_connection_receive_credentials_async:
31382 * @connection: A #GUnixConnection.
31383 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31384 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
31385 * @user_data: (closure): the data to pass to callback function
31387 * Asynchronously receive credentials.
31389 * For more details, see g_unix_connection_receive_credentials() which is
31390 * the synchronous version of this call.
31392 * When the operation is finished, @callback will be called. You can then call
31393 * g_unix_connection_receive_credentials_finish() to get the result of the operation.
31400 * g_unix_connection_receive_credentials_finish:
31401 * @connection: A #GUnixConnection.
31402 * @result: a #GAsyncResult.
31403 * @error: a #GError, or %NULL
31405 * Finishes an asynchronous receive credentials operation started with
31406 * g_unix_connection_receive_credentials_async().
31408 * Returns: (transfer full): a #GCredentials, or %NULL on error. Free the returned object with g_object_unref().
31414 * g_unix_connection_receive_fd:
31415 * @connection: a #GUnixConnection
31416 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
31417 * @error: (allow-none): #GError for error reporting, or %NULL to ignore
31419 * Receives a file descriptor from the sending end of the connection.
31420 * The sending end has to call g_unix_connection_send_fd() for this
31423 * As well as reading the fd this also reads a single byte from the
31424 * stream, as this is required for fd passing to work on some
31427 * Returns: a file descriptor on success, -1 on error.
31433 * g_unix_connection_send_credentials:
31434 * @connection: A #GUnixConnection.
31435 * @cancellable: (allow-none): A #GCancellable or %NULL.
31436 * @error: Return location for error or %NULL.
31438 * Passes the credentials of the current user the receiving side
31439 * of the connection. The receiving end has to call
31440 * g_unix_connection_receive_credentials() (or similar) to accept the
31443 * As well as sending the credentials this also writes a single NUL
31444 * byte to the stream, as this is required for credentials passing to
31445 * work on some implementations.
31447 * Other ways to exchange credentials with a foreign peer includes the
31448 * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
31450 * Returns: %TRUE on success, %FALSE if @error is set.
31456 * g_unix_connection_send_credentials_async:
31457 * @connection: A #GUnixConnection.
31458 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31459 * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
31460 * @user_data: (closure): the data to pass to callback function
31462 * Asynchronously send credentials.
31464 * For more details, see g_unix_connection_send_credentials() which is
31465 * the synchronous version of this call.
31467 * When the operation is finished, @callback will be called. You can then call
31468 * g_unix_connection_send_credentials_finish() to get the result of the operation.
31475 * g_unix_connection_send_credentials_finish:
31476 * @connection: A #GUnixConnection.
31477 * @result: a #GAsyncResult.
31478 * @error: a #GError, or %NULL
31480 * Finishes an asynchronous send credentials operation started with
31481 * g_unix_connection_send_credentials_async().
31483 * Returns: %TRUE if the operation was successful, otherwise %FALSE.
31489 * g_unix_connection_send_fd:
31490 * @connection: a #GUnixConnection
31491 * @fd: a file descriptor
31492 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31493 * @error: (allow-none): #GError for error reporting, or %NULL to ignore.
31495 * Passes a file descriptor to the receiving side of the
31496 * connection. The receiving end has to call g_unix_connection_receive_fd()
31497 * to accept the file descriptor.
31499 * As well as sending the fd this also writes a single byte to the
31500 * stream, as this is required for fd passing to work on some
31503 * Returns: a %TRUE on success, %NULL on error.
31509 * g_unix_credentials_message_get_credentials:
31510 * @message: A #GUnixCredentialsMessage.
31512 * Gets the credentials stored in @message.
31514 * Returns: (transfer none): A #GCredentials instance. Do not free, it is owned by @message.
31520 * g_unix_credentials_message_is_supported:
31522 * Checks if passing #GCredentials on a #GSocket is supported on this platform.
31524 * Returns: %TRUE if supported, %FALSE otherwise
31530 * g_unix_credentials_message_new:
31532 * Creates a new #GUnixCredentialsMessage with credentials matching the current processes.
31534 * Returns: a new #GUnixCredentialsMessage
31540 * g_unix_credentials_message_new_with_credentials:
31541 * @credentials: A #GCredentials object.
31543 * Creates a new #GUnixCredentialsMessage holding @credentials.
31545 * Returns: a new #GUnixCredentialsMessage
31551 * g_unix_fd_list_append:
31552 * @list: a #GUnixFDList
31553 * @fd: a valid open file descriptor
31554 * @error: a #GError pointer
31556 * Adds a file descriptor to @list.
31558 * The file descriptor is duplicated using dup(). You keep your copy
31559 * of the descriptor and the copy contained in @list will be closed
31560 * when @list is finalized.
31562 * A possible cause of failure is exceeding the per-process or
31563 * system-wide file descriptor limit.
31565 * The index of the file descriptor in the list is returned. If you use
31566 * this index with g_unix_fd_list_get() then you will receive back a
31567 * duplicated copy of the same file descriptor.
31569 * Returns: the index of the appended fd in case of success, else -1 (and @error is set)
31575 * g_unix_fd_list_get:
31576 * @list: a #GUnixFDList
31577 * @index_: the index into the list
31578 * @error: a #GError pointer
31580 * Gets a file descriptor out of @list.
31582 * @index_ specifies the index of the file descriptor to get. It is a
31583 * programmer error for @index_ to be out of range; see
31584 * g_unix_fd_list_get_length().
31586 * The file descriptor is duplicated using dup() and set as
31587 * close-on-exec before being returned. You must call close() on it
31588 * when you are done.
31590 * A possible cause of failure is exceeding the per-process or
31591 * system-wide file descriptor limit.
31593 * Returns: the file descriptor, or -1 in case of error
31599 * g_unix_fd_list_get_length:
31600 * @list: a #GUnixFDList
31602 * Gets the length of @list (ie: the number of file descriptors
31603 * contained within).
31605 * Returns: the length of @list
31611 * g_unix_fd_list_new:
31613 * Creates a new #GUnixFDList containing no file descriptors.
31615 * Returns: a new #GUnixFDList
31621 * g_unix_fd_list_new_from_array:
31622 * @fds: (array length=n_fds): the initial list of file descriptors
31623 * @n_fds: the length of #fds, or -1
31625 * Creates a new #GUnixFDList containing the file descriptors given in
31626 * @fds. The file descriptors become the property of the new list and
31627 * may no longer be used by the caller. The array itself is owned by
31630 * Each file descriptor in the array should be set to close-on-exec.
31632 * If @n_fds is -1 then @fds must be terminated with -1.
31634 * Returns: a new #GUnixFDList
31640 * g_unix_fd_list_peek_fds:
31641 * @list: a #GUnixFDList
31642 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
31644 * Returns the array of file descriptors that is contained in this
31647 * After this call, the descriptors remain the property of @list. The
31648 * caller must not close them and must not free the array. The array is
31649 * valid only until @list is changed in any way.
31651 * If @length is non-%NULL then it is set to the number of file
31652 * descriptors in the returned array. The returned array is also
31653 * terminated with -1.
31655 * This function never returns %NULL. In case there are no file
31656 * descriptors contained in @list, an empty array is returned.
31658 * Returns: (array length=length) (transfer none): an array of file descriptors
31664 * g_unix_fd_list_steal_fds:
31665 * @list: a #GUnixFDList
31666 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
31668 * Returns the array of file descriptors that is contained in this
31671 * After this call, the descriptors are no longer contained in
31672 * @list. Further calls will return an empty list (unless more
31673 * descriptors have been added).
31675 * The return result of this function must be freed with g_free().
31676 * The caller is also responsible for closing all of the file
31677 * descriptors. The file descriptors in the array are set to
31680 * If @length is non-%NULL then it is set to the number of file
31681 * descriptors in the returned array. The returned array is also
31682 * terminated with -1.
31684 * This function never returns %NULL. In case there are no file
31685 * descriptors contained in @list, an empty array is returned.
31687 * Returns: (array length=length) (transfer full): an array of file descriptors
31693 * g_unix_fd_message_append_fd:
31694 * @message: a #GUnixFDMessage
31695 * @fd: a valid open file descriptor
31696 * @error: a #GError pointer
31698 * Adds a file descriptor to @message.
31700 * The file descriptor is duplicated using dup(). You keep your copy
31701 * of the descriptor and the copy contained in @message will be closed
31702 * when @message is finalized.
31704 * A possible cause of failure is exceeding the per-process or
31705 * system-wide file descriptor limit.
31707 * Returns: %TRUE in case of success, else %FALSE (and @error is set)
31713 * g_unix_fd_message_get_fd_list:
31714 * @message: a #GUnixFDMessage
31716 * Gets the #GUnixFDList contained in @message. This function does not
31717 * return a reference to the caller, but the returned list is valid for
31718 * the lifetime of @message.
31720 * Returns: (transfer none): the #GUnixFDList from @message
31726 * g_unix_fd_message_new:
31728 * Creates a new #GUnixFDMessage containing an empty file descriptor
31731 * Returns: a new #GUnixFDMessage
31737 * g_unix_fd_message_new_with_fd_list:
31738 * @fd_list: a #GUnixFDList
31740 * Creates a new #GUnixFDMessage containing @list.
31742 * Returns: a new #GUnixFDMessage
31748 * g_unix_fd_message_steal_fds:
31749 * @message: a #GUnixFDMessage
31750 * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
31752 * Returns the array of file descriptors that is contained in this
31755 * After this call, the descriptors are no longer contained in
31756 * @message. Further calls will return an empty list (unless more
31757 * descriptors have been added).
31759 * The return result of this function must be freed with g_free().
31760 * The caller is also responsible for closing all of the file
31763 * If @length is non-%NULL then it is set to the number of file
31764 * descriptors in the returned array. The returned array is also
31765 * terminated with -1.
31767 * This function never returns %NULL. In case there are no file
31768 * descriptors contained in @message, an empty array is returned.
31770 * Returns: (array length=length) (transfer full): an array of file descriptors
31776 * g_unix_input_stream_get_close_fd:
31777 * @stream: a #GUnixInputStream
31779 * Returns whether the file descriptor of @stream will be
31780 * closed when the stream is closed.
31782 * Returns: %TRUE if the file descriptor is closed when done
31788 * g_unix_input_stream_get_fd:
31789 * @stream: a #GUnixInputStream
31791 * Return the UNIX file descriptor that the stream reads from.
31793 * Returns: The file descriptor of @stream
31799 * g_unix_input_stream_new:
31800 * @fd: a UNIX file descriptor
31801 * @close_fd: %TRUE to close the file descriptor when done
31803 * Creates a new #GUnixInputStream for the given @fd.
31805 * If @close_fd is %TRUE, the file descriptor will be closed
31806 * when the stream is closed.
31808 * Returns: a new #GUnixInputStream
31813 * g_unix_input_stream_set_close_fd:
31814 * @stream: a #GUnixInputStream
31815 * @close_fd: %TRUE to close the file descriptor when done
31817 * Sets whether the file descriptor of @stream shall be closed
31818 * when the stream is closed.
31825 * g_unix_is_mount_path_system_internal:
31826 * @mount_path: a mount path, e.g. <filename>/media/disk</filename> or <filename>/usr</filename>
31828 * Determines if @mount_path is considered an implementation of the
31829 * OS. This is primarily used for hiding mountable and mounted volumes
31830 * that only are used in the OS and has little to no relevance to the
31833 * Returns: %TRUE if @mount_path is considered an implementation detail of the OS.
31838 * g_unix_mount_at: (skip)
31839 * @mount_path: path for a possible unix mount.
31840 * @time_read: (out) (allow-none): guint64 to contain a timestamp.
31842 * Gets a #GUnixMountEntry for a given mount path. If @time_read
31843 * is set, it will be filled with a unix timestamp for checking
31844 * if the mounts have changed since with g_unix_mounts_changed_since().
31846 * Returns: (transfer full): a #GUnixMountEntry.
31851 * g_unix_mount_compare:
31852 * @mount1: first #GUnixMountEntry to compare.
31853 * @mount2: second #GUnixMountEntry to compare.
31855 * Compares two unix mounts.
31857 * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
31862 * g_unix_mount_free:
31863 * @mount_entry: a #GUnixMountEntry.
31865 * Frees a unix mount.
31870 * g_unix_mount_get_device_path:
31871 * @mount_entry: a #GUnixMount.
31873 * Gets the device path for a unix mount.
31875 * Returns: a string containing the device path.
31880 * g_unix_mount_get_fs_type:
31881 * @mount_entry: a #GUnixMount.
31883 * Gets the filesystem type for the unix mount.
31885 * Returns: a string containing the file system type.
31890 * g_unix_mount_get_mount_path:
31891 * @mount_entry: input #GUnixMountEntry to get the mount path for.
31893 * Gets the mount path for a unix mount.
31895 * Returns: the mount path for @mount_entry.
31900 * g_unix_mount_guess_can_eject:
31901 * @mount_entry: a #GUnixMountEntry
31903 * Guesses whether a Unix mount can be ejected.
31905 * Returns: %TRUE if @mount_entry is deemed to be ejectable.
31910 * g_unix_mount_guess_icon:
31911 * @mount_entry: a #GUnixMountEntry
31913 * Guesses the icon of a Unix mount.
31915 * Returns: (transfer full): a #GIcon
31920 * g_unix_mount_guess_name:
31921 * @mount_entry: a #GUnixMountEntry
31923 * Guesses the name of a Unix mount.
31924 * The result is a translated string.
31926 * Returns: A newly allocated string that must be freed with g_free()
31931 * g_unix_mount_guess_should_display:
31932 * @mount_entry: a #GUnixMountEntry
31934 * Guesses whether a Unix mount should be displayed in the UI.
31936 * Returns: %TRUE if @mount_entry is deemed to be displayable.
31941 * g_unix_mount_is_readonly:
31942 * @mount_entry: a #GUnixMount.
31944 * Checks if a unix mount is mounted read only.
31946 * Returns: %TRUE if @mount_entry is read only.
31951 * g_unix_mount_is_system_internal:
31952 * @mount_entry: a #GUnixMount.
31954 * Checks if a unix mount is a system path.
31956 * Returns: %TRUE if the unix mount is for a system path.
31961 * g_unix_mount_monitor_new:
31963 * Gets a new #GUnixMountMonitor. The default rate limit for which the
31964 * monitor will report consecutive changes for the mount and mount
31965 * point entry files is the default for a #GFileMonitor. Use
31966 * g_unix_mount_monitor_set_rate_limit() to change this.
31968 * Returns: a #GUnixMountMonitor.
31973 * g_unix_mount_monitor_set_rate_limit:
31974 * @mount_monitor: a #GUnixMountMonitor
31975 * @limit_msec: a integer with the limit in milliseconds to poll for changes.
31977 * Sets the rate limit to which the @mount_monitor will report
31978 * consecutive change events to the mount and mount point entry files.
31985 * g_unix_mount_point_compare:
31986 * @mount1: a #GUnixMount.
31987 * @mount2: a #GUnixMount.
31989 * Compares two unix mount points.
31991 * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
31996 * g_unix_mount_point_free:
31997 * @mount_point: unix mount point to free.
31999 * Frees a unix mount point.
32004 * g_unix_mount_point_get_device_path:
32005 * @mount_point: a #GUnixMountPoint.
32007 * Gets the device path for a unix mount point.
32009 * Returns: a string containing the device path.
32014 * g_unix_mount_point_get_fs_type:
32015 * @mount_point: a #GUnixMountPoint.
32017 * Gets the file system type for the mount point.
32019 * Returns: a string containing the file system type.
32024 * g_unix_mount_point_get_mount_path:
32025 * @mount_point: a #GUnixMountPoint.
32027 * Gets the mount path for a unix mount point.
32029 * Returns: a string containing the mount path.
32034 * g_unix_mount_point_get_options:
32035 * @mount_point: a #GUnixMountPoint.
32037 * Gets the options for the mount point.
32039 * Returns: a string containing the options.
32045 * g_unix_mount_point_guess_can_eject:
32046 * @mount_point: a #GUnixMountPoint
32048 * Guesses whether a Unix mount point can be ejected.
32050 * Returns: %TRUE if @mount_point is deemed to be ejectable.
32055 * g_unix_mount_point_guess_icon:
32056 * @mount_point: a #GUnixMountPoint
32058 * Guesses the icon of a Unix mount point.
32060 * Returns: (transfer full): a #GIcon
32065 * g_unix_mount_point_guess_name:
32066 * @mount_point: a #GUnixMountPoint
32068 * Guesses the name of a Unix mount point.
32069 * The result is a translated string.
32071 * Returns: A newly allocated string that must be freed with g_free()
32076 * g_unix_mount_point_is_loopback:
32077 * @mount_point: a #GUnixMountPoint.
32079 * Checks if a unix mount point is a loopback device.
32081 * Returns: %TRUE if the mount point is a loopback. %FALSE otherwise.
32086 * g_unix_mount_point_is_readonly:
32087 * @mount_point: a #GUnixMountPoint.
32089 * Checks if a unix mount point is read only.
32091 * Returns: %TRUE if a mount point is read only.
32096 * g_unix_mount_point_is_user_mountable:
32097 * @mount_point: a #GUnixMountPoint.
32099 * Checks if a unix mount point is mountable by the user.
32101 * Returns: %TRUE if the mount point is user mountable.
32106 * g_unix_mount_points_changed_since:
32107 * @time: guint64 to contain a timestamp.
32109 * Checks if the unix mount points have changed since a given unix time.
32111 * Returns: %TRUE if the mount points have changed since @time.
32116 * g_unix_mount_points_get: (skip)
32117 * @time_read: (out) (allow-none): guint64 to contain a timestamp.
32119 * Gets a #GList of #GUnixMountPoint containing the unix mount points.
32120 * If @time_read is set, it will be filled with the mount timestamp,
32121 * allowing for checking if the mounts have changed with
32122 * g_unix_mount_points_changed_since().
32124 * Returns: (element-type GUnixMountPoint) (transfer full): a #GList of the UNIX mountpoints.
32129 * g_unix_mounts_changed_since:
32130 * @time: guint64 to contain a timestamp.
32132 * Checks if the unix mounts have changed since a given unix time.
32134 * Returns: %TRUE if the mounts have changed since @time.
32139 * g_unix_mounts_get: (skip)
32140 * @time_read: (out) (allow-none): guint64 to contain a timestamp, or %NULL
32142 * Gets a #GList of #GUnixMountEntry containing the unix mounts.
32143 * If @time_read is set, it will be filled with the mount
32144 * timestamp, allowing for checking if the mounts have changed
32145 * with g_unix_mounts_changed_since().
32147 * Returns: (element-type GUnixMountEntry) (transfer full): a #GList of the UNIX mounts.
32152 * g_unix_output_stream_get_close_fd:
32153 * @stream: a #GUnixOutputStream
32155 * Returns whether the file descriptor of @stream will be
32156 * closed when the stream is closed.
32158 * Returns: %TRUE if the file descriptor is closed when done
32164 * g_unix_output_stream_get_fd:
32165 * @stream: a #GUnixOutputStream
32167 * Return the UNIX file descriptor that the stream writes to.
32169 * Returns: The file descriptor of @stream
32175 * g_unix_output_stream_new:
32176 * @fd: a UNIX file descriptor
32177 * @close_fd: %TRUE to close the file descriptor when done
32179 * Creates a new #GUnixOutputStream for the given @fd.
32181 * If @close_fd, is %TRUE, the file descriptor will be closed when
32182 * the output stream is destroyed.
32184 * Returns: a new #GOutputStream
32189 * g_unix_output_stream_set_close_fd:
32190 * @stream: a #GUnixOutputStream
32191 * @close_fd: %TRUE to close the file descriptor when done
32193 * Sets whether the file descriptor of @stream shall be closed
32194 * when the stream is closed.
32201 * g_unix_socket_address_abstract_names_supported:
32203 * Checks if abstract unix domain socket names are supported.
32205 * Returns: %TRUE if supported, %FALSE otherwise
32211 * g_unix_socket_address_get_address_type:
32212 * @address: a #GInetSocketAddress
32214 * Gets @address's type.
32216 * Returns: a #GUnixSocketAddressType
32222 * g_unix_socket_address_get_is_abstract:
32223 * @address: a #GInetSocketAddress
32225 * Tests if @address is abstract.
32227 * Returns: %TRUE if the address is abstract, %FALSE otherwise
32229 * Deprecated: Use g_unix_socket_address_get_address_type()
32234 * g_unix_socket_address_get_path:
32235 * @address: a #GInetSocketAddress
32237 * Gets @address's path, or for abstract sockets the "name".
32239 * Guaranteed to be zero-terminated, but an abstract socket
32240 * may contain embedded zeros, and thus you should use
32241 * g_unix_socket_address_get_path_len() to get the true length
32244 * Returns: the path for @address
32250 * g_unix_socket_address_get_path_len:
32251 * @address: a #GInetSocketAddress
32253 * Gets the length of @address's path.
32255 * For details, see g_unix_socket_address_get_path().
32257 * Returns: the length of the path
32263 * g_unix_socket_address_new:
32264 * @path: the socket path
32266 * Creates a new #GUnixSocketAddress for @path.
32268 * To create abstract socket addresses, on systems that support that,
32269 * use g_unix_socket_address_new_abstract().
32271 * Returns: a new #GUnixSocketAddress
32277 * g_unix_socket_address_new_abstract:
32278 * @path: (array length=path_len) (element-type gchar): the abstract name
32279 * @path_len: the length of @path, or -1
32281 * Creates a new %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED
32282 * #GUnixSocketAddress for @path.
32284 * Returns: a new #GUnixSocketAddress
32285 * Deprecated: Use g_unix_socket_address_new_with_type().
32290 * g_unix_socket_address_new_with_type:
32291 * @path: (array length=path_len) (element-type gchar): the name
32292 * @path_len: the length of @path, or -1
32293 * @type: a #GUnixSocketAddressType
32295 * Creates a new #GUnixSocketAddress of type @type with name @path.
32297 * If @type is %G_UNIX_SOCKET_ADDRESS_PATH, this is equivalent to
32298 * calling g_unix_socket_address_new().
32300 * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT, then @path_len
32301 * bytes of @path will be copied to the socket's path, and only those
32302 * bytes will be considered part of the name. (If @path_len is -1,
32303 * then @path is assumed to be NUL-terminated.) For example, if @path
32304 * was "test", then calling g_socket_address_get_native_size() on the
32305 * returned socket would return 7 (2 bytes of overhead, 1 byte for the
32306 * abstract-socket indicator byte, and 4 bytes for the name "test").
32308 * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, then
32309 * @path_len bytes of @path will be copied to the socket's path, the
32310 * rest of the path will be padded with 0 bytes, and the entire
32311 * zero-padded buffer will be considered the name. (As above, if
32312 * @path_len is -1, then @path is assumed to be NUL-terminated.) In
32313 * this case, g_socket_address_get_native_size() will always return
32314 * the full size of a <literal>struct sockaddr_un</literal>, although
32315 * g_unix_socket_address_get_path_len() will still return just the
32318 * %G_UNIX_SOCKET_ADDRESS_ABSTRACT is preferred over
32319 * %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED for new programs. Of course,
32320 * when connecting to a server created by another process, you must
32321 * use the appropriate type corresponding to how that process created
32322 * its listening socket.
32324 * Returns: a new #GUnixSocketAddress
32330 * g_vfs_get_default:
32332 * Gets the default #GVfs for the system.
32334 * Returns: (transfer none): a #GVfs.
32339 * g_vfs_get_file_for_path:
32341 * @path: a string containing a VFS path.
32343 * Gets a #GFile for @path.
32345 * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
32350 * g_vfs_get_file_for_uri:
32352 * @uri: a string containing a URI
32354 * Gets a #GFile for @uri.
32356 * This operation never fails, but the returned object
32357 * might not support any I/O operation if the URI
32358 * is malformed or if the URI scheme is not supported.
32360 * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
32367 * Gets the local #GVfs for the system.
32369 * Returns: (transfer none): a #GVfs.
32374 * g_vfs_get_supported_uri_schemes:
32377 * Gets a list of URI schemes supported by @vfs.
32379 * Returns: (transfer none): a %NULL-terminated array of strings. The returned array belongs to GIO and must not be freed or modified.
32387 * Checks if the VFS is active.
32389 * Returns: %TRUE if construction of the @vfs was successful and it is now active.
32394 * g_vfs_parse_name:
32396 * @parse_name: a string to be parsed by the VFS module.
32398 * This operation never fails, but the returned object might
32399 * not support any I/O operations if the @parse_name cannot
32400 * be parsed by the #GVfs module.
32402 * Returns: (transfer full): a #GFile for the given @parse_name. Free the returned object with g_object_unref().
32407 * g_volume_can_eject:
32408 * @volume: a #GVolume.
32410 * Checks if a volume can be ejected.
32412 * Returns: %TRUE if the @volume can be ejected. %FALSE otherwise.
32417 * g_volume_can_mount:
32418 * @volume: a #GVolume.
32420 * Checks if a volume can be mounted.
32422 * Returns: %TRUE if the @volume can be mounted. %FALSE otherwise.
32428 * @volume: a #GVolume.
32429 * @flags: flags affecting the unmount if required for eject
32430 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32431 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
32432 * @user_data: user data that gets passed to @callback
32434 * Ejects a volume. This is an asynchronous operation, and is
32435 * finished by calling g_volume_eject_finish() with the @volume
32436 * and #GAsyncResult returned in the @callback.
32438 * Deprecated: 2.22: Use g_volume_eject_with_operation() instead.
32443 * g_volume_eject_finish:
32444 * @volume: pointer to a #GVolume.
32445 * @result: a #GAsyncResult.
32446 * @error: a #GError location to store an error, or %NULL to ignore
32448 * Finishes ejecting a volume. If any errors occurred during the operation,
32449 * @error will be set to contain the errors and %FALSE will be returned.
32451 * Returns: %TRUE, %FALSE if operation failed.
32452 * Deprecated: 2.22: Use g_volume_eject_with_operation_finish() instead.
32457 * g_volume_eject_with_operation:
32458 * @volume: a #GVolume.
32459 * @flags: flags affecting the unmount if required for eject
32460 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
32461 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32462 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
32463 * @user_data: user data passed to @callback.
32465 * Ejects a volume. This is an asynchronous operation, and is
32466 * finished by calling g_volume_eject_with_operation_finish() with the @volume
32467 * and #GAsyncResult data returned in the @callback.
32474 * g_volume_eject_with_operation_finish:
32475 * @volume: a #GVolume.
32476 * @result: a #GAsyncResult.
32477 * @error: a #GError location to store the error occurring, or %NULL to ignore.
32479 * Finishes ejecting a volume. If any errors occurred during the operation,
32480 * @error will be set to contain the errors and %FALSE will be returned.
32482 * Returns: %TRUE if the volume was successfully ejected. %FALSE otherwise.
32488 * g_volume_enumerate_identifiers:
32489 * @volume: a #GVolume
32491 * Gets the kinds of <link linkend="volume-identifier">identifiers</link>
32492 * that @volume has. Use g_volume_get_identifier() to obtain
32493 * the identifiers themselves.
32495 * Returns: (array zero-terminated=1) (transfer full): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
32500 * g_volume_get_activation_root:
32501 * @volume: a #GVolume
32503 * Gets the activation root for a #GVolume if it is known ahead of
32504 * mount time. Returns %NULL otherwise. If not %NULL and if @volume
32505 * is mounted, then the result of g_mount_get_root() on the
32506 * #GMount object obtained from g_volume_get_mount() will always
32507 * either be equal or a prefix of what this function returns. In
32508 * other words, in code
32512 * GFile *mount_root
32513 * GFile *volume_activation_root;
32515 * mount = g_volume_get_mount (volume); /* mounted, so never NULL */
32516 * mount_root = g_mount_get_root (mount);
32517 * volume_activation_root = g_volume_get_activation_root(volume); /* assume not NULL */
32518 * </programlisting>
32520 * then the expression
32523 * (g_file_has_prefix (volume_activation_root, mount_root) ||
32524 * g_file_equal (volume_activation_root, mount_root))
32525 * </programlisting>
32527 * will always be %TRUE.
32529 * Activation roots are typically used in #GVolumeMonitor
32530 * implementations to find the underlying mount to shadow, see
32531 * g_mount_is_shadowed() for more details.
32533 * Returns: (transfer full): the activation root of @volume or %NULL. Use g_object_unref() to free.
32539 * g_volume_get_drive:
32540 * @volume: a #GVolume.
32542 * Gets the drive for the @volume.
32544 * 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.
32549 * g_volume_get_icon:
32550 * @volume: a #GVolume.
32552 * Gets the icon for @volume.
32554 * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
32559 * g_volume_get_identifier:
32560 * @volume: a #GVolume
32561 * @kind: the kind of identifier to return
32563 * Gets the identifier of the given kind for @volume.
32564 * See the <link linkend="volume-identifier">introduction</link>
32565 * for more information about volume identifiers.
32567 * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GVolume doesn't have this kind of identifier
32572 * g_volume_get_mount:
32573 * @volume: a #GVolume.
32575 * Gets the mount for the @volume.
32577 * 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.
32582 * g_volume_get_name:
32583 * @volume: a #GVolume.
32585 * Gets the name of @volume.
32587 * Returns: the name for the given @volume. The returned string should be freed with g_free() when no longer needed.
32592 * g_volume_get_sort_key:
32593 * @volume: A #GVolume.
32595 * Gets the sort key for @volume, if any.
32597 * Returns: Sorting key for @volume or %NULL if no such key is available.
32603 * g_volume_get_uuid:
32604 * @volume: a #GVolume.
32606 * Gets the UUID for the @volume. The reference is typically based on
32607 * the file system UUID for the volume in question and should be
32608 * considered an opaque string. Returns %NULL if there is no UUID
32611 * 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.
32616 * g_volume_monitor_adopt_orphan_mount:
32617 * @mount: a #GMount object to find a parent for
32619 * This function should be called by any #GVolumeMonitor
32620 * implementation when a new #GMount object is created that is not
32621 * associated with a #GVolume object. It must be called just before
32622 * emitting the @mount_added signal.
32624 * If the return value is not %NULL, the caller must associate the
32625 * returned #GVolume object with the #GMount. This involves returning
32626 * it in its g_mount_get_volume() implementation. The caller must
32627 * also listen for the "removed" signal on the returned object
32628 * and give up its reference when handling that signal
32630 * Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
32631 * the implementor must take a reference to @mount and return it in
32632 * its g_volume_get_mount() implemented. Also, the implementor must
32633 * listen for the "unmounted" signal on @mount and give up its
32634 * reference upon handling that signal.
32636 * There are two main use cases for this function.
32638 * One is when implementing a user space file system driver that reads
32639 * blocks of a block device that is already represented by the native
32640 * volume monitor (for example a CD Audio file system driver). Such
32641 * a driver will generate its own #GMount object that needs to be
32642 * associated with the #GVolume object that represents the volume.
32644 * The other is for implementing a #GVolumeMonitor whose sole purpose
32645 * is to return #GVolume objects representing entries in the users
32646 * "favorite servers" list or similar.
32648 * Returns: (transfer full): the #GVolume object that is the parent for @mount or %NULL if no wants to adopt the #GMount.
32649 * 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.
32654 * g_volume_monitor_get:
32656 * Gets the volume monitor used by gio.
32658 * Returns: (transfer full): a reference to the #GVolumeMonitor used by gio. Call g_object_unref() when done with it.
32663 * g_volume_monitor_get_connected_drives:
32664 * @volume_monitor: a #GVolumeMonitor.
32666 * Gets a list of drives connected to the system.
32668 * The returned list should be freed with g_list_free(), after
32669 * its elements have been unreffed with g_object_unref().
32671 * Returns: (element-type GDrive) (transfer full): a #GList of connected #GDrive objects.
32676 * g_volume_monitor_get_mount_for_uuid:
32677 * @volume_monitor: a #GVolumeMonitor.
32678 * @uuid: the UUID to look for
32680 * Finds a #GMount object by its UUID (see g_mount_get_uuid())
32682 * Returns: (transfer full): a #GMount or %NULL if no such mount is available. Free the returned object with g_object_unref().
32687 * g_volume_monitor_get_mounts:
32688 * @volume_monitor: a #GVolumeMonitor.
32690 * Gets a list of the mounts on the system.
32692 * The returned list should be freed with g_list_free(), after
32693 * its elements have been unreffed with g_object_unref().
32695 * Returns: (element-type GMount) (transfer full): a #GList of #GMount objects.
32700 * g_volume_monitor_get_volume_for_uuid:
32701 * @volume_monitor: a #GVolumeMonitor.
32702 * @uuid: the UUID to look for
32704 * Finds a #GVolume object by its UUID (see g_volume_get_uuid())
32706 * Returns: (transfer full): a #GVolume or %NULL if no such volume is available. Free the returned object with g_object_unref().
32711 * g_volume_monitor_get_volumes:
32712 * @volume_monitor: a #GVolumeMonitor.
32714 * Gets a list of the volumes on the system.
32716 * The returned list should be freed with g_list_free(), after
32717 * its elements have been unreffed with g_object_unref().
32719 * Returns: (element-type GVolume) (transfer full): a #GList of #GVolume objects.
32725 * @volume: a #GVolume.
32726 * @flags: flags affecting the operation
32727 * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
32728 * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32729 * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
32730 * @user_data: user data that gets passed to @callback
32732 * Mounts a volume. This is an asynchronous operation, and is
32733 * finished by calling g_volume_mount_finish() with the @volume
32734 * and #GAsyncResult returned in the @callback.
32736 * Virtual: mount_fn
32741 * g_volume_mount_finish:
32742 * @volume: a #GVolume
32743 * @result: a #GAsyncResult
32744 * @error: a #GError location to store an error, or %NULL to ignore
32746 * Finishes mounting a volume. If any errors occurred during the operation,
32747 * @error will be set to contain the errors and %FALSE will be returned.
32749 * If the mount operation succeeded, g_volume_get_mount() on @volume
32750 * is guaranteed to return the mount right after calling this
32751 * function; there's no need to listen for the 'mount-added' signal on
32754 * Returns: %TRUE, %FALSE if operation failed.
32759 * g_volume_should_automount:
32760 * @volume: a #GVolume
32762 * Returns whether the volume should be automatically mounted.
32764 * Returns: %TRUE if the volume should be automatically mounted.
32769 * g_win32_input_stream_get_close_handle:
32770 * @stream: a #GWin32InputStream
32772 * Returns whether the handle of @stream will be
32773 * closed when the stream is closed.
32775 * Returns: %TRUE if the handle is closed when done
32781 * g_win32_input_stream_get_handle:
32782 * @stream: a #GWin32InputStream
32784 * Return the Windows file handle that the stream reads from.
32786 * Returns: The file handle of @stream
32792 * g_win32_input_stream_new:
32793 * @handle: a Win32 file handle
32794 * @close_handle: %TRUE to close the handle when done
32796 * Creates a new #GWin32InputStream for the given @handle.
32798 * If @close_handle is %TRUE, the handle will be closed
32799 * when the stream is closed.
32801 * Note that "handle" here means a Win32 HANDLE, not a "file descriptor"
32802 * as used in the Windows C libraries.
32804 * Returns: a new #GWin32InputStream
32809 * g_win32_input_stream_set_close_handle:
32810 * @stream: a #GWin32InputStream
32811 * @close_handle: %TRUE to close the handle when done
32813 * Sets whether the handle of @stream shall be closed
32814 * when the stream is closed.
32821 * g_win32_output_stream_get_close_handle:
32822 * @stream: a #GWin32OutputStream
32824 * Returns whether the handle of @stream will be closed when the
32825 * stream is closed.
32827 * Returns: %TRUE if the handle is closed when done
32833 * g_win32_output_stream_get_handle:
32834 * @stream: a #GWin32OutputStream
32836 * Return the Windows handle that the stream writes to.
32838 * Returns: The handle descriptor of @stream
32844 * g_win32_output_stream_new:
32845 * @handle: a Win32 file handle
32846 * @close_handle: %TRUE to close the handle when done
32848 * Creates a new #GWin32OutputStream for the given @handle.
32850 * If @close_handle, is %TRUE, the handle will be closed when the
32851 * output stream is destroyed.
32853 * Returns: a new #GOutputStream
32859 * g_win32_output_stream_set_close_handle:
32860 * @stream: a #GWin32OutputStream
32861 * @close_handle: %TRUE to close the handle when done
32863 * Sets whether the handle of @stream shall be closed when the stream
32871 * g_zlib_compressor_get_file_info:
32872 * @compressor: a #GZlibCompressor
32874 * Returns the #GZlibCompressor:file-info property.
32876 * Returns: (transfer none): a #GFileInfo, or %NULL
32882 * g_zlib_compressor_new:
32883 * @format: The format to use for the compressed data
32884 * @level: compression level (0-9), -1 for default
32886 * Creates a new #GZlibCompressor.
32888 * Returns: a new #GZlibCompressor
32894 * g_zlib_compressor_set_file_info:
32895 * @compressor: a #GZlibCompressor
32896 * @file_info: (allow-none): a #GFileInfo
32898 * Sets @file_info in @compressor. If non-%NULL, and @compressor's
32899 * #GZlibCompressor:format property is %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
32900 * it will be used to set the file name and modification time in
32901 * the GZIP header of the compressed data.
32903 * Note: it is an error to call this function while a compression is in
32904 * progress; it may only be called immediately after creation of @compressor,
32905 * or after resetting it with g_converter_reset().
32912 * g_zlib_decompressor_get_file_info:
32913 * @decompressor: a #GZlibDecompressor
32915 * Retrieves the #GFileInfo constructed from the GZIP header data
32916 * of compressed data processed by @compressor, or %NULL if @decompressor's
32917 * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
32918 * or the header data was not fully processed yet, or it not present in the
32919 * data stream at all.
32921 * Returns: (transfer none): a #GFileInfo, or %NULL
32927 * g_zlib_decompressor_new:
32928 * @format: The format to use for the compressed data
32930 * Creates a new #GZlibDecompressor.
32932 * Returns: a new #GZlibDecompressor
32938 * get_all_desktop_entries_for_mime_type:
32939 * @mime_type: a mime type.
32940 * @except: NULL or a strv list
32942 * Returns all the desktop ids for @mime_type. The desktop files
32943 * are listed in an order so that default applications are listed before
32944 * non-default ones, and handlers for inherited mimetypes are listed
32945 * after the base ones.
32947 * Optionally doesn't list the desktop ids given in the @except
32949 * Returns: a #GList containing the desktop ids which claim to handle @mime_type.
32954 * mime_info_cache_reload:
32955 * @dir: directory path which needs reloading.
32957 * Reload the mime information for the @dir.
32962 /************************************************************/
32963 /* THIS FILE IS GENERATED DO NOT EDIT */
32964 /************************************************************/