| GIO Reference Manual | ||||
|---|---|---|---|---|
enum GAppInfoCreateFlags; GAppInfo; GAppInfoIface; GAppLaunchContext; GAppInfo* g_app_info_create_from_commandline (const char *commandline, const char *application_name, GAppInfoCreateFlags flags, GError **error); GAppInfo* g_app_info_dup (GAppInfo *appinfo); gboolean g_app_info_equal (GAppInfo *appinfo1, GAppInfo *appinfo2); const char* g_app_info_get_id (GAppInfo *appinfo); const char* g_app_info_get_name (GAppInfo *appinfo); const char* g_app_info_get_description (GAppInfo *appinfo); const char* g_app_info_get_executable (GAppInfo *appinfo); GIcon* g_app_info_get_icon (GAppInfo *appinfo); gboolean g_app_info_launch (GAppInfo *appinfo, GList *files, GAppLaunchContext *launch_context, GError **error); gboolean g_app_info_supports_uris (GAppInfo *appinfo); gboolean g_app_info_launch_uris (GAppInfo *appinfo, GList *uris, GAppLaunchContext *launch_context, GError **error); gboolean g_app_info_should_show (GAppInfo *appinfo, const char *desktop_env); gboolean g_app_info_set_as_default_for_type (GAppInfo *appinfo, const char *content_type, GError **error); gboolean g_app_info_set_as_default_for_extension (GAppInfo *appinfo, const char *extension, GError **error); gboolean g_app_info_add_supports_type (GAppInfo *appinfo, const char *content_type, GError **error); gboolean g_app_info_can_remove_supports_type (GAppInfo *appinfo); gboolean g_app_info_remove_supports_type (GAppInfo *appinfo, const char *content_type, GError **error); GList* g_app_info_get_all (void); GList* g_app_info_get_all_for_type (const char *content_type); GAppInfo* g_app_info_get_default_for_type (const char *content_type, gboolean must_support_uris); GAppInfo* g_app_info_get_default_for_uri_scheme (const char *uri_scheme); char* g_app_launch_context_get_display (GAppLaunchContext *context, GAppInfo *info, GList *files); char* g_app_launch_context_get_startup_notify_id (GAppLaunchContext *context, GAppInfo *info, GList *files); GType g_app_launch_context_get_type (void); void g_app_launch_context_launch_failed (GAppLaunchContext *context, const char *startup_notify_id); GAppLaunchContext* g_app_launch_context_new (void);
typedef enum {
G_APP_INFO_CREATE_FLAGS_NONE = 0,
G_APP_INFO_CREATE_NEEDS_TERMINAL = (1<<0)
} GAppInfoCreateFlags;
typedef struct {
GTypeInterface g_iface;
/* Virtual Table */
GAppInfo * (*dup) (GAppInfo *appinfo);
gboolean (*equal) (GAppInfo *appinfo1,
GAppInfo *appinfo2);
const char * (*get_id) (GAppInfo *appinfo);
const char * (*get_name) (GAppInfo *appinfo);
const char * (*get_description) (GAppInfo *appinfo);
const char * (*get_executable) (GAppInfo *appinfo);
GIcon * (*get_icon) (GAppInfo *appinfo);
gboolean (*launch) (GAppInfo *appinfo,
GList *filenames,
GAppLaunchContext *launch_context,
GError **error);
gboolean (*supports_uris) (GAppInfo *appinfo);
gboolean (*launch_uris) (GAppInfo *appinfo,
GList *uris,
GAppLaunchContext *launch_context,
GError **error);
gboolean (*should_show) (GAppInfo *appinfo,
const char *desktop_env);
gboolean (*supports_xdg_startup_notify) (GAppInfo *appinfo);
/* For changing associations */
gboolean (*set_as_default_for_type) (GAppInfo *appinfo,
const char *content_type,
GError **error);
gboolean (*set_as_default_for_extension) (GAppInfo *appinfo,
const char *extension,
GError **error);
gboolean (*add_supports_type) (GAppInfo *appinfo,
const char *content_type,
GError **error);
gboolean (*can_remove_supports_type) (GAppInfo *appinfo);
gboolean (*remove_supports_type) (GAppInfo *appinfo,
const char *content_type,
GError **error);
/* Padding for future expansion */
void (*_g_reserved1) (void);
void (*_g_reserved2) (void);
void (*_g_reserved3) (void);
void (*_g_reserved4) (void);
void (*_g_reserved5) (void);
void (*_g_reserved6) (void);
void (*_g_reserved7) (void);
void (*_g_reserved8) (void);
void (*_g_reserved9) (void);
void (*_g_reserved10) (void);
} GAppInfoIface;
typedef struct {
GObject parent_instance;
GAppLaunchContextPrivate *priv;
} GAppLaunchContext;
GAppInfo* g_app_info_create_from_commandline (const char *commandline, const char *application_name, GAppInfoCreateFlags flags, GError **error);
GAppInfo* g_app_info_dup (GAppInfo *appinfo);
|
a GAppInfo. |
Returns : |
a duplicate of appinfo.
|
const char* g_app_info_get_id (GAppInfo *appinfo);
|
a GAppInfo. |
Returns : |
const char* g_app_info_get_name (GAppInfo *appinfo);
|
a GAppInfo. |
Returns : |
the name of the application for appinfo.
|
const char* g_app_info_get_description (GAppInfo *appinfo);
|
a GAppInfo. |
Returns : |
a string containing a description of the
application appinfo.
The returned string should be not freed when no longer needed.
|
const char* g_app_info_get_executable (GAppInfo *appinfo);
|
a GAppInfo. |
Returns : |
a string containing the appinfo's application
binary's name.
|
gboolean g_app_info_launch (GAppInfo *appinfo, GList *files, GAppLaunchContext *launch_context, GError **error);
|
a GAppInfo. |
|
a GList of GFile objects. |
|
a GAppLaunchContext. |
|
a GError. |
Returns : |
TRUE on successful launch.
|
gboolean g_app_info_supports_uris (GAppInfo *appinfo);
|
a GAppInfo. |
Returns : |
TRUE if the appinfo supports URIs.
|
gboolean g_app_info_launch_uris (GAppInfo *appinfo, GList *uris, GAppLaunchContext *launch_context, GError **error);
|
a GAppInfo. |
|
a GList containing URIs to launch. |
|
a GAppLaunchContext. |
|
a GError. |
Returns : |
TRUE if the appinfo was launched
with the given uris.
|
gboolean g_app_info_should_show (GAppInfo *appinfo, const char *desktop_env);
|
a GAppInfo. |
|
a string. |
Returns : |
TRUE if the GAppInfo should be shown,
FALSE otherwise.
|
gboolean g_app_info_set_as_default_for_type (GAppInfo *appinfo, const char *content_type, GError **error);
|
a GAppInfo. |
|
the content type. |
|
a GError. |
Returns : |
TRUE if the given appinfo is the default
for the given content_type. FALSE if not,
or in case of an error.
|
gboolean g_app_info_set_as_default_for_extension
(GAppInfo *appinfo,
const char *extension,
GError **error);
|
a GAppInfo. |
|
a string containing the file extension. |
|
a GError. |
Returns : |
TRUE if the given appinfo is the default
for the given extension. FALSE if not,
or in case of an error.
|
gboolean g_app_info_add_supports_type (GAppInfo *appinfo, const char *content_type, GError **error);
|
a GAppInfo. |
|
a string. |
|
a GError. |
Returns : |
TRUE if appinfo supports content_type.
FALSE if not, or in case of an error.
|
gboolean g_app_info_can_remove_supports_type (GAppInfo *appinfo);
|
|
Returns : |
gboolean g_app_info_remove_supports_type (GAppInfo *appinfo, const char *content_type, GError **error);
|
a GAppInfo. |
|
a string. |
|
a GError. |
Returns : |
TRUE if content_type support was removed
from appinfo. FALSE if not.
|
GList* g_app_info_get_all_for_type (const char *content_type);
|
|
Returns : |
GList of GAppInfo s for given content_type.
|
GAppInfo* g_app_info_get_default_for_type (const char *content_type, gboolean must_support_uris);
GAppInfo* g_app_info_get_default_for_uri_scheme (const char *uri_scheme);
|
|
Returns : |
GAppInfo |
char* g_app_launch_context_get_display (GAppLaunchContext *context, GAppInfo *info, GList *files);
|
a GAppLaunchContext. |
|
a GAppInfo. |
|
a GList of files. |
Returns : |
char* g_app_launch_context_get_startup_notify_id
(GAppLaunchContext *context,
GAppInfo *info,
GList *files);
|
a GAppLaunchContext. |
|
|
|
|
Returns : |
void g_app_launch_context_launch_failed (GAppLaunchContext *context, const char *startup_notify_id);
|
|
|
GAppLaunchContext* g_app_launch_context_new (void);
Returns : |
A new GAppLaunchContext. |