Desktop file based GAppInfo

Desktop file based GAppInfo — Application information from desktop files

Synopsis


#include <gio/gdesktopappinfo.h>

                    GDesktopAppInfo;
GDesktopAppInfo*    g_desktop_app_info_new_from_filename
                                                        (const char *filename);
GDesktopAppInfo*    g_desktop_app_info_new              (const char *desktop_id);
gboolean            g_desktop_app_info_get_is_hidden    (GDesktopAppInfo *info);
void                g_desktop_app_info_set_desktop_env  (const char *desktop_env);
                    GDesktopAppInfoLookup;
#define             G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME
GAppInfo*           g_desktop_app_info_lookup_get_default_for_uri_scheme
                                                        (GDesktopAppInfoLookup *lookup,
                                                         const char *uri_scheme);

Object Hierarchy

  GObject
   +----GDesktopAppInfo

Implemented Interfaces

GDesktopAppInfo implements GAppInfo.

Description

GDesktopAppInfo is an implementation of GAppInfo based on desktop files.

Details

GDesktopAppInfo

typedef struct _GDesktopAppInfo GDesktopAppInfo;

Information about an installed application from a desktop file.


g_desktop_app_info_new_from_filename ()

GDesktopAppInfo*    g_desktop_app_info_new_from_filename
                                                        (const char *filename);

Creates a new GDesktopAppInfo.

filename :

a string containing a file name.

Returns :

a new GDesktopAppInfo or NULL on error.

g_desktop_app_info_new ()

GDesktopAppInfo*    g_desktop_app_info_new              (const char *desktop_id);

Creates a new GDesktopAppInfo.

desktop_id :

the desktop file id

Returns :

a new GDesktopAppInfo, or NULL if no desktop file with that id

g_desktop_app_info_get_is_hidden ()

gboolean            g_desktop_app_info_get_is_hidden    (GDesktopAppInfo *info);

A desktop file is hidden if the Hidden key in it is set to True.

info :

a GDesktopAppInfo.

Returns :

TRUE if hidden, FALSE otherwise.

g_desktop_app_info_set_desktop_env ()

void                g_desktop_app_info_set_desktop_env  (const char *desktop_env);

Sets the name of the desktop that the application is running in. This is used by g_app_info_should_show() to evaluate the OnlyShowIn and NotShowIn desktop entry fields.

The Desktop Menu specification recognizes the following:

GNOME
KDE
ROX
XFCE
Old

Should be called only once; subsequent calls are ignored.

desktop_env :

a string specifying what desktop this is

GDesktopAppInfoLookup

typedef struct _GDesktopAppInfoLookup GDesktopAppInfoLookup;

Interface that is used by backends to associate default handlers with URI schemes.


G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME

#define G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME "gio-desktop-app-info-lookup"

Extension point for default handler to URI association. See Extending GIO.


g_desktop_app_info_lookup_get_default_for_uri_scheme ()

GAppInfo*           g_desktop_app_info_lookup_get_default_for_uri_scheme
                                                        (GDesktopAppInfoLookup *lookup,
                                                         const char *uri_scheme);

Gets the default application for launching applications using this URI scheme for a particular GDesktopAppInfoLookup implementation.

The GDesktopAppInfoLookup interface and this function is used to implement g_app_info_get_default_for_uri_scheme() backends in a GIO module. There is no reason for applications to use it directly. Applications should use g_app_info_get_default_for_uri_scheme().

lookup :

a GDesktopAppInfoLookup

uri_scheme :

a string containing a URI scheme.

Returns :

GAppInfo for given uri_scheme or NULL on error.