2.4 <GAppInfo>

Interface: <GAppInfo>

Information about an installed application and methods to launch it (with file arguments).

<GAppInfo> and <GAppLaunchContext> are used for describing and launching applications installed on the system.

As of GLib 2.20, URIs will always be converted to POSIX paths (using file:get-path) when using app-info:launch? even if the application requested an URI and not a POSIX path. For example for a desktop-file based application with the following Exec key:

Exec=totem %U

and a single URI, sftp://foo/file.avi, then /home/user/.gvfs/sftp on foo/file.avi will be passed. This will only work if a set of suitable GIO extensions (such as GVfs 2.26 compiled with FUSE support), is available and operational; if this is not the case, the URI will be passed unmodified to the application. Some URIs, such as mailto:, of course cannot be mapped to a POSIX path (in GVfs there’s no FUSE mount for it); such URIs will be passed unmodified to the application.

Specifically for GVfs 2.26 and later, the POSIX URI will be mapped back to the GIO URI in the <GFile> constructors (since GVfs implements the GVfs extension point). As such, if the application needs to examine the URI, it needs to use file:get-uri or similar on <GFile>. In other words, an application cannot assume that the URI passed to e.g. file:new-for-commandline-arg is equal to the result of file:get-uri. The following snippet illustrates this:

GFile *f;
char *uri;

file = g_file_new_for_commandline_arg (uri_from_commandline);

uri = g_file_get_uri (file);
strcmp (uri, uri_from_commandline) == 0;
g_free (uri);

if (g_file_has_uri_scheme (file, "cdda"))
  {
    // do something special with uri
  }
g_object_unref (file);

This code will work when both cdda://sr0/Track 1.wav and /home/user/.gvfs/cdda on sr0/Track 1.wav is passed to the application. It should be noted that it’s generally not safe for applications to rely on the format of a particular URIs. Different launcher applications (e.g. file managers) may have different ideas of what a given URI means.

Procedures

Method: app-info:add-supports-type? self content-type ⇒ %return
Method: add-supports-type? self content-type ⇒ %return

Adds a content type to the application information to indicate the application is capable of opening files with the given content type.

self

Passed: a <GAppInfo>.

the app info

content-type

Passed: a string.

a string.

%return

Returned: a boolean.

TRUE on success, FALSE on error.

Method: app-info:can-delete? self ⇒ %return
Method: can-delete? self ⇒ %return

Obtains the information whether the <GAppInfo> can be deleted. See app-info:delete?.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a boolean.

TRUE if self can be deleted

Method: app-info:can-remove-supports-type? self ⇒ %return
Method: can-remove-supports-type? self ⇒ %return

Checks if a supported content type can be removed from an application.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a boolean.

TRUE if it is possible to remove supported content types from a given self, FALSE if not.

Procedure: app-info:create-from-commandline commandline application-name flags ⇒ %return

Creates a new <GAppInfo> from the given information.

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

commandline

Passed: a file name, as a string.

the command line to use

application-name

Passed: a string, or #f.

the application name, or NULL to use commandline

flags

Passed: a <GAppInfoCreateFlags>, or a list of its symbols, or one of them.

flags that can specify details of the created <GAppInfo>

%return

Returned: a <GAppInfo>.

new <GAppInfo> for given command.

Method: app-info:delete? self ⇒ %return
Method: delete? self ⇒ %return

Tries to delete a <GAppInfo>.

On some platforms, there may be a difference between user-defined <GAppInfo>s which can be deleted, and system-wide ones which cannot. See app-info:can-delete?.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a boolean.

TRUE if self has been deleted

Method: app-info:dup self ⇒ %return
Method: dup self ⇒ %return

Creates a duplicate of a <GAppInfo>.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a <GAppInfo>.

a duplicate of self.

Method: app-info:equal? self appinfo2 ⇒ %return
Method: equal? self appinfo2 ⇒ %return

Checks if two <GAppInfo>s are equal.

Note that the check may not compare each individual field, and only does an identity check. In case detecting changes in the contents is needed, program code must additionally compare relevant fields.

self

Passed: a <GAppInfo>.

the first <GAppInfo>.

appinfo2

Passed: a <GAppInfo>.

the second <GAppInfo>.

%return

Returned: a boolean.

TRUE if self is equal to appinfo2. FALSE otherwise.

Procedure: app-info:get-all ⇒ %return

Gets a list of all of the applications currently registered on this system.

For desktop files, this includes applications that have ‘NoDisplay=true‘ set or are excluded from display by means of ‘OnlyShowIn‘ or ‘NotShowIn‘. See app-info:should-show?.

The returned list does not include applications which have the ‘Hidden‘ key set.

%return

Returned: a list, each a <GAppInfo>.

a newly allocated list of references to <GAppInfo>s.

Procedure: app-info:get-all-for-type content-type ⇒ %return

Gets a list of all <GAppInfo>s for a given content type, including the recommended and fallback <GAppInfo>s. See app-info:get-recommended-for-type and app-info:get-fallback-for-type.

content-type

Passed: a string.

the content type to find a <GAppInfo> for

%return

Returned: a list, each a <GAppInfo>.

list of <GAppInfo>s for given content-type.

Method: app-info:get-commandline self ⇒ %return
Method: get-commandline self ⇒ %return

Gets the commandline with which the application will be started.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a file name, as a string, or #f.

a string containing the self’s commandline, or NULL if this information is not available

Procedure: app-info:get-default-for-type content-type must-support-uris ⇒ %return

Gets the default <GAppInfo> for a given content type.

content-type

Passed: a string.

the content type to find a <GAppInfo> for

must-support-uris

Passed: a boolean.

if TRUE, the <GAppInfo> is expected to support URIs

%return

Returned: a <GAppInfo>, or #f.

<GAppInfo> for given content-type or NULL on error.

Procedure: app-info:get-default-for-type-async content-type must-support-uris [cancellable] [callback]

Asynchronously gets the default <GAppInfo> for a given content type.

content-type

Passed: a string.

the content type to find a <GAppInfo> for

must-support-uris

Passed: a boolean.

if TRUE, the <GAppInfo> is expected to support URIs

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable>

callback

Passed, or left out: a procedure, or #f.

a GAsyncReadyCallback to call when the request is done

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

data to pass to callback

Procedure: app-info:get-default-for-type-finish result ⇒ %return

Finishes a default <GAppInfo> lookup started by app-info:get-default-for-type-async.

If no #<GAppInfo> is found, then error will be set to Gio.IOErrorEnum.NOT_FOUND.

result

Passed: a <GAsyncResult>.

the async result

%return

Returned: a <GAppInfo>.

<GAppInfo> for given content-type or NULL on error.

Procedure: app-info:get-default-for-uri-scheme uri-scheme ⇒ %return

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.

uri-scheme

Passed: a string.

a string containing a URI scheme.

%return

Returned: a <GAppInfo>, or #f.

<GAppInfo> for given uri-scheme or NULL on error.

Procedure: app-info:get-default-for-uri-scheme-async uri-scheme [cancellable] [callback]

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.

uri-scheme

Passed: a string.

a string containing a URI scheme.

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable>

callback

Passed, or left out: a procedure, or #f.

a GAsyncReadyCallback to call when the request is done

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

data to pass to callback

Procedure: app-info:get-default-for-uri-scheme-finish result ⇒ %return

Finishes a default <GAppInfo> lookup started by app-info:get-default-for-uri-scheme-async.

If no <GAppInfo> is found, then error will be set to Gio.IOErrorEnum.NOT_FOUND.

result

Passed: a <GAsyncResult>.

the async result

%return

Returned: a <GAppInfo>.

<GAppInfo> for given uri-scheme or NULL on error.

Method: app-info:get-description self ⇒ %return
Method: get-description self ⇒ %return

Gets a human-readable description of an installed application.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a string, or #f.

a string containing a description of the application self, or NULL if none.

Method: app-info:get-display-name self ⇒ %return
Method: get-display-name self ⇒ %return

Gets the display name of the application. The display name is often more descriptive to the user than the name itself.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a string.

the display name of the application for self, or the name if no display name is available.

Method: app-info:get-executable self ⇒ %return
Method: get-executable self ⇒ %return

Gets the executable’s name for the installed application.

This is intended to be used for debugging or labelling what program is going to be run. To launch the executable, use app-info:launch? and related functions, rather than spawning the return value from this function.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a file name, as a string.

a string containing the self’s application binaries name

Procedure: app-info:get-fallback-for-type content-type ⇒ %return

Gets a list of fallback <GAppInfo>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.

content-type

Passed: a string.

the content type to find a <GAppInfo> for

%return

Returned: a list, each a <GAppInfo>.

list of <GAppInfo>s for given content-type or NULL on error.

Method: app-info:get-icon self ⇒ %return
Method: get-icon self ⇒ %return

Gets the icon for the application.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a <GIcon>, or #f.

the default <GIcon> for self or NULL if there is no default icon.

Method: app-info:get-id self ⇒ %return
Method: get-id self ⇒ %return

Gets the ID of an application. An id is a string that identifies the application. The exact format of the id is platform dependent. For instance, on Unix this is the desktop file id from the xdg menu specification.

Note that the returned ID may be NULL, depending on how the self has been constructed.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a string, or #f.

a string containing the application’s ID.

Method: app-info:get-name self ⇒ %return
Method: get-name self ⇒ %return

Gets the installed name of the application.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a string.

the name of the application for self.

Procedure: app-info:get-recommended-for-type content-type ⇒ %return

Gets a list of recommended <GAppInfo>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 app-info:set-as-last-used-for-type? has been called.

content-type

Passed: a string.

the content type to find a <GAppInfo> for

%return

Returned: a list, each a <GAppInfo>.

list of <GAppInfo>s for given content-type or NULL on error.

Method: app-info:get-supported-types self ⇒ %return
Method: get-supported-types self ⇒ %return

Retrieves the list of content types that app-info claims to support. If this information is not provided by the environment, this function will return NULL.

This function does not take in consideration associations added with app-info:add-supports-type?, but only those exported directly by the application.

self

Passed: a <GAppInfo>.

an app info that can handle files

%return

Returned: a vector, each a string, or #f.

a list of content types.

Procedure: app-info:launch-default-for-uri-async uri [context] [cancellable] [callback]

Async version of app-info: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.

uri

Passed: a string.

the uri to show

context

Passed, or left out: a <GAppLaunchContext>, or #f.

optional launch context

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable>

callback

Passed, or left out: a procedure, or #f.

a GAsyncReadyCallback to call when the request is done

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

data to pass to callback

Procedure: app-info:launch-default-for-uri-finish? result ⇒ %return

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

result

Passed: a <GAsyncResult>.

the async result

%return

Returned: a boolean.

TRUE if the launch was successful, FALSE if error is set

Procedure: app-info:launch-default-for-uri? uri [context] ⇒ %return

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 app-info:launch-default-for-uri-async instead.

uri

Passed: a string.

the uri to show

context

Passed, or left out: a <GAppLaunchContext>, or #f.

optional launch context

%return

Returned: a boolean.

TRUE on success, FALSE on error.

Method: app-info:launch-uris-async self [uris] [context] [cancellable] [callback]
Method: launch-uris-async self [uris] [context] [cancellable] [callback]

Async version of app-info:launch-uris?.

The callback is invoked immediately after the application launch, but it waits for activation in case of D-Bus–activated applications and also provides extended error information for sandboxed applications, see notes for app-info:launch-default-for-uri-async.

self

Passed: a <GAppInfo>.

the app info

uris

Passed, or left out: a list, each a string, or #f.

a list of URIs to launch.

context

Passed, or left out: a <GAppLaunchContext>, or #f.

the launch context

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable>

callback

Passed, or left out: a procedure, or #f.

a GAsyncReadyCallback to call when the request is done

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

data to pass to callback

Method: app-info:launch-uris-finish? self result ⇒ %return
Method: launch-uris-finish? self result ⇒ %return

Finishes a app-info:launch-uris-async operation.

self

Passed: a <GAppInfo>.

the app info

result

Passed: a <GAsyncResult>.

the async result

%return

Returned: a boolean.

TRUE on successful launch, FALSE otherwise.

Method: app-info:launch-uris? self [uris] [context] ⇒ %return
Method: launch-uris? self [uris] [context] ⇒ %return

Launches the application. This passes the uris to the launched application as arguments, using the optional context to get information about the details of the launcher (like what screen it is on). On error, error will be set accordingly. If the application only supports one URI per invocation as part of their command-line, multiple instances of the application will be spawned.

To launch the application without arguments pass a NULL uris list.

Note that even if the launch is successful the application launched can fail to start if it runs into problems during startup. There is no way to detect this.

self

Passed: a <GAppInfo>.

the app info

uris

Passed, or left out: a list, each a string, or #f.

a list of URIs to launch.

context

Passed, or left out: a <GAppLaunchContext>, or #f.

the launch context

%return

Returned: a boolean.

TRUE on successful launch, FALSE otherwise.

Method: app-info:launch? self [files] [context] ⇒ %return
Method: launch? self [files] [context] ⇒ %return

Launches the application. Passes files to the launched application as arguments, using the optional context to get information about the details of the launcher (like what screen it is on). On error, error will be set accordingly.

To launch the application without arguments pass a NULL files list.

Note that even if the launch is successful the application launched can fail to start if it runs into problems during startup. There is no way to detect this.

Some URIs can be changed when passed through a GFile (for instance unsupported URIs with strange formats like mailto:), so if you have a textual URI you want to pass in as argument, consider using app-info:launch-uris? instead.

The launched application inherits the environment of the launching process, but it can be modified with app-launch-context:setenv and app-launch-context:unsetenv.

On UNIX, this function sets the GIO_LAUNCHED_DESKTOP_FILE environment variable with the path of the launched desktop file and GIO_LAUNCHED_DESKTOP_FILE_PID to the process id of the launched process. This can be used to ignore GIO_LAUNCHED_DESKTOP_FILE, should it be inherited by further processes. The DISPLAY, XDG_ACTIVATION_TOKEN and DESKTOP_STARTUP_ID environment variables are also set, based on information provided in context.

self

Passed: a <GAppInfo>.

the app info

files

Passed, or left out: a list, each a <GFile>, or #f.

a list of <GFile> objects

context

Passed, or left out: a <GAppLaunchContext>, or #f.

the launch context

%return

Returned: a boolean.

TRUE on successful launch, FALSE otherwise.

Method: app-info:remove-supports-type? self content-type ⇒ %return
Method: remove-supports-type? self content-type ⇒ %return

Removes a supported type from an application, if possible.

self

Passed: a <GAppInfo>.

the app info

content-type

Passed: a string.

a string.

%return

Returned: a boolean.

TRUE on success, FALSE on error.

Procedure: app-info:reset-type-associations content-type

Removes all changes to the type associations done by app-info:set-as-default-for-type?, app-info:set-as-default-for-extension?, app-info:add-supports-type? or app-info:remove-supports-type?.

content-type

Passed: a string.

a content type

Method: app-info:set-as-default-for-extension? self extension ⇒ %return
Method: set-as-default-for-extension? self extension ⇒ %return

Sets the application as the default handler for the given file extension.

self

Passed: a <GAppInfo>.

the app info

extension

Passed: a file name, as a string.

a string containing the file extension (without the dot).

%return

Returned: a boolean.

TRUE on success, FALSE on error.

Method: app-info:set-as-default-for-type? self content-type ⇒ %return
Method: set-as-default-for-type? self content-type ⇒ %return

Sets the application as the default handler for a given type.

self

Passed: a <GAppInfo>.

the app info

content-type

Passed: a string.

the content type.

%return

Returned: a boolean.

TRUE on success, FALSE on error.

Method: app-info:set-as-last-used-for-type? self content-type ⇒ %return
Method: set-as-last-used-for-type? self content-type ⇒ %return

Sets the application as the last used application for a given type. This will make the application appear as first in the list returned by app-info:get-recommended-for-type, regardless of the default application for that content type.

self

Passed: a <GAppInfo>.

the app info

content-type

Passed: a string.

the content type.

%return

Returned: a boolean.

TRUE on success, FALSE on error.

Method: app-info:should-show? self ⇒ %return
Method: should-show? self ⇒ %return

Checks if the application info should be shown in menus that list available applications.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a boolean.

TRUE if the self should be shown, FALSE otherwise.

Method: app-info:supports-files? self ⇒ %return
Method: supports-files? self ⇒ %return

Checks if the application accepts files as arguments.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a boolean.

TRUE if the self supports files.

Method: app-info:supports-uris? self ⇒ %return
Method: supports-uris? self ⇒ %return

Checks if the application supports reading files and directories from URIs.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a boolean.

TRUE if the self supports URIs.

Virtual methods

Virtual method: app-info:do-add-supports-type implementor self content-type ⇒ %return

Adds a content type to the application information to indicate the application is capable of opening files with the given content type.

To override it in a new class, give register-type #:vfuncs `((add-supports-type . ,procedure)). The procedure is called as (procedure self content-type) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

content-type

Passed: a string.

a string.

%return

Returned: a boolean.

TRUE on success, FALSE on error.

Virtual method: app-info:do-can-delete implementor self ⇒ %return

Obtains the information whether the <GAppInfo> can be deleted. See app-info:delete?.

To override it in a new class, give register-type #:vfuncs `((can-delete . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a boolean.

TRUE if self can be deleted

Virtual method: app-info:do-can-remove-supports-type implementor self ⇒ %return

Checks if a supported content type can be removed from an application.

To override it in a new class, give register-type #:vfuncs `((can-remove-supports-type . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a boolean.

TRUE if it is possible to remove supported content types from a given self, FALSE if not.

Virtual method: app-info:do-do-delete implementor self ⇒ %return

Tries to delete a <GAppInfo>.

On some platforms, there may be a difference between user-defined <GAppInfo>s which can be deleted, and system-wide ones which cannot. See app-info:can-delete?.

To override it in a new class, give register-type #:vfuncs `((do-delete . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a boolean.

TRUE if self has been deleted

Virtual method: app-info:do-dup implementor self ⇒ %return

Creates a duplicate of a <GAppInfo>.

To override it in a new class, give register-type #:vfuncs `((dup . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a <GAppInfo>.

a duplicate of self.

Virtual method: app-info:do-equal implementor self appinfo2 ⇒ %return

Checks if two <GAppInfo>s are equal.

Note that the check may not compare each individual field, and only does an identity check. In case detecting changes in the contents is needed, program code must additionally compare relevant fields.

To override it in a new class, give register-type #:vfuncs `((equal . ,procedure)). The procedure is called as (procedure self appinfo2) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the first <GAppInfo>.

appinfo2

Passed: a <GAppInfo>.

the second <GAppInfo>.

%return

Returned: a boolean.

TRUE if self is equal to appinfo2. FALSE otherwise.

Virtual method: app-info:do-get-commandline implementor self ⇒ %return

Gets the commandline with which the application will be started.

To override it in a new class, give register-type #:vfuncs `((get-commandline . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a file name, as a string, or #f.

a string containing the self’s commandline, or NULL if this information is not available

Virtual method: app-info:do-get-description implementor self ⇒ %return

Gets a human-readable description of an installed application.

To override it in a new class, give register-type #:vfuncs `((get-description . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a string, or #f.

a string containing a description of the application self, or NULL if none.

Virtual method: app-info:do-get-display-name implementor self ⇒ %return

Gets the display name of the application. The display name is often more descriptive to the user than the name itself.

To override it in a new class, give register-type #:vfuncs `((get-display-name . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a string.

the display name of the application for self, or the name if no display name is available.

Virtual method: app-info:do-get-executable implementor self ⇒ %return

Gets the executable’s name for the installed application.

This is intended to be used for debugging or labelling what program is going to be run. To launch the executable, use app-info:launch? and related functions, rather than spawning the return value from this function.

To override it in a new class, give register-type #:vfuncs `((get-executable . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a file name, as a string.

a string containing the self’s application binaries name

Virtual method: app-info:do-get-icon implementor self ⇒ %return

Gets the icon for the application.

To override it in a new class, give register-type #:vfuncs `((get-icon . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a <GIcon>, or #f.

the default <GIcon> for self or NULL if there is no default icon.

Virtual method: app-info:do-get-id implementor self ⇒ %return

Gets the ID of an application. An id is a string that identifies the application. The exact format of the id is platform dependent. For instance, on Unix this is the desktop file id from the xdg menu specification.

Note that the returned ID may be NULL, depending on how the self has been constructed.

To override it in a new class, give register-type #:vfuncs `((get-id . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a string, or #f.

a string containing the application’s ID.

Virtual method: app-info:do-get-name implementor self ⇒ %return

Gets the installed name of the application.

To override it in a new class, give register-type #:vfuncs `((get-name . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a string.

the name of the application for self.

Virtual method: app-info:do-get-supported-types implementor self ⇒ %return

Retrieves the list of content types that app-info claims to support. If this information is not provided by the environment, this function will return NULL.

This function does not take in consideration associations added with app-info:add-supports-type?, but only those exported directly by the application.

To override it in a new class, give register-type #:vfuncs `((get-supported-types . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

an app info that can handle files

%return

Returned: a vector, each a string, or #f.

a list of content types.

Virtual method: app-info:do-launch implementor self [files] [context] ⇒ %return

Launches the application. Passes files to the launched application as arguments, using the optional context to get information about the details of the launcher (like what screen it is on). On error, error will be set accordingly.

To launch the application without arguments pass a NULL files list.

Note that even if the launch is successful the application launched can fail to start if it runs into problems during startup. There is no way to detect this.

Some URIs can be changed when passed through a GFile (for instance unsupported URIs with strange formats like mailto:), so if you have a textual URI you want to pass in as argument, consider using app-info:launch-uris? instead.

The launched application inherits the environment of the launching process, but it can be modified with app-launch-context:setenv and app-launch-context:unsetenv.

On UNIX, this function sets the GIO_LAUNCHED_DESKTOP_FILE environment variable with the path of the launched desktop file and GIO_LAUNCHED_DESKTOP_FILE_PID to the process id of the launched process. This can be used to ignore GIO_LAUNCHED_DESKTOP_FILE, should it be inherited by further processes. The DISPLAY, XDG_ACTIVATION_TOKEN and DESKTOP_STARTUP_ID environment variables are also set, based on information provided in context.

To override it in a new class, give register-type #:vfuncs `((launch . ,procedure)). The procedure is called as (procedure self files context) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

files

Passed, or left out: a list, each a <GFile>, or #f.

a list of <GFile> objects

context

Passed, or left out: a <GAppLaunchContext>, or #f.

the launch context

%return

Returned: a boolean.

TRUE on successful launch, FALSE otherwise.

Virtual method: app-info:do-launch-uris implementor self [uris] [context] ⇒ %return

Launches the application. This passes the uris to the launched application as arguments, using the optional context to get information about the details of the launcher (like what screen it is on). On error, error will be set accordingly. If the application only supports one URI per invocation as part of their command-line, multiple instances of the application will be spawned.

To launch the application without arguments pass a NULL uris list.

Note that even if the launch is successful the application launched can fail to start if it runs into problems during startup. There is no way to detect this.

To override it in a new class, give register-type #:vfuncs `((launch-uris . ,procedure)). The procedure is called as (procedure self uris context) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

uris

Passed, or left out: a list, each a string, or #f.

a list of URIs to launch.

context

Passed, or left out: a <GAppLaunchContext>, or #f.

the launch context

%return

Returned: a boolean.

TRUE on successful launch, FALSE otherwise.

Virtual method: app-info:do-launch-uris-async implementor self [uris] [context] [cancellable] [callback]

Async version of app-info:launch-uris?.

The callback is invoked immediately after the application launch, but it waits for activation in case of D-Bus–activated applications and also provides extended error information for sandboxed applications, see notes for app-info:launch-default-for-uri-async.

To override it in a new class, give register-type #:vfuncs `((launch-uris-async . ,procedure)). The procedure is called as (procedure self uris context cancellable callback user-data).

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

uris

Passed, or left out: a list, each a string, or #f.

a list of URIs to launch.

context

Passed, or left out: a <GAppLaunchContext>, or #f.

the launch context

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable>

callback

Passed, or left out: a procedure, or #f.

a GAsyncReadyCallback to call when the request is done

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

data to pass to callback

Virtual method: app-info:do-launch-uris-finish implementor self result ⇒ %return

Finishes a app-info:launch-uris-async operation.

To override it in a new class, give register-type #:vfuncs `((launch-uris-finish . ,procedure)). The procedure is called as (procedure self result) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

result

Passed: a <GAsyncResult>.

the async result

%return

Returned: a boolean.

TRUE on successful launch, FALSE otherwise.

Virtual method: app-info:do-remove-supports-type implementor self content-type ⇒ %return

Removes a supported type from an application, if possible.

To override it in a new class, give register-type #:vfuncs `((remove-supports-type . ,procedure)). The procedure is called as (procedure self content-type) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

content-type

Passed: a string.

a string.

%return

Returned: a boolean.

TRUE on success, FALSE on error.

Virtual method: app-info:do-set-as-default-for-extension implementor self extension ⇒ %return

Sets the application as the default handler for the given file extension.

To override it in a new class, give register-type #:vfuncs `((set-as-default-for-extension . ,procedure)). The procedure is called as (procedure self extension) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

extension

Passed: a file name, as a string.

a string containing the file extension (without the dot).

%return

Returned: a boolean.

TRUE on success, FALSE on error.

Virtual method: app-info:do-set-as-default-for-type implementor self content-type ⇒ %return

Sets the application as the default handler for a given type.

To override it in a new class, give register-type #:vfuncs `((set-as-default-for-type . ,procedure)). The procedure is called as (procedure self content-type) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

content-type

Passed: a string.

the content type.

%return

Returned: a boolean.

TRUE on success, FALSE on error.

Virtual method: app-info:do-set-as-last-used-for-type implementor self content-type ⇒ %return

Sets the application as the last used application for a given type. This will make the application appear as first in the list returned by app-info:get-recommended-for-type, regardless of the default application for that content type.

To override it in a new class, give register-type #:vfuncs `((set-as-last-used-for-type . ,procedure)). The procedure is called as (procedure self content-type) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

content-type

Passed: a string.

the content type.

%return

Returned: a boolean.

TRUE on success, FALSE on error.

Virtual method: app-info:do-should-show implementor self ⇒ %return

Checks if the application info should be shown in menus that list available applications.

To override it in a new class, give register-type #:vfuncs `((should-show . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a boolean.

TRUE if the self should be shown, FALSE otherwise.

Virtual method: app-info:do-supports-files implementor self ⇒ %return

Checks if the application accepts files as arguments.

To override it in a new class, give register-type #:vfuncs `((supports-files . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a boolean.

TRUE if the self supports files.

Virtual method: app-info:do-supports-uris implementor self ⇒ %return

Checks if the application supports reading files and directories from URIs.

To override it in a new class, give register-type #:vfuncs `((supports-uris . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GAppInfo>, or its GType number.

self

Passed: a <GAppInfo>.

the app info

%return

Returned: a boolean.

TRUE if the self supports URIs.