Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: DatagramBasedSourceFuncCallback

[163:7] extends: object

This is the function type of the callback used for the #GSource returned by g_datagram_based_create_source().

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • DatagramBasedSourceFuncCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (datagram_based, condition, data)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: GioApi

[675:14] static extends: object

Generated low-level function wrappers for namespace Gio.

Members

  • lib

Methods

  • getLib ()

  • action_name_is_valid (string action_name)

    Checks if @action_name is valid. @action_name is valid if it consists only of alphanumeric characters, plus - and .. The empty string is not a valid action name. It is an error to call this function with a non-UTF-8 @action_name. @action_name must not be NULL.

    • @p action_name is a potential action name.
  • action_print_detailed_name (string action_name, object target_value)

    Formats a detailed action name from @action_name and @target_value. It is an error to call this function with an invalid action name. This function is the opposite of [func@Gio.Action.parse_detailed_name]. It will produce a string that can be parsed back to the @action_name and @target_value by that function. See that function for the types of strings that will be printed by this function.

    • @p action_name is a valid action name.
    • @p target_value is a [type@GLib.Variant] target value, or NULL.
  • app_info_create_from_commandline (string commandline, string application_name, string flags)

    Creates a new [iface@Gio.AppInfo] from the given information. Note that for @commandline, the quoting rules of the Exec key of the freedesktop.org Desktop Entry Specification are applied. For example, if the @commandline contains percent-encoded URIs, the percent-character must be doubled in order to prevent it from being swallowed by Exec key unquoting. See the specification for exact quoting rules.

    • @p commandline is the command line to use.
    • @p application_name is the application name, or NULL to use
    • @commandline. ``
    • @p flags is flags that can specify details of the created [iface@Gio.AppInfo].
  • app_info_get_all ()

    Gets a list of all of the applications currently registered on this system. For desktop files, this includes applications that have NoDisplay=true set or are excluded from display by means of OnlyShowIn or NotShowIn. See [method@Gio.AppInfo.should_show]. The returned list does not include applications which have the Hidden key set.

  • app_info_get_all_for_type (string content_type)

    Gets a list of all [iface@Gio.AppInfo]s for a given content type, including the recommended and fallback [iface@Gio.AppInfo]s. See [func@Gio.AppInfo.get_recommended_for_type] and [func@Gio.AppInfo.get_fallback_for_type].

    • @p content_type is the content type to find a [iface@Gio.AppInfo] for.
  • app_info_get_default_for_type (string content_type, bool must_support_uris)

    Gets the default [iface@Gio.AppInfo] for a given content type.

    • @p content_type is the content type to find a [iface@Gio.AppInfo] for.
    • @p must_support_uris is if TRUE, the [iface@Gio.AppInfo] is expected to support URIs.
  • app_info_get_default_for_type_finish (object result)

    Finishes a default [iface@Gio.AppInfo] lookup started by [func@Gio.AppInfo.get_default_for_type_async]. If no #[iface@Gio.AppInfo] is found, then @error will be set to [error@Gio.IOErrorEnum.NOT_FOUND].

    • @p result is the async result.
  • app_info_get_default_for_uri_scheme (string uri_scheme)

    Gets the default application for handling URIs with the given URI scheme. A URI scheme is the initial part of the URI, up to but not including the :. For example, http, ftp or sip.

    • @p uri_scheme is a string containing a URI scheme..
  • app_info_get_default_for_uri_scheme_finish (object result)

    Finishes a default [iface@Gio.AppInfo] lookup started by [func@Gio.AppInfo.get_default_for_uri_scheme_async]. If no [iface@Gio.AppInfo] is found, then @error will be set to [error@Gio.IOErrorEnum.NOT_FOUND].

    • @p result is the async result.
  • app_info_get_fallback_for_type (string content_type)

    Gets a list of fallback [iface@Gio.AppInfo]s for a given content type, i.e. those applications which claim to support the given content type by MIME type subclassing and not directly.

    • @p content_type is the content type to find a [iface@Gio.AppInfo] for.
  • app_info_get_recommended_for_type (string content_type)

    Gets a list of recommended [iface@Gio.AppInfo]s for a given content type, i.e. those applications which claim to support the given content type exactly, and not by MIME type subclassing. Note that the first application of the list is the last used one, i.e. the last one for which [method@Gio.AppInfo.set_as_last_used_for_type] has been called.

    • @p content_type is the content type to find a [iface@Gio.AppInfo] for.
  • app_info_launch_default_for_uri (string uri, object context)

    Utility function that launches the default application registered to handle the specified uri. Synchronous I/O is done on the uri to detect the type of the file if required. The D-Bus–activated applications don’t have to be started if your application terminates too soon after this function. To prevent this, use [func@Gio.AppInfo.launch_default_for_uri_async] instead.

    • @p uri is the uri to show.
    • @p context is optional launch context.
  • app_info_launch_default_for_uri_finish (object result)

    Finishes an asynchronous launch-default-for-uri operation.

    • @p result is the async result.
  • app_info_reset_type_associations (string content_type)

    Removes all changes to the type associations done by [method@Gio.AppInfo.set_as_default_for_type], [method@Gio.AppInfo.set_as_default_for_extension], [method@Gio.AppInfo.add_supports_type] or [method@Gio.AppInfo.remove_supports_type].

    • @p content_type is a content type.
    • @r None.
  • bus_get_finish (object res)

    Finishes an operation started with g_bus_get(). The returned object is a singleton, that is, shared with other callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the event that you need a private message bus connection, use g_dbus_address_get_for_bus_sync() and g_dbus_connection_new_for_address() with G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT and G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION flags. Note that the returned #GDBusConnection object will (usually) have the #GDBusConnection:exit-on-close property set to %TRUE.

    • @p res is a #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_bus_get().
  • bus_get_sync (string bus_type, object cancellable)

    Synchronously connects to the message bus specified by @bus_type. Note that the returned object may shared with other callers, e.g. if two separate parts of a process calls this function with the same @bus_type, they will share the same object. This is a synchronous failable function. See g_bus_get() and g_bus_get_finish() for the asynchronous version. The returned object is a singleton, that is, shared with other callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the event that you need a private message bus connection, use g_dbus_address_get_for_bus_sync() and g_dbus_connection_new_for_address() with G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT and G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION flags. Note that the returned #GDBusConnection object will (usually) have the #GDBusConnection:exit-on-close property set to %TRUE.

    • @p bus_type is a #GBusType.
    • @p cancellable is a #GCancellable or %NULL.
  • bus_own_name_on_connection_with_closures (object connection, string name, string flags, object name_acquired_closure, object name_lost_closure)

    Version of [func@Gio.bus_own_name_on_connection] using closures instead of callbacks for easier binding in other languages.

    • @p connection is a bus connection.
    • @p name is the well-known name to own.
    • @p flags is a set of flags with ownership options.
    • @p name_acquired_closure is closure to invoke when @name is acquired, or NULL to ignore.
    • @p name_lost_closure is closure to invoke when @name is lost, or NULL to ignore.
  • bus_own_name_with_closures (string bus_type, string name, string flags, object bus_acquired_closure, object name_acquired_closure, object name_lost_closure)

    Version of [func@Gio.bus_own_name using closures instead of callbacks for easier binding in other languages.

    • @p bus_type is the type of bus to own a name on.
    • @p name is the well-known name to own.
    • @p flags is a set of flags with ownership options.
    • @p bus_acquired_closure is closure to invoke when connected to the bus of type @bus_type, or NULL to ignore.
    • @p name_acquired_closure is closure to invoke when @name is acquired, or NULL to ignore.
    • @p name_lost_closure is closure to invoke when @name is lost, or NULL to ignore.
  • bus_unown_name (int owner_id)

    Stops owning a name. Note that there may still be D-Bus traffic to process (relating to owning and unowning the name) in the current thread-default [struct@GLib.MainContext] after this function has returned. You should continue to iterate the [struct@GLib.MainContext] until the [callback@GLib.DestroyNotify] function passed to [func@Gio.bus_own_name] is called, in order to avoid memory leaks through callbacks queued on the [struct@GLib.MainContext] after it’s stopped being iterated.

    • @p owner_id is an identifier obtained from [func@Gio.bus_own_name].
    • @r None.
  • bus_unwatch_name (int watcher_id)

    Stops watching a name. Note that there may still be D-Bus traffic to process (relating to watching and unwatching the name) in the current thread-default #GMainContext after this function has returned. You should continue to iterate the #GMainContext until the #GDestroyNotify function passed to g_bus_watch_name() is called, in order to avoid memory leaks through callbacks queued on the #GMainContext after it’s stopped being iterated.

    • @p watcher_id is An identifier obtained from g_bus_watch_name().
    • @r None.
  • bus_watch_name_on_connection_with_closures (object connection, string name, string flags, object name_appeared_closure, object name_vanished_closure)

    Version of g_bus_watch_name_on_connection() using closures instead of callbacks for easier binding in other languages.

    • @p connection is A #GDBusConnection..
    • @p name is The name (well-known or unique) to watch..
    • @p flags is Flags from the #GBusNameWatcherFlags enumeration..
    • @p name_appeared_closure is #GClosure to invoke when @name is known to exist or %NULL..
    • @p name_vanished_closure is #GClosure to invoke when @name is known to not exist or %NULL..
  • bus_watch_name_with_closures (string bus_type, string name, string flags, object name_appeared_closure, object name_vanished_closure)

    Version of g_bus_watch_name() using closures instead of callbacks for easier binding in other languages.

    • @p bus_type is The type of bus to watch a name on..
    • @p name is The name (well-known or unique) to watch..
    • @p flags is Flags from the #GBusNameWatcherFlags enumeration..
    • @p name_appeared_closure is #GClosure to invoke when @name is known to exist or %NULL..
    • @p name_vanished_closure is #GClosure to invoke when @name is known to not exist or %NULL..
  • content_type_can_be_executable (string type)

    Checks if a content type can be executable. Note that for instance things like text files can be executables (i.e. scripts and batch files).

    • @p type is a content type string.
  • content_type_equals (string type1, string type2)

    Compares two content types for equality.

    • @p type1 is a content type string.
    • @p type2 is a content type string.
  • content_type_from_mime_type (string mime_type)

    Tries to find a content type based on the mime type name.

    • @p mime_type is a mime type string.
  • content_type_get_description (string type)

    Gets the human readable description of the content type.

    • @p type is a content type string.
  • content_type_get_generic_icon_name (string type)

    Gets the generic icon name for a content type. See the shared-mime-info specification for more on the generic icon name.

    • @p type is a content type string.
  • content_type_get_icon (string type)

    Gets the icon for a content type.

    • @p type is a content type string.
  • content_type_get_mime_dirs ()

    Get the list of directories which MIME data is loaded from. See g_content_type_set_mime_dirs() for details.

  • content_type_get_mime_type (string type)

    Gets the mime type for the content type, if one is registered.

    • @p type is a content type string.
  • content_type_get_symbolic_icon (string type)

    Gets the symbolic icon for a content type.

    • @p type is a content type string.
  • content_type_guess_for_tree (object root)

    Tries to guess the type of the tree with root @root, by looking at the files it contains. The result is an array of content types, with the best guess coming first. The types returned all have the form x-content/foo, e.g. x-content/audio-cdda (for audio CDs) or x-content/image-dcf (for a camera memory card). See the shared-mime-info specification for more on x-content types. This function is useful in the implementation of g_mount_guess_content_type().

    • @p root is the root of the tree to guess a type for.
  • content_type_is_a (string type, string supertype)

    Determines if @type is a subset of @supertype.

    • @p type is a content type string.
    • @p supertype is a content type string.
  • content_type_is_mime_type (string type, string mime_type)

    Determines if @type is a subset of @mime_type. Convenience wrapper around g_content_type_is_a().

    • @p type is a content type string.
    • @p mime_type is a mime type string.
  • content_type_is_unknown (string type)

    Checks if the content type is the generic "unknown" type. On UNIX this is the "application/octet-stream" mimetype, while on win32 it is "*" and on OSX it is a dynamic type or octet-stream.

    • @p type is a content type string.
  • content_type_set_mime_dirs (list dirs)

    Set the list of directories used by GIO to load the MIME database. If

    • @dirs is %NULL, the directories used are the default: - the mime subdirectory of the directory in $XDG_DATA_HOME - the mime subdirectory of every directory in $XDG_DATA_DIRS This function is intended to be used when writing tests that depend on information stored in the MIME database, in order to control the data. Typically, in case your tests use %G_TEST_OPTION_ISOLATE_DIRS, but they depend on the system’s MIME database, you should call this function with @dirs set to %NULL before calling g_test_init(), for instance: |[ // Load MIME data from the system g_content_type_set_mime_dirs (NULL); // Isolate the environment g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL); … return g_test_run (); ]|
    • @p dirs is %NULL-terminated list of directories to load MIME data from, including any mime/ subdirectory, and with the first directory to try listed first.
    • @r None.
  • content_types_get_registered ()

    Gets a list of strings containing all the registered content types known to the system. The list and its data should be freed using g_list_free_full (list, g_free).

  • dbus_address_escape_value (string arg0String)

    Escape @string so it can appear in a D-Bus address as the value part of a key-value pair. For instance, if @string is /run/bus-for-:0, this function would return /run/bus-for-%3A0, which could be used in a D-Bus address like unix:nonce-tcp:host=127.0.0.1,port=42,noncefile=/run/bus-for-%3A0.

    • @p string is an unescaped string to be included in a D-Bus address as the value in a key-value pair.
  • dbus_address_get_for_bus_sync (string bus_type, object cancellable)

    Synchronously looks up the D-Bus address for the well-known message bus instance specified by @bus_type. This may involve using various platform specific mechanisms. The returned address will be in the D-Bus address format.

    • @p bus_type is a #GBusType.
    • @p cancellable is a #GCancellable or %NULL.
  • dbus_error_encode_gerror (object error)

    Creates a D-Bus error name to use for @error. If @error matches a registered error (see [func@Gio.DBusError.register_error]), the corresponding D-Bus error name will be returned. Otherwise the a name of the form org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE will be used. This allows other GDBus applications to map the error on the wire back to a [type@GLib.Error] using [func@Gio.DBusError.new_for_dbus_error]. This function is typically only used in object mappings to put a [type@GLib.Error] on the wire. Regular applications should not use it.

    • @p error is an error.
  • dbus_error_get_remote_error (object error)

    Gets the D-Bus error name used for @error, if any. This function is guaranteed to return a D-Bus error name for all [type@GLib.Error]s returned from functions handling remote method calls (for example, [method@Gio.DBusConnection.call_finish]) unless [func@Gio.DBusError.strip_remote_error] has already been used on @error.

    • @p error is an error.
  • dbus_error_is_remote_error (object error)

    Checks if @error represents an error received via D-Bus from a remote peer. If so, use [func@Gio.DBusError.get_remote_error] to get the name of the error.

    • @p error is an error.
  • dbus_error_new_for_dbus_error (string dbus_error_name, string dbus_error_message)

    Creates a [type@GLib.Error] based on the contents of @dbus_error_name and

    • @dbus_error_message. Errors registered with [func@Gio.DBusError.register_error] will be looked up using
    • @dbus_error_name and if a match is found, the error domain and code is used. Applications can use [func@Gio.DBusError.get_remote_error] to recover @dbus_error_name. If a match against a registered error is not found and the D-Bus error name is in a form as returned by [func@Gio.DBusError.encode_gerror] the error domain and code encoded in the name is used to create the [type@GLib.Error]. Also, @dbus_error_name is added to the error message such that it can be recovered with [func@Gio.DBusError.get_remote_error]. Otherwise, a [type@GLib.Error] with the error code [error@Gio.IOErrorEnum.DBUS_ERROR] in the [error@Gio.IOErrorEnum] error domain is returned. Also, @dbus_error_name is added to the error message such that it can be recovered with [func@Gio.DBusError.get_remote_error]. In all three cases,
    • @dbus_error_name can always be recovered from the returned [type@GLib.Error] using the [func@Gio.DBusError.get_remote_error] function (unless [func@Gio.DBusError.strip_remote_error] hasn’t been used on the returned error). This function is typically only used in object mappings to prepare [type@GLib.Error] instances for applications. Regular applications should not use it.
    • @p dbus_error_name is D-Bus error name.
    • @p dbus_error_message is D-Bus error message.
  • dbus_error_strip_remote_error (object error)

    Looks for extra information in the error message used to recover the D-Bus error name and strips it if found. If stripped, the message field in @error will correspond exactly to what was received on the wire. This is typically used when presenting errors to the end user.

    • @p error is an error.
  • dbus_escape_object_path (string s)

    This is a language binding friendly version of g_dbus_escape_object_path_bytestring().

    • @p s is the string to escape.
  • dbus_generate_guid ()

    Generate a D-Bus GUID that can be used with e.g. g_dbus_connection_new(). See the D-Bus specification regarding what strings are valid D-Bus GUIDs. The specification refers to these as ‘UUIDs’ whereas GLib (for historical reasons) refers to them as ‘GUIDs’. The terms are interchangeable. Note that D-Bus GUIDs do not follow RFC 4122.

  • dbus_gvalue_to_gvariant (object gvalue, object type)

    Converts a #GValue to a #GVariant of the type indicated by the @type parameter. The conversion is using the following rules: - G_TYPE_STRING: 's', 'o', 'g' or 'ay' - G_TYPE_STRV: 'as', 'ao' or 'aay' - G_TYPE_BOOLEAN: 'b' - G_TYPE_UCHAR: 'y' - G_TYPE_INT: 'i', 'n' - G_TYPE_UINT: 'u', 'q' - G_TYPE_INT64: 'x' - G_TYPE_UINT64: 't' - G_TYPE_DOUBLE: 'd' - G_TYPE_VARIANT: Any #GVariantType This can fail if e.g. @gvalue is of type %G_TYPE_STRING and @type is 'i', i.e. %G_VARIANT_TYPE_INT32. It will also fail for any #GType (including e.g. %G_TYPE_OBJECT and %G_TYPE_BOXED derived-types) not in the table above. Note that if @gvalue is of type %G_TYPE_VARIANT and its value is %NULL, the empty #GVariant instance (never %NULL) for @type is returned (e.g. 0 for scalar types, the empty string for string types, '/' for object path types, the empty array for any array type and so on). See the g_dbus_gvariant_to_gvalue() function for how to convert a #GVariant to a #GValue.

    • @p gvalue is A #GValue to convert to a #GVariant.
    • @p type is A #GVariantType.
  • dbus_is_address (string arg0String)

    Checks if @string is a D-Bus address. This doesn't check if @string is actually supported by #GDBusServer or #GDBusConnection - use g_dbus_is_supported_address() to do more checks.

    • @p string is A string..
  • dbus_is_error_name (string arg0String)

    Check whether @string is a valid D-Bus error name. This function returns the same result as g_dbus_is_interface_name(), because D-Bus error names are defined to have exactly the same syntax as interface names.

    • @p string is The string to check..
  • dbus_is_guid (string arg0String)

    Checks if @string is a D-Bus GUID. See the documentation for g_dbus_generate_guid() for more information about the format of a GUID.

    • @p string is The string to check..
  • dbus_is_interface_name (string arg0String)

    Checks if @string is a valid D-Bus interface name.

    • @p string is The string to check..
  • dbus_is_member_name (string arg0String)

    Checks if @string is a valid D-Bus member (e.g. signal or method) name.

    • @p string is The string to check..
  • dbus_is_name (string arg0String)

    Checks if @string is a valid D-Bus bus name (either unique or well-known).

    • @p string is The string to check..
  • dbus_is_supported_address (string arg0String)

    Like g_dbus_is_address() but also checks if the library supports the transports in @string and that key/value pairs for each transport are valid. See the specification of the D-Bus address format.

    • @p string is A string..
  • dbus_is_unique_name (string arg0String)

    Checks if @string is a valid D-Bus unique bus name.

    • @p string is The string to check..
  • dtls_client_connection_new (object base_socket, object server_identity)

    Creates a new #GDtlsClientConnection wrapping @base_socket which is assumed to communicate with the server identified by @server_identity.

    • @p base_socket is the #GDatagramBased to wrap.
    • @p server_identity is the expected identity of the server.
  • dtls_server_connection_new (object base_socket, object certificate)

    Creates a new #GDtlsServerConnection wrapping @base_socket.

    • @p base_socket is the #GDatagramBased to wrap.
    • @p certificate is the default server certificate, or %NULL.
  • file_new_build_filenamev (list args)

    Constructs a #GFile from a vector of elements using the correct separator for filenames. Using this function is equivalent to calling g_build_filenamev(), followed by g_file_new_for_path() on the result.

    • @p args is %NULL-terminated array of strings containing the path elements..
  • file_new_for_commandline_arg (string arg)

    Creates a #GFile with the given argument from the command line. The value of @arg can be either a URI, an absolute path or a relative path resolved relative to the current working directory. This operation never fails, but the returned object might not support any I/O operation if @arg points to a malformed path. Note that on Windows, this function expects its argument to be in UTF-8 -- not the system code page. This means that you should not use this function with string from argv as it is passed to main(). g_win32_get_command_line() will return a UTF-8 version of the commandline. #GApplication also uses UTF-8 but g_application_command_line_create_file_for_arg() may be more useful for you there. It is also always possible to use this function with #GOptionContext arguments of type %G_OPTION_ARG_FILENAME.

    • @p arg is a command line string.
  • file_new_for_commandline_arg_and_cwd (string arg, string cwd)

    Creates a #GFile with the given argument from the command line. This function is similar to g_file_new_for_commandline_arg() except that it allows for passing the current working directory as an argument instead of using the current working directory of the process. This is useful if the commandline argument was given in a context other than the invocation of the current process. See also g_application_command_line_create_file_for_arg().

    • @p arg is a command line string.
    • @p cwd is the current working directory of the commandline.
  • file_new_for_path (string path)

    Constructs a #GFile for a given path. This operation never fails, but the returned object might not support any I/O operation if @path is malformed.

    • @p path is a string containing a relative or absolute path. The string must be encoded in the glib filename encoding..
  • file_new_for_uri (string uri)

    Constructs a #GFile for a given URI. This operation never fails, but the returned object might not support any I/O operation if @uri is malformed or if the uri type is not supported.

    • @p uri is a UTF-8 string containing a URI.
  • file_new_tmp_dir_finish (object result)

    Finishes a temporary directory creation started by g_file_new_tmp_dir_async().

    • @p result is a #GAsyncResult.
  • file_parse_name (string parse_name)

    Constructs a #GFile with the given @parse_name (i.e. something given by g_file_get_parse_name()). This operation never fails, but the returned object might not support any I/O operation if the @parse_name cannot be parsed.

    • @p parse_name is a file name or path to be parsed.
  • icon_deserialize (object value)

    Deserializes a #GIcon previously serialized using g_icon_serialize().

    • @p value is a #GVariant created with g_icon_serialize().
  • icon_new_for_string (string str)

    Generate a #GIcon instance from @str. This function can fail if @str is not valid - see g_icon_to_string() for discussion. If your application or library provides one or more #GIcon implementations you need to ensure that each #GType is registered with the type system prior to calling g_icon_new_for_string().

    • @p str is A string obtained via g_icon_to_string()..
  • io_error_from_errno (int err_no)

    Converts errno.h error codes into GIO error codes. The fallback value %G_IO_ERROR_FAILED is returned for error codes not currently handled (but note that future GLib releases may return a more specific value instead). As errno is global and may be modified by intermediate function calls, you should save its value immediately after the call returns, and use the saved value instead of errno: |[ int saved_errno; ret = read (blah); saved_errno = errno; g_io_error_from_errno (saved_errno); ]|

    • @p err_no is Error number as defined in errno.h..
  • io_error_from_file_error (string file_error)

    Converts #GFileError error codes into GIO error codes.

    • @p file_error is a #GFileError..
  • io_extension_point_lookup (string name)

    Looks up an existing extension point.

    • @p name is the name of the extension point.
  • io_extension_point_register (string name)

    Registers an extension point.

    • @p name is The name of the extension point.
  • io_modules_load_all_in_directory (string dirname)

    Loads all the modules in the specified directory. If don't require all modules to be initialized (and thus registering all gtypes) then you can use g_io_modules_scan_all_in_directory() which allows delayed/lazy loading of modules.

    • @p dirname is pathname for a directory containing modules to load..
  • io_modules_load_all_in_directory_with_scope (string dirname, object scope)

    Loads all the modules in the specified directory. If don't require all modules to be initialized (and thus registering all gtypes) then you can use g_io_modules_scan_all_in_directory() which allows delayed/lazy loading of modules.

    • @p dirname is pathname for a directory containing modules to load..
    • @p scope is a scope to use when scanning the modules..
  • io_modules_scan_all_in_directory (string dirname)

    Scans all the modules in the specified directory, ensuring that any extension point implemented by a module is registered. This may not actually load and initialize all the types in each module, some modules may be lazily loaded and initialized when an extension point it implements is used with e.g. g_io_extension_point_get_extensions() or g_io_extension_point_get_extension_by_name(). If you need to guarantee that all types are loaded in all the modules, use g_io_modules_load_all_in_directory().

    • @p dirname is pathname for a directory containing modules to scan..
    • @r None.
  • io_modules_scan_all_in_directory_with_scope (string dirname, object scope)

    Scans all the modules in the specified directory, ensuring that any extension point implemented by a module is registered. This may not actually load and initialize all the types in each module, some modules may be lazily loaded and initialized when an extension point it implements is used with e.g. g_io_extension_point_get_extensions() or g_io_extension_point_get_extension_by_name(). If you need to guarantee that all types are loaded in all the modules, use g_io_modules_load_all_in_directory().

    • @p dirname is pathname for a directory containing modules to scan..
    • @p scope is a scope to use when scanning the modules.
    • @r None.
  • io_scheduler_cancel_all_jobs ()

    Cancels all cancellable I/O jobs. A job is cancellable if a #GCancellable was passed into g_io_scheduler_push_job().

    • @r None.
  • keyfile_settings_backend_new (string filename, string root_path, string root_group)

    Creates a keyfile-backed [class@Gio.SettingsBackend]. The filename of the keyfile to use is given by @filename. All settings read to or written from the backend must fall under the path given in @root_path (which must start and end with a slash and not contain two consecutive slashes).

    • @root_path may be "/". If @root_group is non-NULL then it specifies the name of the keyfile group used for keys that are written directly below @root_path. For example, if @root_path is "/apps/example/" and
    • @root_group is "toplevel", then setting the key "/apps/example/enabled" to true will cause the following to appear in the keyfile: [toplevel] enabled=true If @root_group is NULL then it is not permitted to store keys directly below the @root_path. For keys not stored directly below @root_path (ie: in a sub-path), the name of the subpath (with the final slash stripped) is used as the name of the keyfile group. To continue the example, if "/apps/example/profiles/default/font-size" were set to 12 then the following would appear in the keyfile: [profiles/default] font-size=12 The backend will refuse writes (and return writability as being false) for keys outside of @root_path and, in the event that
    • @root_group is NULL, also for keys directly under @root_path. Writes will also be refused if the backend detects that it has the inability to rewrite the keyfile (ie: the containing directory is not writable). There is no checking done for your key namespace clashing with the syntax of the key file format. For example, if you have [ or ] characters in your path names or = in your key names you may be in trouble. The backend reads default values from a keyfile called defaults in the directory specified by the GKeyfileSettingsBackend:defaults-dir property, and a list of locked keys from a text file with the name locks in the same location.
    • @p filename is the filename of the keyfile.
    • @p root_path is the path under which all settings keys appear.
    • @p root_group is the group name corresponding to @root_path, or NULL to disallow storing keys directly beneath @root_path.
  • memory_monitor_dup_default ()

    Gets a reference to the default #GMemoryMonitor for the system.

  • memory_settings_backend_new ()

    Creates a memory-backed #GSettingsBackend. This backend allows changes to settings, but does not write them to any backing storage, so the next time you run your application, the memory backend will start out with the default values again.

  • network_monitor_get_default ()

    Gets the default #GNetworkMonitor for the system.

  • networking_init ()

    Initializes the platform networking libraries (eg, on Windows, this calls WSAStartup()). GLib will call this itself if it is needed, so you only need to call it if you directly call system networking functions (without calling any GLib networking functions first).

    • @r None.
  • null_settings_backend_new ()

    Creates a readonly #GSettingsBackend. This backend does not allow changes to settings, so all settings will always have their default values.

  • pollable_source_new (object pollable_stream)

    Utility method for #GPollableInputStream and #GPollableOutputStream implementations. Creates a new #GSource that expects a callback of type #GPollableSourceFunc. The new source does not actually do anything on its own; use g_source_add_child_source() to add other sources to it to cause it to trigger.

    • @p pollable_stream is the stream associated with the new source.
  • pollable_source_new_full (object pollable_stream, object child_source, object cancellable)

    Utility method for #GPollableInputStream and #GPollableOutputStream implementations. Creates a new #GSource, as with g_pollable_source_new(), but also attaching @child_source (with a dummy callback), and

    • @cancellable, if they are non-%NULL.
    • @p pollable_stream is the stream associated with the new source.
    • @p child_source is optional child source to attach.
    • @p cancellable is optional #GCancellable to attach.
  • power_profile_monitor_dup_default ()

    Gets a reference to the default #GPowerProfileMonitor for the system.

  • proxy_get_default_for_protocol (string protocol)

    Find the gio-proxy extension point for a proxy implementation that supports the specified protocol.

    • @p protocol is the proxy protocol name (e.g. http, socks, etc).
  • proxy_resolver_get_default ()

    Gets the default #GProxyResolver for the system.

  • resource_load (string filename)

    Loads a binary resource bundle and creates a [struct@Gio.Resource] representation of it, allowing you to query it for data. If you want to use this resource in the global resource namespace you need to register it with [func@Gio.resources_register]. If @filename is empty or the data in it is corrupt, %G_RESOURCE_ERROR_INTERNAL will be returned. If

    • @filename doesn’t exist, or there is an error in reading it, an error from [ctor@GLib.MappedFile.new] will be returned.
    • @p filename is the path of a filename to load, in the GLib filename encoding.
  • resources_enumerate_children (string path, string lookup_flags)

    Returns all the names of children at the specified @path in the set of globally registered resources. The return result is a NULL terminated list of strings which should be released with [func@GLib.strfreev].

    • @lookup_flags controls the behaviour of the lookup.
    • @p path is A path name inside the resource.
    • @p lookup_flags is A [flags@Gio.ResourceLookupFlags].
  • resources_has_children (string path)

    Returns whether the specified @path in the set of globally registered resources has children.

    • @p path is A pathname.
  • resources_lookup_data (string path, string lookup_flags)

    Looks for a file at the specified @path in the set of globally registered resources and returns a [struct@GLib.Bytes] that lets you directly access the data in memory. The data is always followed by a zero byte, so you can safely use the data as a C string. However, that byte is not included in the size of the [struct@GLib.Bytes]. For uncompressed resource files this is a pointer directly into the resource bundle, which is typically in some read-only data section in the program binary. For compressed files we allocate memory on the heap and automatically uncompress the data. @lookup_flags controls the behaviour of the lookup.

    • @p path is A path name inside the resource.
    • @p lookup_flags is A [flags@Gio.ResourceLookupFlags].
  • resources_open_stream (string path, string lookup_flags)

    Looks for a file at the specified @path in the set of globally registered resources and returns a [class@Gio.InputStream] that lets you read the data. @lookup_flags controls the behaviour of the lookup.

    • @p path is A path name inside the resource.
    • @p lookup_flags is A [flags@Gio.ResourceLookupFlags].
  • resources_register (object resource)

    Registers the resource with the process-global set of resources. Once a resource is registered the files in it can be accessed with the global resource lookup functions like [func@Gio.resources_lookup_data].

    • @p resource is A [struct@Gio.Resource].
    • @r None.
  • resources_unregister (object resource)

    Unregisters the resource from the process-global set of resources.

    • @p resource is A [struct@Gio.Resource].
    • @r None.
  • settings_schema_source_get_default ()

    Gets the default system schema source. This function is not required for normal uses of #GSettings but it may be useful to authors of plugin management systems or to those who want to introspect the content of schemas. If no schemas are installed, %NULL will be returned. The returned source may actually consist of multiple schema sources from different directories, depending on which directories were given in XDG_DATA_DIRS and GSETTINGS_SCHEMA_DIR. For this reason, all lookups performed against the default source should probably be done recursively.

  • srv_target_list_sort (object targets)

    Sorts @targets in place according to the algorithm in RFC 2782.

    • @p targets is a #GList of #GSrvTarget.
  • tls_backend_get_default ()

    Gets the default #GTlsBackend for the system.

  • tls_client_connection_new (object base_io_stream, object server_identity)

    Creates a new #GTlsClientConnection wrapping @base_io_stream (which must have pollable input and output streams) which is assumed to communicate with the server identified by @server_identity. See the documentation for #GTlsConnection:base-io-stream for restrictions on when application code can run operations on the @base_io_stream after this function has returned.

    • @p base_io_stream is the #GIOStream to wrap.
    • @p server_identity is the expected identity of the server.
  • tls_file_database_new (string anchors)

    Creates a new #GTlsFileDatabase which uses anchor certificate authorities in @anchors to verify certificate chains. The certificates in @anchors must be PEM encoded.

    • @p anchors is filename of anchor certificate authorities..
  • tls_server_connection_new (object base_io_stream, object certificate)

    Creates a new #GTlsServerConnection wrapping @base_io_stream (which must have pollable input and output streams). See the documentation for #GTlsConnection:base-io-stream for restrictions on when application code can run operations on the @base_io_stream after this function has returned.

    • @p base_io_stream is the #GIOStream to wrap.
    • @p certificate is the default server certificate, or %NULL.

class: CancellableSourceFuncCallback

[92:7] extends: object

This is the function type of the callback used for the #GSource returned by g_cancellable_source_new().

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • CancellableSourceFuncCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (cancellable, data)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: ReallocFuncCallback

[379:7] extends: object

Changes the size of the memory block pointed to by @data to @size bytes. The function should have the same semantics as realloc().

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • ReallocFuncCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (data, size)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: AsyncReadyCallbackCallback

[20:7] extends: object

Type definition for a function that will be called back when an asynchronous operation within GIO has been completed. #GAsyncReadyCallback callbacks from #GTask are guaranteed to be invoked in a later iteration of the thread-default main context (see [method@GLib.MainContext.push_thread_default]) where the #GTask was created. All other users of #GAsyncReadyCallback must likewise call it asynchronously in a later iteration of the main context. The asynchronous operation is guaranteed to have held a reference to @source_object from the time when the *_async() function was called, until after this callback returns.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • AsyncReadyCallbackCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (source_object, res, data)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: TaskThreadFuncCallback

[603:7] extends: object

The prototype for a task function to be run in a thread via g_task_run_in_thread() or g_task_run_in_thread_sync(). If the return-on-cancel flag is set on @task, and @cancellable gets cancelled, then the #GTask will be completed immediately (as though g_task_return_error_if_cancelled() had been called), without waiting for the task function to complete. However, the task function will continue running in its thread in the background. The function therefore needs to be careful about how it uses externally-visible state in this case. See g_task_set_return_on_cancel() for more details. Other than in that case, @task will be completed when the #GTaskThreadFunc returns, not when it calls a g_task_return_ function.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • TaskThreadFuncCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (task, source_object, task_data, cancellable)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: SimpleAsyncThreadFuncCallback

[449:7] extends: object

Simple thread function that runs an asynchronous operation and checks for cancellation.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • SimpleAsyncThreadFuncCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (res, object, cancellable)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: PollableSourceFuncCallback

[308:7] extends: object

This is the function type of the callback used for the #GSource returned by g_pollable_input_stream_create_source() and g_pollable_output_stream_create_source().

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • PollableSourceFuncCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (pollable_stream, data)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: IOSchedulerJobFuncCallback

[235:7] extends: object

I/O Job function. Long-running jobs should periodically check the @cancellable to see if they have been cancelled.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • IOSchedulerJobFuncCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (job, cancellable, data)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: SocketSourceFuncCallback

[522:7] extends: object

This is the function type of the callback used for the #GSource returned by g_socket_create_source().

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • SocketSourceFuncCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (socket, condition, data)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.