Package ch.bailu.gtk.gio
Klasse Gio
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Package
ch.bailu.gtk.gio.Gio
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic boolean
actionNameIsValid
(Str action_name) Checks if @action_name is valid.static Str
actionPrintDetailedName
(Str action_name, Variant target_value) Formats a detailed action name from @action_name and @target_value.static AppInfo
appInfoCreateFromCommandline
(Str commandline, Str application_name, int flags) Creates a new [iface@Gio.AppInfo] from the given information.static List
Gets a list of all of the applications currently registered
on this system.static List
appInfoGetAllForType
(Str 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.static AppInfo
appInfoGetDefaultForType
(Str content_type, boolean must_support_uris) Gets the default [iface@Gio.AppInfo] for a given content type.static void
appInfoGetDefaultForTypeAsync
(Str content_type, boolean must_support_uris, Cancellable cancellable, Gio.OnAsyncReadyCallback callback, Pointer user_data) Asynchronously gets the default [iface@Gio.AppInfo] for a given content
type.static AppInfo
Finishes a default [iface@Gio.AppInfo] lookup started by
[func@Gio.AppInfo.get_default_for_type_async].static AppInfo
appInfoGetDefaultForUriScheme
(Str uri_scheme) Gets the default application for handling URIs with the given URI scheme.static void
appInfoGetDefaultForUriSchemeAsync
(Str uri_scheme, Cancellable cancellable, Gio.OnAsyncReadyCallback callback, Pointer user_data) Asynchronously gets the default application for handling URIs with
the given URI scheme.static AppInfo
Finishes a default [iface@Gio.AppInfo] lookup started by
[func@Gio.AppInfo.get_default_for_uri_scheme_async].static List
appInfoGetFallbackForType
(Str content_type) Gets a list of fallback [iface@Gio.AppInfo]s for a given content type, i.e.static List
appInfoGetRecommendedForType
(Str 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.static boolean
appInfoLaunchDefaultForUri
(Str uri, AppLaunchContext context) Utility function that launches the default application registered to handle
the specified uri.static void
appInfoLaunchDefaultForUriAsync
(Str uri, AppLaunchContext context, Cancellable cancellable, Gio.OnAsyncReadyCallback callback, Pointer user_data) Async version of [func@Gio.AppInfo.launch_default_for_uri].static boolean
Finishes an asynchronous launch-default-for-uri operation.static void
appInfoResetTypeAssociations
(Str 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].static void
asyncInitableNewvAsync
(long object_type, int n_parameters, Parameter parameters, int io_priority, Cancellable cancellable, Gio.OnAsyncReadyCallback callback, Pointer user_data) Veraltet.static void
busGet
(int bus_type, Cancellable cancellable, Gio.OnAsyncReadyCallback callback, Pointer user_data) Asynchronously connects to the message bus specified by @bus_type.static DBusConnection
busGetFinish
(AsyncResult res) Finishes an operation started with g_bus_get().static DBusConnection
busGetSync
(int bus_type, Cancellable cancellable) Synchronously connects to the message bus specified by @bus_type.static int
busOwnName
(int bus_type, Str name, int flags, Gio.OnBusAcquiredCallback bus_acquired_handler, Gio.OnBusNameAcquiredCallback name_acquired_handler, Gio.OnBusNameLostCallback name_lost_handler, Pointer user_data, Gio.OnDestroyNotify user_data_free_func) Starts acquiring @name on the bus specified by @bus_type and calls
@name_acquired_handler and @name_lost_handler when the name is
acquired respectively lost.static int
busOwnNameOnConnection
(DBusConnection connection, Str name, int flags, Gio.OnBusNameAcquiredCallback name_acquired_handler, Gio.OnBusNameLostCallback name_lost_handler, Pointer user_data, Gio.OnDestroyNotify user_data_free_func) Like g_bus_own_name() but takes a #GDBusConnection instead of a
#GBusType.static int
busOwnNameOnConnectionWithClosures
(DBusConnection connection, Str name, int flags, Closure name_acquired_closure, Closure name_lost_closure) Version of g_bus_own_name_on_connection() using closures instead of
callbacks for easier binding in other languages.static int
busOwnNameWithClosures
(int bus_type, Str name, int flags, Closure bus_acquired_closure, Closure name_acquired_closure, Closure name_lost_closure) Version of g_bus_own_name() using closures instead of callbacks for
easier binding in other languages.static void
busUnownName
(int owner_id) Stops owning a name.static void
busUnwatchName
(int watcher_id) Stops watching a name.static int
busWatchName
(int bus_type, Str name, int flags, Gio.OnBusNameAppearedCallback name_appeared_handler, Gio.OnBusNameVanishedCallback name_vanished_handler, Pointer user_data, Gio.OnDestroyNotify user_data_free_func) Starts watching @name on the bus specified by @bus_type and calls
@name_appeared_handler and @name_vanished_handler when the name is
known to have an owner respectively known to lose its
owner.static int
busWatchNameOnConnection
(DBusConnection connection, Str name, int flags, Gio.OnBusNameAppearedCallback name_appeared_handler, Gio.OnBusNameVanishedCallback name_vanished_handler, Pointer user_data, Gio.OnDestroyNotify user_data_free_func) Like g_bus_watch_name() but takes a #GDBusConnection instead of a
#GBusType.static int
busWatchNameOnConnectionWithClosures
(DBusConnection connection, Str name, int flags, Closure name_appeared_closure, Closure name_vanished_closure) Version of g_bus_watch_name_on_connection() using closures instead of callbacks for
easier binding in other languages.static int
busWatchNameWithClosures
(int bus_type, Str name, int flags, Closure name_appeared_closure, Closure name_vanished_closure) Version of g_bus_watch_name() using closures instead of callbacks for
easier binding in other languages.static boolean
Checks if a content type can be executable.static boolean
contentTypeEquals
(Str type1, Str type2) Compares two content types for equality.static Str
contentTypeFromMimeType
(Str mime_type) Tries to find a content type based on the mime type name.static Str
contentTypeGetDescription
(Str type) Gets the human readable description of the content type.static Str
Gets the generic icon name for a content type.static Icon
contentTypeGetIcon
(Str type) Gets the icon for a content type.static Str
contentTypeGetMimeType
(Str type) Gets the mime type for the content type, if one is registered.static Icon
Gets the symbolic icon for a content type.static boolean
contentTypeIsA
(Str type, Str supertype) Determines if @type is a subset of @supertype.static boolean
contentTypeIsMimeType
(Str type, Str mime_type) Determines if @type is a subset of @mime_type.static boolean
contentTypeIsUnknown
(Str type) Checks if the content type is the generic "unknown" type.static List
Gets a list of strings containing all the registered content types
known to the system.static Str
dbusAddressEscapeValue
(Str string) Escape @string so it can appear in a D-Bus address as the value
part of a key-value pair.static Str
dbusAddressGetForBusSync
(int bus_type, Cancellable cancellable) Synchronously looks up the D-Bus address for the well-known message
bus instance specified by @bus_type.static void
dbusAddressGetStream
(Str address, Cancellable cancellable, Gio.OnAsyncReadyCallback callback, Pointer user_data) Asynchronously connects to an endpoint specified by @address and
sets up the connection so it is in a state to run the client-side
of the D-Bus authentication conversation.static Str
dbusErrorEncodeGerror
(Error error) Creates a D-Bus error name to use for @error.static Str
dbusErrorGetRemoteError
(Error error) Gets the D-Bus error name used for @error, if any.static boolean
dbusErrorIsRemoteError
(Error error) Checks if @error represents an error received via D-Bus from a remote peer.static Error
dbusErrorNewForDbusError
(Str dbus_error_name, Str dbus_error_message) Creates a #GError based on the contents of @dbus_error_name and
@dbus_error_message.static int
static boolean
dbusErrorRegisterError
(int error_domain, int error_code, Str dbus_error_name) Creates an association to map between @dbus_error_name and
#GErrors specified by @error_domain and @error_code.static boolean
dbusErrorStripRemoteError
(Error error) Looks for extra information in the error message used to recover
the D-Bus error name and strips it if found.static boolean
dbusErrorUnregisterError
(int error_domain, int error_code, Str dbus_error_name) Destroys an association previously set up with g_dbus_error_register_error().static Str
This is a language binding friendly version of g_dbus_escape_object_path_bytestring().static Str
Generate a D-Bus GUID that can be used with
e.g. g_dbus_connection_new().static Variant
dbusGvalueToGvariant
(Value gvalue, VariantType type) Converts a #GValue to a #GVariant of the type indicated by the @type
parameter.static void
dbusGvariantToGvalue
(Variant value, Value out_gvalue) Converts a #GVariant to a #GValue.static boolean
dbusIsAddress
(Str string) Checks if @string is a
[D-Bus address](https://dbus.freedesktop.org/doc/dbus-specification.html#addresses).static boolean
dbusIsErrorName
(Str string) Check whether @string is a valid D-Bus error name.static boolean
dbusIsGuid
(Str string) Checks if @string is a D-Bus GUID.static boolean
dbusIsInterfaceName
(Str string) Checks if @string is a valid D-Bus interface name.static boolean
dbusIsMemberName
(Str string) Checks if @string is a valid D-Bus member (e.g. signal or method) name.static boolean
dbusIsName
(Str string) Checks if @string is a valid D-Bus bus name (either unique or well-known).static boolean
dbusIsSupportedAddress
(Str string) 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.static boolean
dbusIsUniqueName
(Str string) Checks if @string is a valid D-Bus unique bus name.static DtlsClientConnection
dtlsClientConnectionNew
(DatagramBased base_socket, SocketConnectable server_identity) Creates a new #GDtlsClientConnection wrapping @base_socket which is
assumed to communicate with the server identified by @server_identity.static DtlsServerConnection
dtlsServerConnectionNew
(DatagramBased base_socket, TlsCertificate certificate) Creates a new #GDtlsServerConnection wrapping @base_socket.static File
Creates a #GFile with the given argument from the command line.static File
fileNewForCommandlineArgAndCwd
(Str arg, Str cwd) Creates a #GFile with the given argument from the command line.static File
fileNewForPath
(Str path) Constructs a #GFile for a given path.static File
fileNewForUri
(Str uri) Constructs a #GFile for a given URI.static void
fileNewTmpAsync
(Str tmpl, int io_priority, Cancellable cancellable, Gio.OnAsyncReadyCallback callback, Pointer user_data) Asynchronously opens a file in the preferred directory for temporary files
(as returned by g_get_tmp_dir()) as g_file_new_tmp().static void
fileNewTmpDirAsync
(Str tmpl, int io_priority, Cancellable cancellable, Gio.OnAsyncReadyCallback callback, Pointer user_data) Asynchronously creates a directory in the preferred directory for
temporary files (as returned by g_get_tmp_dir()) as g_dir_make_tmp().static File
fileNewTmpDirFinish
(AsyncResult result) Finishes a temporary directory creation started by
g_file_new_tmp_dir_async().static File
fileParseName
(Str parse_name) Constructs a #GFile with the given @parse_name (i.e. something
given by g_file_get_parse_name()).static ClassHandler
static Icon
iconDeserialize
(Variant value) Deserializes a #GIcon previously serialized using g_icon_serialize().static Icon
iconNewForString
(Str str) Generate a #GIcon instance from @str.static int
ioErrorFromErrno
(int err_no) Converts `errno.h` error codes into GIO error codes.static int
ioErrorFromFileError
(int file_error) Converts #GFileError error codes into GIO error codes.static int
Gets the GIO Error Quark.static ch.bailu.gtk.gio.IOExtension
ioExtensionPointImplement
(Str extension_point_name, long type, Str extension_name, int priority) Registers @type as extension for the extension point with name
@extension_point_name.static ch.bailu.gtk.gio.IOExtensionPoint
ioExtensionPointLookup
(Str name) Looks up an existing extension point.static ch.bailu.gtk.gio.IOExtensionPoint
ioExtensionPointRegister
(Str name) Registers an extension point.static List
ioModulesLoadAllInDirectory
(Str dirname) Loads all the modules in the specified directory.static List
ioModulesLoadAllInDirectoryWithScope
(Str dirname, ch.bailu.gtk.gio.IOModuleScope scope) Loads all the modules in the specified directory.static void
ioModulesScanAllInDirectory
(Str dirname) Scans all the modules in the specified directory, ensuring that
any extension point implemented by a module is registered.static void
ioModulesScanAllInDirectoryWithScope
(Str dirname, ch.bailu.gtk.gio.IOModuleScope scope) Scans all the modules in the specified directory, ensuring that
any extension point implemented by a module is registered.static void
Veraltet.static void
ioSchedulerPushJob
(Gio.OnIOSchedulerJobFunc job_func, Pointer user_data, Gio.OnDestroyNotify notify, int io_priority, Cancellable cancellable) Veraltet.static SettingsBackend
keyfileSettingsBackendNew
(Str filename, Str root_path, Str root_group) Creates a keyfile-backed [class@Gio.SettingsBackend].static MemoryMonitor
Gets a reference to the default #GMemoryMonitor for the system.static SettingsBackend
Creates a memory-backed #GSettingsBackend.static void
Initializes the platform networking libraries (eg, on Windows, this
calls WSAStartup()).static NetworkMonitor
Gets the default #GNetworkMonitor for the system.static SettingsBackend
Creates a readonly #GSettingsBackend.static Source
pollableSourceNew
(Object pollable_stream) Utility method for #GPollableInputStream and #GPollableOutputStream
implementations.static Source
pollableSourceNewFull
(Pointer pollable_stream, Source child_source, Cancellable cancellable) Utility method for #GPollableInputStream and #GPollableOutputStream
implementations.static long
pollableStreamRead
(InputStream stream, Pointer buffer, long count, boolean blocking, Cancellable cancellable) Tries to read from @stream, as with g_input_stream_read() (if
@blocking is %TRUE) or g_pollable_input_stream_read_nonblocking()
(if @blocking is %FALSE).static long
pollableStreamWrite
(OutputStream stream, Pointer buffer, long count, boolean blocking, Cancellable cancellable) Tries to write to @stream, as with g_output_stream_write() (if
@blocking is %TRUE) or g_pollable_output_stream_write_nonblocking()
(if @blocking is %FALSE).static boolean
pollableStreamWriteAll
(OutputStream stream, Pointer buffer, long count, boolean blocking, Int64 bytes_written, Cancellable cancellable) Tries to write @count bytes to @stream, as with
g_output_stream_write_all(), but using g_pollable_stream_write()
rather than g_output_stream_write().static PowerProfileMonitor
Gets a reference to the default #GPowerProfileMonitor for the system.static Proxy
proxyGetDefaultForProtocol
(Str protocol) Find the `gio-proxy` extension point for a proxy implementation that supports
the specified protocol.static ProxyResolver
Gets the default #GProxyResolver for the system.static int
Gets the #GResolver Error Quark.static int
Gets the [struct@Gio.Resource] Error Quark.static Resource
resourceLoad
(Str filename) Loads a binary resource bundle and creates a [struct@Gio.Resource]
representation of it, allowing you to query it for data.static Strs
resourcesEnumerateChildren
(Str path, int lookup_flags) Returns all the names of children at the specified @path in the set of
globally registered resources.static boolean
resourcesGetInfo
(Str path, int lookup_flags, Int64 size, Int flags) Looks for a file at the specified @path in the set of
globally registered resources and if found returns information about it.static boolean
resourcesHasChildren
(Str path) Returns whether the specified @path in the set of
globally registered resources has children.static Bytes
resourcesLookupData
(Str path, int 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.static InputStream
resourcesOpenStream
(Str path, int 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.static void
resourcesRegister
(Resource resource) Registers the resource with the process-global set of resources.static void
resourcesUnregister
(Resource resource) Unregisters the resource from the process-global set of resources.static SettingsSchemaSource
Gets the default system schema source.static void
simpleAsyncReportErrorInIdle
(Object object, Gio.OnAsyncReadyCallback callback, Pointer user_data, int domain, int code, Str format, Object... _ellipsis) Veraltet.static void
simpleAsyncReportGerrorInIdle
(Object object, Gio.OnAsyncReadyCallback callback, Pointer user_data, Error error) Veraltet.static void
simpleAsyncReportTakeGerrorInIdle
(Object object, Gio.OnAsyncReadyCallback callback, Pointer user_data, Error error) Veraltet.static List
srvTargetListSort
(List targets) Sorts @targets in place according to the algorithm in RFC 2782.static TlsBackend
Gets the default #GTlsBackend for the system.static int
Gets the TLS channel binding error quark.static TlsClientConnection
tlsClientConnectionNew
(IOStream base_io_stream, SocketConnectable 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.static int
Gets the TLS error quark.static TlsFileDatabase
tlsFileDatabaseNew
(Str anchors) Creates a new #GTlsFileDatabase which uses anchor certificate authorities
in @anchors to verify certificate chains.static TlsServerConnection
tlsServerConnectionNew
(IOStream base_io_stream, TlsCertificate certificate) Creates a new #GTlsServerConnection wrapping @base_io_stream (which
must have pollable input and output streams).static boolean
unixIsMountPathSystemInternal
(Str mount_path) Determines if @mount_path is considered an implementation of the
OS.static boolean
unixIsSystemDevicePath
(Str device_path) Determines if @device_path is considered a block device path which is only
used in implementation of the OS.static boolean
unixIsSystemFsType
(Str fs_type) Determines if @fs_type is considered a type of file system which is only
used in implementation of the OS.static int
unixMountCompare
(UnixMountEntry mount1, UnixMountEntry mount2) Veraltet.static UnixMountEntry
unixMountCopy
(UnixMountEntry mount_entry) Veraltet.static boolean
unixMountEntriesChangedSince
(long time) Checks if the Unix mounts have changed since a given Unix time.static void
unixMountFree
(UnixMountEntry mount_entry) Veraltet.static Str
unixMountGetDevicePath
(UnixMountEntry mount_entry) Veraltet.static Str
unixMountGetFsType
(UnixMountEntry mount_entry) Veraltet.static Str
unixMountGetMountPath
(UnixMountEntry mount_entry) Veraltet.static Str
unixMountGetOptions
(UnixMountEntry mount_entry) Veraltet.static Str
unixMountGetRootPath
(UnixMountEntry mount_entry) Veraltet.static boolean
unixMountGuessCanEject
(UnixMountEntry mount_entry) Veraltet.static Icon
unixMountGuessIcon
(UnixMountEntry mount_entry) Veraltet.static Str
unixMountGuessName
(UnixMountEntry mount_entry) Veraltet.static boolean
unixMountGuessShouldDisplay
(UnixMountEntry mount_entry) Veraltet.static Icon
unixMountGuessSymbolicIcon
(UnixMountEntry mount_entry) Veraltet.static boolean
unixMountIsReadonly
(UnixMountEntry mount_entry) Veraltet.static boolean
unixMountIsSystemInternal
(UnixMountEntry mount_entry) Veraltet.static boolean
unixMountPointsChangedSince
(long time) Checks if the Unix mount points have changed since a given Unix time.static boolean
unixMountsChangedSince
(long time) Veraltet.Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
-
Konstruktordetails
-
Gio
public Gio()
-
-
Methodendetails
-
getClassHandler
-
actionNameIsValid
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`.- Parameter:
action_name
- a potential action name- Gibt zurück:
- `TRUE` if @action_name is valid
-
actionPrintDetailedName
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.- Parameter:
action_name
- a valid action nametarget_value
- a [type@GLib.Variant] target value, or `NULL`- Gibt zurück:
- a detailed format string
-
appInfoCreateFromCommandline
public static AppInfo appInfoCreateFromCommandline(@Nonnull Str commandline, @Nullable Str application_name, int flags) throws AllocationError 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](http://freedesktop.org/Standards/desktop-entry-spec)
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](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s07.html)
for exact quoting rules.- Parameter:
commandline
- the command line to useapplication_name
- the application name, or `NULL` to use @commandlineflags
- flags that can specify details of the created [iface@Gio.AppInfo]- Gibt zurück:
- new [iface@Gio.AppInfo] for given command.
- Löst aus:
AllocationError
-
appInfoGetAll
Gets a list of all of the applications currently registered
on this system.
For desktop files, this includes applications that have
[`NoDisplay=true`](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html#key-nodisplay)
set or are excluded from display by means of
[`OnlyShowIn`](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html#key-onlyshowin)
or [`NotShowIn`](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html#key-notshowin).
See [method@Gio.AppInfo.should_show].
The returned list does not include applications which have the
[`Hidden` key](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html#key-hidden)
set.- Gibt zurück:
- a newly allocated list of references to [iface@Gio.AppInfo]s.
-
appInfoGetAllForType
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].- Parameter:
content_type
- the content type to find a [iface@Gio.AppInfo] for- Gibt zurück:
- list of [iface@Gio.AppInfo]s for given @content_type.
-
appInfoGetDefaultForType
public static AppInfo appInfoGetDefaultForType(@Nonnull Str content_type, boolean must_support_uris) Gets the default [iface@Gio.AppInfo] for a given content type.- Parameter:
content_type
- the content type to find a [iface@Gio.AppInfo] formust_support_uris
- if `TRUE`, the [iface@Gio.AppInfo] is expected to support URIs- Gibt zurück:
- [iface@Gio.AppInfo] for given @content_type or `NULL` on error.
-
appInfoGetDefaultForTypeAsync
public static void appInfoGetDefaultForTypeAsync(@Nonnull Str content_type, boolean must_support_uris, @Nullable Cancellable cancellable, Gio.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Asynchronously gets the default [iface@Gio.AppInfo] for a given content
type.- Parameter:
content_type
- the content type to find a [iface@Gio.AppInfo] formust_support_uris
- if `TRUE`, the [iface@Gio.AppInfo] is expected to support URIscancellable
- a [class@Gio.Cancellable]callback
- a [type@Gio.AsyncReadyCallback] to call when the request is doneuser_data
- data to pass to @callback
-
appInfoGetDefaultForTypeFinish
public static AppInfo appInfoGetDefaultForTypeFinish(@Nonnull AsyncResult result) throws AllocationError 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].- Parameter:
result
- the async result- Gibt zurück:
- [iface@Gio.AppInfo] for given @content_type or `NULL` on error.
- Löst aus:
AllocationError
-
appInfoGetDefaultForUriScheme
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`.- Parameter:
uri_scheme
- a string containing a URI scheme.- Gibt zurück:
- [iface@Gio.AppInfo] for given @uri_scheme or `NULL` on error.
-
appInfoGetDefaultForUriSchemeAsync
public static void appInfoGetDefaultForUriSchemeAsync(@Nonnull Str uri_scheme, @Nullable Cancellable cancellable, Gio.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Asynchronously 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 `:`, e.g. `http`,
`ftp` or `sip`.- Parameter:
uri_scheme
- a string containing a URI scheme.cancellable
- a [class@Gio.Cancellable]callback
- a [type@Gio.AsyncReadyCallback] to call when the request is doneuser_data
- data to pass to @callback
-
appInfoGetDefaultForUriSchemeFinish
public static AppInfo appInfoGetDefaultForUriSchemeFinish(@Nonnull AsyncResult result) throws AllocationError 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].- Parameter:
result
- the async result- Gibt zurück:
- [iface@Gio.AppInfo] for given @uri_scheme or `NULL` on error.
- Löst aus:
AllocationError
-
appInfoGetFallbackForType
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.- Parameter:
content_type
- the content type to find a [iface@Gio.AppInfo] for- Gibt zurück:
- list of [iface@Gio.AppInfo]s for given @content_type or `NULL` on error.
-
appInfoGetRecommendedForType
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.- Parameter:
content_type
- the content type to find a [iface@Gio.AppInfo] for- Gibt zurück:
- list of [iface@Gio.AppInfo]s for given @content_type or `NULL` on error.
-
appInfoLaunchDefaultForUri
public static boolean appInfoLaunchDefaultForUri(@Nonnull Str uri, @Nullable AppLaunchContext context) throws AllocationError 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.- Parameter:
uri
- the uri to showcontext
- optional launch context- Gibt zurück:
- `TRUE` on success, `FALSE` on error.
- Löst aus:
AllocationError
-
appInfoLaunchDefaultForUriAsync
public static void appInfoLaunchDefaultForUriAsync(@Nonnull Str uri, @Nullable AppLaunchContext context, @Nullable Cancellable cancellable, Gio.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Async version of [func@Gio.AppInfo.launch_default_for_uri].
This version is useful if you are interested in receiving error information
in the case where the application is sandboxed and the portal may present an
application chooser dialog to the user.
This is also useful if you want to be sure that the D-Bus–activated
applications are really started before termination and if you are interested
in receiving error information from their activation.- Parameter:
uri
- the uri to showcontext
- optional launch contextcancellable
- a [class@Gio.Cancellable]callback
- a [type@Gio.AsyncReadyCallback] to call when the request is doneuser_data
- data to pass to @callback
-
appInfoLaunchDefaultForUriFinish
public static boolean appInfoLaunchDefaultForUriFinish(@Nonnull AsyncResult result) throws AllocationError Finishes an asynchronous launch-default-for-uri operation.- Parameter:
result
- the async result- Gibt zurück:
- `TRUE` if the launch was successful, `FALSE` if @error is set
- Löst aus:
AllocationError
-
appInfoResetTypeAssociations
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].- Parameter:
content_type
- a content type
-
asyncInitableNewvAsync
@Deprecated public static void asyncInitableNewvAsync(long object_type, int n_parameters, @Nonnull Parameter parameters, int io_priority, @Nullable Cancellable cancellable, Gio.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Veraltet.Helper function for constructing #GAsyncInitable object. This is
similar to g_object_newv() but also initializes the object asynchronously.
When the initialization is finished, @callback will be called. You can
then call g_async_initable_new_finish() to get the new object and check
for any errors.- Parameter:
object_type
- a #GType supporting #GAsyncInitable.n_parameters
- the number of parameters in @parametersparameters
- the parameters to use to construct the objectio_priority
- the [I/O priority](iface.AsyncResult.html#io-priority) of the operationcancellable
- optional #GCancellable object, %NULL to ignore.callback
- a #GAsyncReadyCallback to call when the initialization is finisheduser_data
- the data to pass to callback function
-
busGet
public static void busGet(int bus_type, @Nullable Cancellable cancellable, Gio.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Asynchronously connects to the message bus specified by @bus_type.
When the operation is finished, @callback will be invoked. You can
then call g_bus_get_finish() to get the result of the operation.
This is an asynchronous failable function. See g_bus_get_sync() for
the synchronous version.- Parameter:
bus_type
- a #GBusTypecancellable
- a #GCancellable or %NULLcallback
- a #GAsyncReadyCallback to call when the request is satisfieduser_data
- the data to pass to @callback
-
busGetFinish
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.- Parameter:
res
- a #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_bus_get()- Gibt zurück:
- a #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
- Löst aus:
AllocationError
-
busGetSync
public static DBusConnection busGetSync(int bus_type, @Nullable Cancellable cancellable) throws AllocationError 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.- Parameter:
bus_type
- a #GBusTypecancellable
- a #GCancellable or %NULL- Gibt zurück:
- a #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
- Löst aus:
AllocationError
-
busOwnName
public static int busOwnName(int bus_type, @Nonnull Str name, int flags, Gio.OnBusAcquiredCallback bus_acquired_handler, Gio.OnBusNameAcquiredCallback name_acquired_handler, Gio.OnBusNameLostCallback name_lost_handler, @Nullable Pointer user_data, Gio.OnDestroyNotify user_data_free_func) Starts acquiring @name on the bus specified by @bus_type and calls
@name_acquired_handler and @name_lost_handler when the name is
acquired respectively lost. Callbacks will be invoked in the thread-default
main context (see [method@GLib.MainContext.push_thread_default])
of the thread you are calling this function from.
You are guaranteed that one of the @name_acquired_handler and @name_lost_handler
callbacks will be invoked after calling this function - there are three
possible cases:
- @name_lost_handler with a %NULL connection (if a connection to the bus
can't be made).
- @bus_acquired_handler then @name_lost_handler (if the name can't be
obtained)
- @bus_acquired_handler then @name_acquired_handler (if the name was
obtained).
When you are done owning the name, just call g_bus_unown_name()
with the owner id this function returns.
If the name is acquired or lost (for example another application
could acquire the name if you allow replacement or the application
currently owning the name exits), the handlers are also invoked.
If the #GDBusConnection that is used for attempting to own the name
closes, then @name_lost_handler is invoked since it is no longer
possible for other processes to access the process.
You cannot use g_bus_own_name() several times for the same name (unless
interleaved with calls to g_bus_unown_name()) - only the first call
will work.
Another guarantee is that invocations of @name_acquired_handler
and @name_lost_handler are guaranteed to alternate; that
is, if @name_acquired_handler is invoked then you are
guaranteed that the next time one of the handlers is invoked, it
will be @name_lost_handler. The reverse is also true.
If you plan on exporting objects (using e.g.
g_dbus_connection_register_object()), note that it is generally too late
to export the objects in @name_acquired_handler. Instead, you can do this
in @bus_acquired_handler since you are guaranteed that this will run
before @name is requested from the bus.
This behavior makes it very simple to write applications that wants
to [own names](dbus-name-owning.html#d-bus-name-owning) and export objects.
Simply register objects to be exported in @bus_acquired_handler and
unregister the objects (if any) in @name_lost_handler.- Parameter:
bus_type
- the type of bus to own a name onname
- the well-known name to ownflags
- a set of flags from the #GBusNameOwnerFlags enumerationbus_acquired_handler
- handler to invoke when connected to the bus of type @bus_type or %NULLname_acquired_handler
- handler to invoke when @name is acquired or %NULLname_lost_handler
- handler to invoke when @name is lost or %NULLuser_data
- user data to pass to handlersuser_data_free_func
- function for freeing @user_data or %NULL- Gibt zurück:
- an identifier (never 0) that can be used with g_bus_unown_name() to stop owning the name.
-
busOwnNameOnConnection
public static int busOwnNameOnConnection(@Nonnull DBusConnection connection, @Nonnull Str name, int flags, Gio.OnBusNameAcquiredCallback name_acquired_handler, Gio.OnBusNameLostCallback name_lost_handler, @Nullable Pointer user_data, Gio.OnDestroyNotify user_data_free_func) Like g_bus_own_name() but takes a #GDBusConnection instead of a
#GBusType.- Parameter:
connection
- a #GDBusConnectionname
- the well-known name to ownflags
- a set of flags from the #GBusNameOwnerFlags enumerationname_acquired_handler
- handler to invoke when @name is acquired or %NULLname_lost_handler
- handler to invoke when @name is lost or %NULLuser_data
- user data to pass to handlersuser_data_free_func
- function for freeing @user_data or %NULL- Gibt zurück:
- an identifier (never 0) that can be used with g_bus_unown_name() to stop owning the name
-
busOwnNameOnConnectionWithClosures
public static int busOwnNameOnConnectionWithClosures(@Nonnull DBusConnection connection, @Nonnull Str name, int flags, @Nullable Closure name_acquired_closure, @Nullable Closure name_lost_closure) Version of g_bus_own_name_on_connection() using closures instead of
callbacks for easier binding in other languages.- Parameter:
connection
- a #GDBusConnectionname
- the well-known name to ownflags
- a set of flags from the #GBusNameOwnerFlags enumerationname_acquired_closure
- #GClosure to invoke when @name is acquired or %NULLname_lost_closure
- #GClosure to invoke when @name is lost or %NULL- Gibt zurück:
- an identifier (never 0) that can be used with g_bus_unown_name() to stop owning the name.
-
busOwnNameWithClosures
public static int busOwnNameWithClosures(int bus_type, @Nonnull Str name, int flags, @Nullable Closure bus_acquired_closure, @Nullable Closure name_acquired_closure, @Nullable Closure name_lost_closure) Version of g_bus_own_name() using closures instead of callbacks for
easier binding in other languages.- Parameter:
bus_type
- the type of bus to own a name onname
- the well-known name to ownflags
- a set of flags from the #GBusNameOwnerFlags enumerationbus_acquired_closure
- #GClosure to invoke when connected to the bus of type @bus_type or %NULLname_acquired_closure
- #GClosure to invoke when @name is acquired or %NULLname_lost_closure
- #GClosure to invoke when @name is lost or %NULL- Gibt zurück:
- an identifier (never 0) that can be used with g_bus_unown_name() to stop owning the name.
-
busUnownName
public static void busUnownName(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 #GMainContext after
this function has returned. You should continue to iterate the #GMainContext
until the #GDestroyNotify function passed to g_bus_own_name() is called, in
order to avoid memory leaks through callbacks queued on the #GMainContext
after it’s stopped being iterated.- Parameter:
owner_id
- an identifier obtained from g_bus_own_name()
-
busUnwatchName
public static void busUnwatchName(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.- Parameter:
watcher_id
- An identifier obtained from g_bus_watch_name()
-
busWatchName
public static int busWatchName(int bus_type, @Nonnull Str name, int flags, Gio.OnBusNameAppearedCallback name_appeared_handler, Gio.OnBusNameVanishedCallback name_vanished_handler, @Nullable Pointer user_data, Gio.OnDestroyNotify user_data_free_func) Starts watching @name on the bus specified by @bus_type and calls
@name_appeared_handler and @name_vanished_handler when the name is
known to have an owner respectively known to lose its
owner. Callbacks will be invoked in the thread-default main context
(see [method@GLib.MainContext.push_thread_default])
of the thread you are calling this function from.
You are guaranteed that one of the handlers will be invoked after
calling this function. When you are done watching the name, just
call g_bus_unwatch_name() with the watcher id this function
returns.
If the name vanishes or appears (for example the application owning
the name could restart), the handlers are also invoked. If the
#GDBusConnection that is used for watching the name disconnects, then
@name_vanished_handler is invoked since it is no longer
possible to access the name.
Another guarantee is that invocations of @name_appeared_handler
and @name_vanished_handler are guaranteed to alternate; that
is, if @name_appeared_handler is invoked then you are
guaranteed that the next time one of the handlers is invoked, it
will be @name_vanished_handler. The reverse is also true.
This behavior makes it very simple to write applications that want
to take action when a certain [name exists](dbus-name-watching.html#d-bus-name-watching).
Basically, the application should create object proxies in
@name_appeared_handler and destroy them again (if any) in
@name_vanished_handler.- Parameter:
bus_type
- The type of bus to watch a name on.name
- The name (well-known or unique) to watch.flags
- Flags from the #GBusNameWatcherFlags enumeration.name_appeared_handler
- Handler to invoke when @name is known to exist or %NULL.name_vanished_handler
- Handler to invoke when @name is known to not exist or %NULL.user_data
- User data to pass to handlers.user_data_free_func
- Function for freeing @user_data or %NULL.- Gibt zurück:
- An identifier (never 0) that can be used with g_bus_unwatch_name() to stop watching the name.
-
busWatchNameOnConnection
public static int busWatchNameOnConnection(@Nonnull DBusConnection connection, @Nonnull Str name, int flags, Gio.OnBusNameAppearedCallback name_appeared_handler, Gio.OnBusNameVanishedCallback name_vanished_handler, @Nullable Pointer user_data, Gio.OnDestroyNotify user_data_free_func) Like g_bus_watch_name() but takes a #GDBusConnection instead of a
#GBusType.- Parameter:
connection
- A #GDBusConnection.name
- The name (well-known or unique) to watch.flags
- Flags from the #GBusNameWatcherFlags enumeration.name_appeared_handler
- Handler to invoke when @name is known to exist or %NULL.name_vanished_handler
- Handler to invoke when @name is known to not exist or %NULL.user_data
- User data to pass to handlers.user_data_free_func
- Function for freeing @user_data or %NULL.- Gibt zurück:
- An identifier (never 0) that can be used with g_bus_unwatch_name() to stop watching the name.
-
busWatchNameOnConnectionWithClosures
public static int busWatchNameOnConnectionWithClosures(@Nonnull DBusConnection connection, @Nonnull Str name, int flags, @Nullable Closure name_appeared_closure, @Nullable Closure name_vanished_closure) Version of g_bus_watch_name_on_connection() using closures instead of callbacks for
easier binding in other languages.- Parameter:
connection
- A #GDBusConnection.name
- The name (well-known or unique) to watch.flags
- Flags from the #GBusNameWatcherFlags enumeration.name_appeared_closure
- #GClosure to invoke when @name is known to exist or %NULL.name_vanished_closure
- #GClosure to invoke when @name is known to not exist or %NULL.- Gibt zurück:
- An identifier (never 0) that can be used with g_bus_unwatch_name() to stop watching the name.
-
busWatchNameWithClosures
public static int busWatchNameWithClosures(int bus_type, @Nonnull Str name, int flags, @Nullable Closure name_appeared_closure, @Nullable Closure name_vanished_closure) Version of g_bus_watch_name() using closures instead of callbacks for
easier binding in other languages.- Parameter:
bus_type
- The type of bus to watch a name on.name
- The name (well-known or unique) to watch.flags
- Flags from the #GBusNameWatcherFlags enumeration.name_appeared_closure
- #GClosure to invoke when @name is known to exist or %NULL.name_vanished_closure
- #GClosure to invoke when @name is known to not exist or %NULL.- Gibt zurück:
- An identifier (never 0) that can be used with g_bus_unwatch_name() to stop watching the name.
-
contentTypeCanBeExecutable
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).- Parameter:
type
- a content type string- Gibt zurück:
- %TRUE if the file type corresponds to a type that can be executable, %FALSE otherwise.
-
contentTypeEquals
Compares two content types for equality.- Parameter:
type1
- a content type stringtype2
- a content type string- Gibt zurück:
- %TRUE if the two strings are identical or equivalent, %FALSE otherwise.
-
contentTypeFromMimeType
Tries to find a content type based on the mime type name.- Parameter:
mime_type
- a mime type string- Gibt zurück:
- Newly allocated string with content type or %NULL. Free with g_free()
-
contentTypeGetDescription
Gets the human readable description of the content type.- Parameter:
type
- a content type string- Gibt zurück:
- a short description of the content type @type. Free the returned string with g_free()
-
contentTypeGetGenericIconName
Gets the generic icon name for a content type.
See the
[shared-mime-info](http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec)
specification for more on the generic icon name.- Parameter:
type
- a content type string- Gibt zurück:
- the registered generic icon name for the given @type, or %NULL if unknown. Free with g_free()
-
contentTypeGetIcon
Gets the icon for a content type.- Parameter:
type
- a content type string- Gibt zurück:
- #GIcon corresponding to the content type. Free the returned object with g_object_unref()
-
contentTypeGetMimeType
Gets the mime type for the content type, if one is registered.- Parameter:
type
- a content type string- Gibt zurück:
- the registered mime type for the given @type, or %NULL if unknown; free with g_free().
-
contentTypeGetSymbolicIcon
Gets the symbolic icon for a content type.- Parameter:
type
- a content type string- Gibt zurück:
- symbolic #GIcon corresponding to the content type. Free the returned object with g_object_unref()
-
contentTypeIsA
Determines if @type is a subset of @supertype.- Parameter:
type
- a content type stringsupertype
- a content type string- Gibt zurück:
- %TRUE if @type is a kind of @supertype, %FALSE otherwise.
-
contentTypeIsMimeType
Determines if @type is a subset of @mime_type.
Convenience wrapper around g_content_type_is_a().- Parameter:
type
- a content type stringmime_type
- a mime type string- Gibt zurück:
- %TRUE if @type is a kind of @mime_type, %FALSE otherwise.
-
contentTypeIsUnknown
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.- Parameter:
type
- a content type string- Gibt zurück:
- %TRUE if the type is the unknown type.
-
contentTypesGetRegistered
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)`.- Gibt zurück:
- list of the registered content types
-
dbusAddressEscapeValue
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`.- Parameter:
string
- an unescaped string to be included in a D-Bus address as the value in a key-value pair- Gibt zurück:
- a copy of @string with all non-optionally-escaped bytes escaped
-
dbusAddressGetForBusSync
public static Str dbusAddressGetForBusSync(int bus_type, @Nullable Cancellable cancellable) throws AllocationError 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](https://dbus.freedesktop.org/doc/dbus-specification.html#addresses).- Parameter:
bus_type
- a #GBusTypecancellable
- a #GCancellable or %NULL- Gibt zurück:
- a valid D-Bus address string for @bus_type or %NULL if @error is set
- Löst aus:
AllocationError
-
dbusAddressGetStream
public static void dbusAddressGetStream(@Nonnull Str address, @Nullable Cancellable cancellable, Gio.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Asynchronously connects to an endpoint specified by @address and
sets up the connection so it is in a state to run the client-side
of the D-Bus authentication conversation. @address must be in the
[D-Bus address format](https://dbus.freedesktop.org/doc/dbus-specification.html#addresses).
When the operation is finished, @callback will be invoked. You can
then call g_dbus_address_get_stream_finish() to get the result of
the operation.
This is an asynchronous failable function. See
g_dbus_address_get_stream_sync() for the synchronous version.- Parameter:
address
- A valid D-Bus address.cancellable
- A #GCancellable or %NULL.callback
- A #GAsyncReadyCallback to call when the request is satisfied.user_data
- Data to pass to @callback.
-
dbusErrorEncodeGerror
Creates a D-Bus error name to use for @error. If @error matches
a registered error (cf. g_dbus_error_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 #GError using g_dbus_error_new_for_dbus_error().
This function is typically only used in object mappings to put a
#GError on the wire. Regular applications should not use it.- Parameter:
error
- A #GError.- Gibt zurück:
- A D-Bus error name (never %NULL). Free with g_free().
-
dbusErrorGetRemoteError
Gets the D-Bus error name used for @error, if any.
This function is guaranteed to return a D-Bus error name for all
#GErrors returned from functions handling remote method calls
(e.g. g_dbus_connection_call_finish()) unless
g_dbus_error_strip_remote_error() has been used on @error.- Parameter:
error
- a #GError- Gibt zurück:
- an allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
-
dbusErrorIsRemoteError
Checks if @error represents an error received via D-Bus from a remote peer. If so,
use g_dbus_error_get_remote_error() to get the name of the error.- Parameter:
error
- A #GError.- Gibt zurück:
- %TRUE if @error represents an error from a remote peer, %FALSE otherwise.
-
dbusErrorNewForDbusError
public static Error dbusErrorNewForDbusError(@Nonnull Str dbus_error_name, @Nonnull Str dbus_error_message) Creates a #GError based on the contents of @dbus_error_name and
@dbus_error_message.
Errors registered with g_dbus_error_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 g_dbus_error_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 g_dbus_error_encode_gerror()
the error domain and code encoded in the name is used to
create the #GError. Also, @dbus_error_name is added to the error message
such that it can be recovered with g_dbus_error_get_remote_error().
Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR
in the %G_IO_ERROR error domain is returned. Also, @dbus_error_name is
added to the error message such that it can be recovered with
g_dbus_error_get_remote_error().
In all three cases, @dbus_error_name can always be recovered from the
returned #GError using the g_dbus_error_get_remote_error() function
(unless g_dbus_error_strip_remote_error() hasn't been used on the returned error).
This function is typically only used in object mappings to prepare
#GError instances for applications. Regular applications should not use
it.- Parameter:
dbus_error_name
- D-Bus error name.dbus_error_message
- D-Bus error message.- Gibt zurück:
- An allocated #GError. Free with g_error_free().
-
dbusErrorQuark
public static int dbusErrorQuark()- Gibt zurück:
-
dbusErrorRegisterError
public static boolean dbusErrorRegisterError(int error_domain, int error_code, @Nonnull Str dbus_error_name) Creates an association to map between @dbus_error_name and
#GErrors specified by @error_domain and @error_code.
This is typically done in the routine that returns the #GQuark for
an error domain.- Parameter:
error_domain
- A #GQuark for an error domain.error_code
- An error code.dbus_error_name
- A D-Bus error name.- Gibt zurück:
- %TRUE if the association was created, %FALSE if it already exists.
-
dbusErrorStripRemoteError
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.- Parameter:
error
- A #GError.- Gibt zurück:
- %TRUE if information was stripped, %FALSE otherwise.
-
dbusErrorUnregisterError
public static boolean dbusErrorUnregisterError(int error_domain, int error_code, @Nonnull Str dbus_error_name) Destroys an association previously set up with g_dbus_error_register_error().- Parameter:
error_domain
- A #GQuark for an error domain.error_code
- An error code.dbus_error_name
- A D-Bus error name.- Gibt zurück:
- %TRUE if the association was destroyed, %FALSE if it wasn't found.
-
dbusEscapeObjectPath
This is a language binding friendly version of g_dbus_escape_object_path_bytestring().- Parameter:
s
- the string to escape- Gibt zurück:
- an escaped version of @s. Free with g_free().
-
dbusGenerateGuid
Generate a D-Bus GUID that can be used with
e.g. g_dbus_connection_new().
See the
[D-Bus specification](https://dbus.freedesktop.org/doc/dbus-specification.html#uuids)
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](https://datatracker.ietf.org/doc/html/rfc4122).- Gibt zurück:
- A valid D-Bus GUID. Free with g_free().
-
dbusGvalueToGvariant
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.- Parameter:
gvalue
- A #GValue to convert to a #GVarianttype
- A #GVariantType- Gibt zurück:
- A #GVariant (never floating) of #GVariantType @type holding the data from @gvalue or an empty #GVariant in case of failure. Free with g_variant_unref().
-
dbusGvariantToGvalue
Converts a #GVariant to a #GValue. If @value is floating, it is consumed.
The rules specified in the g_dbus_gvalue_to_gvariant() function are
used - this function is essentially its reverse form. So, a #GVariant
containing any basic or string array type will be converted to a #GValue
containing a basic value or string array. Any other #GVariant (handle,
variant, tuple, dict entry) will be converted to a #GValue containing that
#GVariant.
The conversion never fails - a valid #GValue is always returned in
@out_gvalue.- Parameter:
value
- A #GVariant.out_gvalue
- Return location pointing to a zero-filled (uninitialized) #GValue.
-
dbusIsAddress
Checks if @string is a
[D-Bus address](https://dbus.freedesktop.org/doc/dbus-specification.html#addresses).
This doesn't check if @string is actually supported by #GDBusServer
or #GDBusConnection - use g_dbus_is_supported_address() to do more
checks.- Parameter:
string
- A string.- Gibt zurück:
- %TRUE if @string is a valid D-Bus address, %FALSE otherwise.
-
dbusIsErrorName
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.- Parameter:
string
- The string to check.- Gibt zurück:
- %TRUE if valid, %FALSE otherwise.
-
dbusIsGuid
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.- Parameter:
string
- The string to check.- Gibt zurück:
- %TRUE if @string is a GUID, %FALSE otherwise.
-
dbusIsInterfaceName
Checks if @string is a valid D-Bus interface name.- Parameter:
string
- The string to check.- Gibt zurück:
- %TRUE if valid, %FALSE otherwise.
-
dbusIsMemberName
Checks if @string is a valid D-Bus member (e.g. signal or method) name.- Parameter:
string
- The string to check.- Gibt zurück:
- %TRUE if valid, %FALSE otherwise.
-
dbusIsName
Checks if @string is a valid D-Bus bus name (either unique or well-known).- Parameter:
string
- The string to check.- Gibt zurück:
- %TRUE if valid, %FALSE otherwise.
-
dbusIsSupportedAddress
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](https://dbus.freedesktop.org/doc/dbus-specification.html#addresses).- Parameter:
string
- A string.- Gibt zurück:
- %TRUE if @string is a valid D-Bus address that is supported by this library, %FALSE if @error is set.
- Löst aus:
AllocationError
-
dbusIsUniqueName
Checks if @string is a valid D-Bus unique bus name.- Parameter:
string
- The string to check.- Gibt zurück:
- %TRUE if valid, %FALSE otherwise.
-
dtlsClientConnectionNew
public static DtlsClientConnection dtlsClientConnectionNew(@Nonnull DatagramBased base_socket, @Nullable SocketConnectable server_identity) throws AllocationError Creates a new #GDtlsClientConnection wrapping @base_socket which is
assumed to communicate with the server identified by @server_identity.- Parameter:
base_socket
- the #GDatagramBased to wrapserver_identity
- the expected identity of the server- Gibt zurück:
- the new #GDtlsClientConnection, or %NULL on error
- Löst aus:
AllocationError
-
dtlsServerConnectionNew
public static DtlsServerConnection dtlsServerConnectionNew(@Nonnull DatagramBased base_socket, @Nullable TlsCertificate certificate) throws AllocationError Creates a new #GDtlsServerConnection wrapping @base_socket.- Parameter:
base_socket
- the #GDatagramBased to wrapcertificate
- the default server certificate, or %NULL- Gibt zurück:
- the new #GDtlsServerConnection, or %NULL on error
- Löst aus:
AllocationError
-
fileNewForCommandlineArg
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.- Parameter:
arg
- a command line string- Gibt zurück:
- a new #GFile. Free the returned object with g_object_unref().
-
fileNewForCommandlineArgAndCwd
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().- Parameter:
arg
- a command line stringcwd
- the current working directory of the commandline- Gibt zurück:
- a new #GFile
-
fileNewForPath
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.- Parameter:
path
- a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.- Gibt zurück:
- a new #GFile for the given @path. Free the returned object with g_object_unref().
-
fileNewForUri
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.- Parameter:
uri
- a UTF-8 string containing a URI- Gibt zurück:
- a new #GFile for the given @uri. Free the returned object with g_object_unref().
-
fileNewTmpAsync
public static void fileNewTmpAsync(@Nullable Str tmpl, int io_priority, @Nullable Cancellable cancellable, Gio.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Asynchronously opens a file in the preferred directory for temporary files
(as returned by g_get_tmp_dir()) as g_file_new_tmp().
@tmpl should be a string in the GLib file name encoding
containing a sequence of six 'X' characters, and containing no
directory components. If it is %NULL, a default template is used.- Parameter:
tmpl
- Template for the file name, as in g_file_open_tmp(), or %NULL for a default templateio_priority
- the [I/O priority](iface.AsyncResult.html#io-priority) of the requestcancellable
- optional #GCancellable object, %NULL to ignorecallback
- a #GAsyncReadyCallback to call when the request is doneuser_data
- data to pass to @callback
-
fileNewTmpDirAsync
public static void fileNewTmpDirAsync(@Nullable Str tmpl, int io_priority, @Nullable Cancellable cancellable, Gio.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Asynchronously creates a directory in the preferred directory for
temporary files (as returned by g_get_tmp_dir()) as g_dir_make_tmp().
@tmpl should be a string in the GLib file name encoding
containing a sequence of six 'X' characters, and containing no
directory components. If it is %NULL, a default template is used.- Parameter:
tmpl
- Template for the file name, as in g_dir_make_tmp(), or %NULL for a default templateio_priority
- the [I/O priority](iface.AsyncResult.html#io-priority) of the requestcancellable
- optional #GCancellable object, %NULL to ignorecallback
- a #GAsyncReadyCallback to call when the request is doneuser_data
- data to pass to @callback
-
fileNewTmpDirFinish
Finishes a temporary directory creation started by
g_file_new_tmp_dir_async().- Parameter:
result
- a #GAsyncResult- Gibt zurück:
- a new #GFile. Free the returned object with g_object_unref().
- Löst aus:
AllocationError
-
fileParseName
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.- Parameter:
parse_name
- a file name or path to be parsed- Gibt zurück:
- a new #GFile.
-
iconDeserialize
Deserializes a #GIcon previously serialized using g_icon_serialize().- Parameter:
value
- a #GVariant created with g_icon_serialize()- Gibt zurück:
- a #GIcon, or %NULL when deserialization fails.
-
iconNewForString
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().- Parameter:
str
- A string obtained via g_icon_to_string().- Gibt zurück:
- An object implementing the #GIcon interface or %NULL if @error is set.
- Löst aus:
AllocationError
-
ioErrorFromErrno
public static int ioErrorFromErrno(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`:
<!-- language="C" --> int saved_errno; ret = read (blah); saved_errno = errno; g_io_error_from_errno (saved_errno);
- Parameter:
err_no
- Error number as defined in errno.h.- Gibt zurück:
- #GIOErrorEnum value for the given `errno.h` error number
-
ioErrorFromFileError
public static int ioErrorFromFileError(int file_error) Converts #GFileError error codes into GIO error codes.- Parameter:
file_error
- a #GFileError.- Gibt zurück:
- #GIOErrorEnum value for the given #GFileError error value.
-
ioErrorQuark
public static int ioErrorQuark()Gets the GIO Error Quark.- Gibt zurück:
- a #GQuark.
-
ioExtensionPointImplement
public static ch.bailu.gtk.gio.IOExtension ioExtensionPointImplement(@Nonnull Str extension_point_name, long type, @Nonnull Str extension_name, int priority) Registers @type as extension for the extension point with name
@extension_point_name.
If @type has already been registered as an extension for this
extension point, the existing #GIOExtension object is returned.- Parameter:
extension_point_name
- the name of the extension pointtype
- the #GType to register as extensionextension_name
- the name for the extensionpriority
- the priority for the extension- Gibt zurück:
- a #GIOExtension object for #GType
-
ioExtensionPointLookup
Looks up an existing extension point.- Parameter:
name
- the name of the extension point- Gibt zurück:
- the #GIOExtensionPoint, or %NULL if there is no registered extension point with the given name.
-
ioExtensionPointRegister
Registers an extension point.- Parameter:
name
- The name of the extension point- Gibt zurück:
- the new #GIOExtensionPoint. This object is owned by GIO and should not be freed.
-
ioModulesLoadAllInDirectory
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.- Parameter:
dirname
- pathname for a directory containing modules to load.- Gibt zurück:
- 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().
-
ioModulesLoadAllInDirectoryWithScope
public static List ioModulesLoadAllInDirectoryWithScope(@Nonnull Str dirname, @Nonnull ch.bailu.gtk.gio.IOModuleScope 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.- Parameter:
dirname
- pathname for a directory containing modules to load.scope
- a scope to use when scanning the modules.- Gibt zurück:
- 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().
-
ioModulesScanAllInDirectory
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().- Parameter:
dirname
- pathname for a directory containing modules to scan.
-
ioModulesScanAllInDirectoryWithScope
public static void ioModulesScanAllInDirectoryWithScope(@Nonnull Str dirname, @Nonnull ch.bailu.gtk.gio.IOModuleScope 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().- Parameter:
dirname
- pathname for a directory containing modules to scan.scope
- a scope to use when scanning the modules
-
ioSchedulerCancelAllJobs
Veraltet.Cancels all cancellable I/O jobs.
A job is cancellable if a #GCancellable was passed into
g_io_scheduler_push_job(). -
ioSchedulerPushJob
@Deprecated public static void ioSchedulerPushJob(Gio.OnIOSchedulerJobFunc job_func, @Nullable Pointer user_data, Gio.OnDestroyNotify notify, int io_priority, @Nullable Cancellable cancellable) Veraltet.Schedules the I/O job to run in another thread.
@notify will be called on @user_data after @job_func has returned,
regardless whether the job was cancelled or has run to completion.
If @cancellable is not %NULL, it can be used to cancel the I/O job
by calling g_cancellable_cancel() or by calling
g_io_scheduler_cancel_all_jobs().- Parameter:
job_func
- a #GIOSchedulerJobFunc.user_data
- data to pass to @job_funcnotify
- a #GDestroyNotify for @user_data, or %NULLio_priority
- the [I/O priority](iface.AsyncResult.html#io-priority) of the request.cancellable
- optional #GCancellable object, %NULL to ignore.
-
keyfileSettingsBackendNew
public static SettingsBackend keyfileSettingsBackendNew(@Nonnull Str filename, @Nonnull Str root_path, @Nullable Str 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.- Parameter:
filename
- the filename of the keyfileroot_path
- the path under which all settings keys appearroot_group
- the group name corresponding to @root_path, or `NULL` to disallow storing keys directly beneath @root_path- Gibt zurück:
- a keyfile-backed [class@Gio.SettingsBackend]
-
memoryMonitorDupDefault
Gets a reference to the default #GMemoryMonitor for the system.- Gibt zurück:
- a new reference to the default #GMemoryMonitor
-
memorySettingsBackendNew
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.- Gibt zurück:
- a newly created #GSettingsBackend
-
networkMonitorGetDefault
Gets the default #GNetworkMonitor for the system.- Gibt zurück:
- a #GNetworkMonitor, which will be a dummy object if no network monitor is available
-
networkingInit
public static void networkingInit()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). -
nullSettingsBackendNew
Creates a readonly #GSettingsBackend.
This backend does not allow changes to settings, so all settings
will always have their default values.- Gibt zurück:
- a newly created #GSettingsBackend
-
pollableSourceNew
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.- Parameter:
pollable_stream
- the stream associated with the new source- Gibt zurück:
- the new #GSource.
-
pollableSourceNewFull
public static Source pollableSourceNewFull(@Nonnull Pointer pollable_stream, @Nullable Source child_source, @Nullable Cancellable 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.- Parameter:
pollable_stream
- the stream associated with the new sourcechild_source
- optional child source to attachcancellable
- optional #GCancellable to attach- Gibt zurück:
- the new #GSource.
-
pollableStreamRead
public static long pollableStreamRead(@Nonnull InputStream stream, @Nonnull Pointer buffer, long count, boolean blocking, @Nullable Cancellable cancellable) throws AllocationError Tries to read from @stream, as with g_input_stream_read() (if
@blocking is %TRUE) or g_pollable_input_stream_read_nonblocking()
(if @blocking is %FALSE). This can be used to more easily share
code between blocking and non-blocking implementations of a method.
If @blocking is %FALSE, then @stream must be a
#GPollableInputStream for which g_pollable_input_stream_can_poll()
returns %TRUE, or else the behavior is undefined. If @blocking is
%TRUE, then @stream does not need to be a #GPollableInputStream.- Parameter:
stream
- a #GInputStreambuffer
- a buffer to read data intocount
- the number of bytes to readblocking
- whether to do blocking I/Ocancellable
- optional #GCancellable object, %NULL to ignore.- Gibt zurück:
- the number of bytes read, or -1 on error.
- Löst aus:
AllocationError
-
pollableStreamWrite
public static long pollableStreamWrite(@Nonnull OutputStream stream, @Nonnull Pointer buffer, long count, boolean blocking, @Nullable Cancellable cancellable) throws AllocationError Tries to write to @stream, as with g_output_stream_write() (if
@blocking is %TRUE) or g_pollable_output_stream_write_nonblocking()
(if @blocking is %FALSE). This can be used to more easily share
code between blocking and non-blocking implementations of a method.
If @blocking is %FALSE, then @stream must be a
#GPollableOutputStream for which
g_pollable_output_stream_can_poll() returns %TRUE or else the
behavior is undefined. If @blocking is %TRUE, then @stream does not
need to be a #GPollableOutputStream.- Parameter:
stream
- a #GOutputStream.buffer
- the buffer containing the data to write.count
- the number of bytes to writeblocking
- whether to do blocking I/Ocancellable
- optional #GCancellable object, %NULL to ignore.- Gibt zurück:
- the number of bytes written, or -1 on error.
- Löst aus:
AllocationError
-
pollableStreamWriteAll
public static boolean pollableStreamWriteAll(@Nonnull OutputStream stream, @Nonnull Pointer buffer, long count, boolean blocking, @Nonnull Int64 bytes_written, @Nullable Cancellable cancellable) throws AllocationError Tries to write @count bytes to @stream, as with
g_output_stream_write_all(), but using g_pollable_stream_write()
rather than g_output_stream_write().
On a successful write of @count bytes, %TRUE is returned, and
@bytes_written is set to @count.
If there is an error during the operation (including
%G_IO_ERROR_WOULD_BLOCK in the non-blocking case), %FALSE is
returned and @error is set to indicate the error status,
@bytes_written is updated to contain the number of bytes written
into the stream before the error occurred.
As with g_pollable_stream_write(), if @blocking is %FALSE, then
@stream must be a #GPollableOutputStream for which
g_pollable_output_stream_can_poll() returns %TRUE or else the
behavior is undefined. If @blocking is %TRUE, then @stream does not
need to be a #GPollableOutputStream.- Parameter:
stream
- a #GOutputStream.buffer
- the buffer containing the data to write.count
- the number of bytes to writeblocking
- whether to do blocking I/Obytes_written
- location to store the number of bytes that was written to the streamcancellable
- optional #GCancellable object, %NULL to ignore.- Gibt zurück:
- %TRUE on success, %FALSE if there was an error
- Löst aus:
AllocationError
-
powerProfileMonitorDupDefault
Gets a reference to the default #GPowerProfileMonitor for the system.- Gibt zurück:
- a new reference to the default #GPowerProfileMonitor
-
proxyGetDefaultForProtocol
Find the `gio-proxy` extension point for a proxy implementation that supports
the specified protocol.- Parameter:
protocol
- the proxy protocol name (e.g. http, socks, etc)- Gibt zurück:
- return a #GProxy or NULL if protocol is not supported.
-
proxyResolverGetDefault
Gets the default #GProxyResolver for the system.- Gibt zurück:
- the default #GProxyResolver, which will be a dummy object if no proxy resolver is available
-
resolverErrorQuark
public static int resolverErrorQuark()Gets the #GResolver Error Quark.- Gibt zurück:
- a #GQuark.
-
resourceErrorQuark
public static int resourceErrorQuark()Gets the [struct@Gio.Resource] Error Quark.- Gibt zurück:
- a [type@GLib.Quark]
-
resourceLoad
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.- Parameter:
filename
- the path of a filename to load, in the GLib filename encoding- Gibt zurück:
- a new [struct@Gio.Resource], or `NULL` on error
- Löst aus:
AllocationError
-
resourcesEnumerateChildren
public static Strs resourcesEnumerateChildren(@Nonnull Str path, int lookup_flags) throws AllocationError 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.- Parameter:
path
- A path name inside the resourcelookup_flags
- A [flags@Gio.ResourceLookupFlags]- Gibt zurück:
- an array of constant strings
- Löst aus:
AllocationError
-
resourcesGetInfo
public static boolean resourcesGetInfo(@Nonnull Str path, int lookup_flags, @Nullable Int64 size, @Nullable Int flags) throws AllocationError Looks for a file at the specified @path in the set of
globally registered resources and if found returns information about it.
@lookup_flags controls the behaviour of the lookup.- Parameter:
path
- A path name inside the resourcelookup_flags
- A [flags@Gio.ResourceLookupFlags]size
- a location to place the length of the contents of the file, or `NULL` if the length is not neededflags
- a location to place the [flags@Gio.ResourceFlags] about the file, or `NULL` if the flags are not needed- Gibt zurück:
- `TRUE` if the file was found, `FALSE` if there were errors
- Löst aus:
AllocationError
-
resourcesHasChildren
Returns whether the specified @path in the set of
globally registered resources has children.- Parameter:
path
- A pathname- Gibt zurück:
- %TRUE if @patch has children
-
resourcesLookupData
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.- Parameter:
path
- A path name inside the resourcelookup_flags
- A [flags@Gio.ResourceLookupFlags]- Gibt zurück:
- [struct@GLib.Bytes] or `NULL` on error
- Löst aus:
AllocationError
-
resourcesOpenStream
public static InputStream resourcesOpenStream(@Nonnull Str path, int lookup_flags) throws AllocationError 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.- Parameter:
path
- A path name inside the resourcelookup_flags
- A [flags@Gio.ResourceLookupFlags]- Gibt zurück:
- [class@Gio.InputStream] or `NULL` on error
- Löst aus:
AllocationError
-
resourcesRegister
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].- Parameter:
resource
- A [struct@Gio.Resource]
-
resourcesUnregister
Unregisters the resource from the process-global set of resources.- Parameter:
resource
- A [struct@Gio.Resource]
-
settingsSchemaSourceGetDefault
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.- Gibt zurück:
- the default schema source
-
simpleAsyncReportErrorInIdle
@Deprecated public static void simpleAsyncReportErrorInIdle(@Nullable Object object, Gio.OnAsyncReadyCallback callback, @Nullable Pointer user_data, int domain, int code, @Nonnull Str format, Object... _ellipsis) Veraltet.Reports an error in an asynchronous function in an idle function by
directly setting the contents of the #GAsyncResult with the given error
information.- Parameter:
object
- a #GObject, or %NULL.callback
- a #GAsyncReadyCallback.user_data
- user data passed to @callback.domain
- a #GQuark containing the error domain (usually %G_IO_ERROR).code
- a specific error code.format
- a formatted error reporting string._ellipsis
- a list of variables to fill in @format.
-
simpleAsyncReportGerrorInIdle
@Deprecated public static void simpleAsyncReportGerrorInIdle(@Nullable Object object, Gio.OnAsyncReadyCallback callback, @Nullable Pointer user_data, @Nonnull Error error) Veraltet.Reports an error in an idle function. Similar to
g_simple_async_report_error_in_idle(), but takes a #GError rather
than building a new one.- Parameter:
object
- a #GObject, or %NULLcallback
- a #GAsyncReadyCallback.user_data
- user data passed to @callback.error
- the #GError to report
-
simpleAsyncReportTakeGerrorInIdle
@Deprecated public static void simpleAsyncReportTakeGerrorInIdle(@Nullable Object object, Gio.OnAsyncReadyCallback callback, @Nullable Pointer user_data, @Nonnull Error error) Veraltet.Reports an error in an idle function. Similar to
g_simple_async_report_gerror_in_idle(), but takes over the caller's
ownership of @error, so the caller does not have to free it any more.- Parameter:
object
- a #GObject, or %NULLcallback
- a #GAsyncReadyCallback.user_data
- user data passed to @callback.error
- the #GError to report
-
srvTargetListSort
Sorts @targets in place according to the algorithm in RFC 2782.- Parameter:
targets
- a #GList of #GSrvTarget- Gibt zurück:
- the head of the sorted list.
-
tlsBackendGetDefault
Gets the default #GTlsBackend for the system.- Gibt zurück:
- a #GTlsBackend, which will be a dummy object if no TLS backend is available
-
tlsChannelBindingErrorQuark
public static int tlsChannelBindingErrorQuark()Gets the TLS channel binding error quark.- Gibt zurück:
- a #GQuark.
-
tlsClientConnectionNew
public static TlsClientConnection tlsClientConnectionNew(@Nonnull IOStream base_io_stream, @Nullable SocketConnectable server_identity) throws AllocationError 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.- Parameter:
base_io_stream
- the #GIOStream to wrapserver_identity
- the expected identity of the server- Gibt zurück:
- the new #GTlsClientConnection, or %NULL on error
- Löst aus:
AllocationError
-
tlsErrorQuark
public static int tlsErrorQuark()Gets the TLS error quark.- Gibt zurück:
- a #GQuark.
-
tlsFileDatabaseNew
Creates a new #GTlsFileDatabase which uses anchor certificate authorities
in @anchors to verify certificate chains.
The certificates in @anchors must be PEM encoded.- Parameter:
anchors
- filename of anchor certificate authorities.- Gibt zurück:
- the new #GTlsFileDatabase, or %NULL on error
- Löst aus:
AllocationError
-
tlsServerConnectionNew
public static TlsServerConnection tlsServerConnectionNew(@Nonnull IOStream base_io_stream, @Nullable TlsCertificate certificate) throws AllocationError 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.- Parameter:
base_io_stream
- the #GIOStream to wrapcertificate
- the default server certificate, or %NULL- Gibt zurück:
- the new #GTlsServerConnection, or %NULL on error
- Löst aus:
AllocationError
-
unixIsMountPathSystemInternal
Determines if @mount_path is considered an implementation of the
OS.
This is primarily used for hiding mountable and mounted volumes
that only are used in the OS and has little to no relevance to the
casual user.- Parameter:
mount_path
- a mount path, e.g. `/media/disk` or `/usr`- Gibt zurück:
- true if @mount_path is considered an implementation detail of the OS; false otherwise
-
unixIsSystemDevicePath
Determines if @device_path is considered a block device path which is only
used in implementation of the OS.
This is primarily used for hiding mounted volumes that are intended as APIs
for programs to read, and system administrators at a shell; rather than
something that should, for example, appear in a GUI. For example, the Linux
`/proc` filesystem.
The list of device paths considered ‘system’ ones may change over time.- Parameter:
device_path
- a device path, e.g. `/dev/loop0` or `nfsd`- Gibt zurück:
- true if @device_path is considered an implementation detail of the OS; false otherwise
-
unixIsSystemFsType
Determines if @fs_type is considered a type of file system which is only
used in implementation of the OS.
This is primarily used for hiding mounted volumes that are intended as APIs
for programs to read, and system administrators at a shell; rather than
something that should, for example, appear in a GUI. For example, the Linux
`/proc` filesystem.
The list of file system types considered ‘system’ ones may change over time.- Parameter:
fs_type
- a file system type, e.g. `procfs` or `tmpfs`- Gibt zurück:
- true if @fs_type is considered an implementation detail of the OS; false otherwise
-
unixMountCompare
@Deprecated public static int unixMountCompare(@Nonnull UnixMountEntry mount1, @Nonnull UnixMountEntry mount2) Veraltet.Compares two Unix mounts.- Parameter:
mount1
- first [struct@GioUnix.MountEntry] to comparemount2
- second [struct@GioUnix.MountEntry] to compare- Gibt zurück:
- `1`, `0` or `-1` if @mount1 is greater than, equal to, or less than @mount2, respectively
-
unixMountCopy
Veraltet.Makes a copy of @mount_entry.- Parameter:
mount_entry
- a [struct@GioUnix.MountEntry]- Gibt zurück:
- a new [struct@GioUnix.MountEntry]
-
unixMountEntriesChangedSince
public static boolean unixMountEntriesChangedSince(long time) Checks if the Unix mounts have changed since a given Unix time.
This can only work reliably if a [class@GioUnix.MountMonitor] is running in
the process, otherwise changes in the mount entries file (such as
`/proc/self/mountinfo` on Linux) cannot be detected and, as a result, this
function has to conservatively always return `TRUE`.
It is more efficient to use [signal@GioUnix.MountMonitor::mounts-changed] to
be signalled of changes to the mount entries, rather than polling using this
function. This function is more appropriate for infrequently determining
cache validity.- Parameter:
time
- a timestamp- Gibt zurück:
- true if the mounts have changed since @time; false otherwise Since 2.84
-
unixMountFree
Veraltet.Frees a Unix mount.- Parameter:
mount_entry
- a [struct@GioUnix.MountEntry]
-
unixMountGetDevicePath
Veraltet.Gets the device path for a Unix mount.- Parameter:
mount_entry
- a [struct@GioUnix.MountEntry]- Gibt zurück:
- a string containing the device path
-
unixMountGetFsType
Veraltet.Gets the filesystem type for the Unix mount.- Parameter:
mount_entry
- a [struct@GioUnix.MountEntry]- Gibt zurück:
- a string containing the file system type
-
unixMountGetMountPath
Veraltet.Gets the mount path for a Unix mount.- Parameter:
mount_entry
- a [struct@GioUnix.MountEntry] to get the mount path for- Gibt zurück:
- the mount path for @mount_entry
-
unixMountGetOptions
Veraltet.Gets a comma separated list of mount options for the Unix mount.
For example: `rw,relatime,seclabel,data=ordered`.
This is similar to [func@GioUnix.MountPoint.get_options], but it takes
a [struct@GioUnix.MountEntry] as an argument.- Parameter:
mount_entry
- a [struct@GioUnix.MountEntry]- Gibt zurück:
- a string containing the options, or `NULL` if not available.
-
unixMountGetRootPath
Veraltet.Gets the root of the mount within the filesystem. This is useful e.g. for
mounts created by bind operation, or btrfs subvolumes.
For example, the root path is equal to `/` for a mount created by
`mount /dev/sda1 /mnt/foo` and `/bar` for
`mount --bind /mnt/foo/bar /mnt/bar`.- Parameter:
mount_entry
- a [struct@GioUnix.MountEntry]- Gibt zurück:
- a string containing the root, or `NULL` if not supported
-
unixMountGuessCanEject
Veraltet.Guesses whether a Unix mount entry can be ejected.- Parameter:
mount_entry
- a [struct@GioUnix.MountEntry]- Gibt zurück:
- true if @mount_entry is deemed to be ejectable; false otherwise
-
unixMountGuessIcon
Veraltet.Guesses the icon of a Unix mount entry.- Parameter:
mount_entry
- a [struct@GioUnix.MountEntry]- Gibt zurück:
- a [iface@Gio.Icon]
-
unixMountGuessName
Veraltet.Guesses the name of a Unix mount entry.
The result is a translated string.- Parameter:
mount_entry
- a [struct@GioUnix.MountEntry]- Gibt zurück:
- a newly allocated translated string
-
unixMountGuessShouldDisplay
Veraltet.Guesses whether a Unix mount entry should be displayed in the UI.- Parameter:
mount_entry
- a [struct@GioUnix.MountEntry]- Gibt zurück:
- true if @mount_entry is deemed to be displayable; false otherwise
-
unixMountGuessSymbolicIcon
Veraltet.Guesses the symbolic icon of a Unix mount entry.- Parameter:
mount_entry
- a [struct@GioUnix.MountEntry]- Gibt zurück:
- a [iface@Gio.Icon]
-
unixMountIsReadonly
Veraltet.Checks if a Unix mount is mounted read only.- Parameter:
mount_entry
- a [struct@GioUnix.MountEntry]- Gibt zurück:
- true if @mount_entry is read only; false otherwise
-
unixMountIsSystemInternal
Veraltet.Checks if a Unix mount is a system mount.
This is the Boolean OR of
[func@GioUnix.is_system_fs_type], [func@GioUnix.is_system_device_path] and
[func@GioUnix.is_mount_path_system_internal] on @mount_entry’s properties.
The definition of what a ‘system’ mount entry is may change over time as new
file system types and device paths are ignored.- Parameter:
mount_entry
- a [struct@GioUnix.MountEntry]- Gibt zurück:
- true if the Unix mount is for a system path; false otherwise
-
unixMountPointsChangedSince
public static boolean unixMountPointsChangedSince(long time) Checks if the Unix mount points have changed since a given Unix time.
Unlike [func@GioUnix.mount_entries_changed_since], this function can work
reliably without a [class@GioUnix.MountMonitor] running, as it accesses the
static mount point information (such as `/etc/fstab` on Linux), which has a
valid modification time.
It is more efficient to use [signal@GioUnix.MountMonitor::mountpoints-changed]
to be signalled of changes to the mount points, rather than polling using
this function. This function is more appropriate for infrequently determining
cache validity.- Parameter:
time
- a timestamp- Gibt zurück:
- true if the mount points have changed since @time; false otherwise
-
unixMountsChangedSince
Veraltet.Checks if the Unix mounts have changed since a given Unix time.- Parameter:
time
- a timestamp- Gibt zurück:
- true if the mounts have changed since @time; false otherwise
-