Back to Seed Clases

Gio


Classes

Interfaces

Structs

Unions

Enums

Interface Gio.AppInfo

Import line: Gio = imports.gi.Gio;
GIR File: Gio-2.0.gir
C documentation: GAppInfo
Interface : AppInfo
Implementations: Gio.DesktopAppInfo
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 g_file_get_path()) when using g_app_info_launch() even if
the application requested an URI and not a POSIX path. For example
for an desktop-file based application with Exec key 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 g_file_get_uri() or
similar on GFile. In other words, an application cannot assume
that the URI passed to e.g. g_file_new_for_commandline_arg() is
equal to the result of g_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; // FALSE
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.
Properties
None
Methods / Constructors
Method / Constructor Defined By
Events
None
Used by These Methods / Signals / Properties
Class / Namespace Method / Signal / Properties
Gio
Method
Gio.app_info_create_from_commandline (String commandline, String application_name, AppInfoCreateFlags flags) : Gio.AppInfo
Creates a new GAppInfo from the given information.
Gio
Method
Gio.app_info_get_default_for_type (String content_type, gboolean must_support_uris) : Gio.AppInfo
Gets the GAppInfo that corresponds to a given content type.
Gio
Method
Gio.app_info_get_default_for_uri_scheme (String uri_scheme) : Gio.AppInfo
Gets the default application for launching applications
using this URI scheme.
Gio.AppLaunchContext
Method
get_display (AppInfo info, Array files) : String
Gets the display string for the context.
Gio.AppLaunchContext
Method
get_startup_notify_id (AppInfo info, Array files) : String
Initiates startup notification for the application and returns the
DESKTOP_STARTUP_ID for the launched operation,
if supported.
Gio.DesktopAppInfoLookup
Method
get_default_for_uri_scheme (String uri_scheme) : Gio.AppInfo
Gets the default application for launching applications
using this URI scheme for a particular GDesktopAppInfoLookup
implementation.
Gio.File
Method
query_default_handler (Cancellable cancellable) : Gio.AppInfo
Returns the GAppInfo that is registered as the default
application to handle the file specified by file.
Gtk.AppChooser
Method
get_app_info () : Gio.AppInfo
Returns the currently selected application.
Gtk.AppChooserWidget
Signal
application_activated (AppChooserWidget self, AppInfo application) : none
Emitted when an application item is activated from the widget's list.
Gtk.AppChooserWidget
Signal
application_selected (AppChooserWidget self, AppInfo application) : none
Emitted when an application item is selected from the widget's list.
Gtk.AppChooserWidget
Signal
populate_popup (AppChooserWidget self, Menu menu, AppInfo application) : none
Emitted when a context menu is about to popup over an application item.
Gtk.RecentInfo
Method
create_app_info (String app_name) : Gio.AppInfo
Creates a GAppInfo for the specified GtkRecentInfo
In case of error, error will be set either with a
GTK_RECENT_MANAGER_ERROR or a G_IO_ERROR
Documentation generated by Introspection Doc Generator Loosely Based on JsDoc Toolkit on Sat Apr 16 2011 17:11:20 GMT+0800 (HKT)