Package ch.bailu.gtk.gio
Class DesktopAppInfo
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gio.DesktopAppInfo
- All Implemented Interfaces:
PointerInterface
#GDesktopAppInfo is an implementation of #GAppInfo based on
desktop files.
Note that `<gio/gdesktopappinfo.h>` belongs to the UNIX-specific
GIO interfaces, thus you have to use the `gio-unix-2.0.pc` pkg-config
file when using it.
desktop files.
Note that `<gio/gdesktopappinfo.h>` belongs to the UNIX-specific
GIO interfaces, thus you have to use the `gio-unix-2.0.pc` pkg-config
file when using it.
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
ConstructorDescriptionDesktopAppInfo
(PointerContainer pointer) DesktopAppInfo
(Str desktop_id) Creates a new #GDesktopAppInfo based on a desktop file id.DesktopAppInfo
(String desktop_id) Creates a new #GDesktopAppInfo based on a desktop file id. -
Method Summary
Modifier and TypeMethodDescriptionImplements interfaceAppInfo
.getActionName
(Str action_name) Gets the user-visible display name of the "additional application
action" specified by @action_name.getActionName
(String action_name) Gets the user-visible display name of the "additional application
action" specified by @action_name.boolean
getBoolean
(Str key) Looks up a boolean value in the keyfile backing @info.boolean
getBoolean
(String key) Looks up a boolean value in the keyfile backing @info.Gets the categories from the desktop file.static ClassHandler
When @info was created from a known filename, return it.Gets the generic name from the desktop file.static List
getImplementations
(Str _interface) Gets all applications that implement @interface.static int
boolean
A desktop file is hidden if the Hidden key in it is
set to True.Gets the keywords from the desktop file.getLocaleString
(Str key) Looks up a localized string value in the keyfile backing @info
translated to the current locale.getLocaleString
(String key) Looks up a localized string value in the keyfile backing @info
translated to the current locale.boolean
Gets the value of the NoDisplay key, which helps determine if the
application info should be shown in menus.static long
static TypeSystem.TypeSize
boolean
Checks if the application info should be shown in menus that list available
applications for a specific name of the desktop, based on the
`OnlyShowIn` and `NotShowIn` keys.boolean
Checks if the application info should be shown in menus that list available
applications for a specific name of the desktop, based on the
`OnlyShowIn` and `NotShowIn` keys.Retrieves the StartupWMClass field from @info.Looks up a string value in the keyfile backing @info.Looks up a string value in the keyfile backing @info.static long
static TypeSystem.TypeSize
boolean
Returns whether @key exists in the "Desktop Entry" group
of the keyfile backing @info.boolean
Returns whether @key exists in the "Desktop Entry" group
of the keyfile backing @info.void
launchAction
(Str action_name, AppLaunchContext launch_context) Activates the named application action.void
launchAction
(String action_name, AppLaunchContext launch_context) Activates the named application action.static DesktopAppInfo
newFromFilenameDesktopAppInfo
(Str filename) Creates a new #GDesktopAppInfo.static DesktopAppInfo
newFromFilenameDesktopAppInfo
(String filename) Creates a new #GDesktopAppInfo.static DesktopAppInfo
newFromKeyfileDesktopAppInfo
(KeyFile key_file) Creates a new #GDesktopAppInfo.Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
DesktopAppInfo
-
DesktopAppInfo
Creates a new #GDesktopAppInfo based on a desktop file id.
A desktop file id is the basename of the desktop file, including the
.desktop extension. GIO is looking for a desktop file with this name
in the `applications` subdirectories of the XDG
data directories (i.e. the directories specified in the `XDG_DATA_HOME`
and `XDG_DATA_DIRS` environment variables). GIO also supports the
prefix-to-subdirectory mapping that is described in the
[Menu Spec](http://standards.freedesktop.org/menu-spec/latest/)
(i.e. a desktop id of kde-foo.desktop will match
`/usr/share/applications/kde/foo.desktop`).- Parameters:
desktop_id
- the desktop file id
-
DesktopAppInfo
Creates a new #GDesktopAppInfo based on a desktop file id.
A desktop file id is the basename of the desktop file, including the
.desktop extension. GIO is looking for a desktop file with this name
in the `applications` subdirectories of the XDG
data directories (i.e. the directories specified in the `XDG_DATA_HOME`
and `XDG_DATA_DIRS` environment variables). GIO also supports the
prefix-to-subdirectory mapping that is described in the
[Menu Spec](http://standards.freedesktop.org/menu-spec/latest/)
(i.e. a desktop id of kde-foo.desktop will match
`/usr/share/applications/kde/foo.desktop`).- Parameters:
desktop_id
- the desktop file id
-
-
Method Details
-
getClassHandler
-
newFromFilenameDesktopAppInfo
Creates a new #GDesktopAppInfo.- Parameters:
filename
- the path of a desktop file, in the GLib filename encoding- Returns:
- a new #GDesktopAppInfo or %NULL on error.
-
newFromFilenameDesktopAppInfo
Creates a new #GDesktopAppInfo.- Parameters:
filename
- the path of a desktop file, in the GLib filename encoding- Returns:
- a new #GDesktopAppInfo or %NULL on error.
-
newFromKeyfileDesktopAppInfo
Creates a new #GDesktopAppInfo.- Parameters:
key_file
- an opened #GKeyFile- Returns:
- a new #GDesktopAppInfo or %NULL on error.
-
getActionName
Gets the user-visible display name of the "additional application
action" specified by @action_name.
This corresponds to the "Name" key within the keyfile group for the
action.- Parameters:
action_name
- the name of the action as from g_desktop_app_info_list_actions()- Returns:
- the locale-specific action name
-
getActionName
Gets the user-visible display name of the "additional application
action" specified by @action_name.
This corresponds to the "Name" key within the keyfile group for the
action.- Parameters:
action_name
- the name of the action as from g_desktop_app_info_list_actions()- Returns:
- the locale-specific action name
-
getBoolean
Looks up a boolean value in the keyfile backing @info.
The @key is looked up in the "Desktop Entry" group.- Parameters:
key
- the key to look up- Returns:
- the boolean value, or %FALSE if the key is not found
-
getBoolean
Looks up a boolean value in the keyfile backing @info.
The @key is looked up in the "Desktop Entry" group.- Parameters:
key
- the key to look up- Returns:
- the boolean value, or %FALSE if the key is not found
-
getCategories
Gets the categories from the desktop file.- Returns:
- The unparsed Categories key from the desktop file; i.e. no attempt is made to split it by ';' or validate it.
-
getFilename
When @info was created from a known filename, return it. In some
situations such as the #GDesktopAppInfo returned from
g_desktop_app_info_new_from_keyfile(), this function will return %NULL.- Returns:
- The full path to the file for @info, or %NULL if not known.
-
getGenericName
Gets the generic name from the desktop file.- Returns:
- The value of the GenericName key
-
getIsHidden
public boolean getIsHidden()A desktop file is hidden if the Hidden key in it is
set to True.- Returns:
- %TRUE if hidden, %FALSE otherwise.
-
getKeywords
Gets the keywords from the desktop file.- Returns:
- The value of the Keywords key
-
getLocaleString
Looks up a localized string value in the keyfile backing @info
translated to the current locale.
The @key is looked up in the "Desktop Entry" group.- Parameters:
key
- the key to look up- Returns:
- a newly allocated string, or %NULL if the key is not found
-
getLocaleString
Looks up a localized string value in the keyfile backing @info
translated to the current locale.
The @key is looked up in the "Desktop Entry" group.- Parameters:
key
- the key to look up- Returns:
- a newly allocated string, or %NULL if the key is not found
-
getNodisplay
public boolean getNodisplay()Gets the value of the NoDisplay key, which helps determine if the
application info should be shown in menus. See
%G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().- Returns:
- The value of the NoDisplay key
-
getShowIn
Checks if the application info should be shown in menus that list available
applications for a specific name of the desktop, based on the
`OnlyShowIn` and `NotShowIn` keys.
@desktop_env should typically be given as %NULL, in which case the
`XDG_CURRENT_DESKTOP` environment variable is consulted. If you want
to override the default mechanism then you may specify @desktop_env,
but this is not recommended.
Note that g_app_info_should_show() for @info will include this check (with
%NULL for @desktop_env) as well as additional checks.- Parameters:
desktop_env
- a string specifying a desktop name- Returns:
- %TRUE if the @info should be shown in @desktop_env according to the `OnlyShowIn` and `NotShowIn` keys, %FALSE otherwise.
-
getShowIn
Checks if the application info should be shown in menus that list available
applications for a specific name of the desktop, based on the
`OnlyShowIn` and `NotShowIn` keys.
@desktop_env should typically be given as %NULL, in which case the
`XDG_CURRENT_DESKTOP` environment variable is consulted. If you want
to override the default mechanism then you may specify @desktop_env,
but this is not recommended.
Note that g_app_info_should_show() for @info will include this check (with
%NULL for @desktop_env) as well as additional checks.- Parameters:
desktop_env
- a string specifying a desktop name- Returns:
- %TRUE if the @info should be shown in @desktop_env according to the `OnlyShowIn` and `NotShowIn` keys, %FALSE otherwise.
-
getStartupWmClass
Retrieves the StartupWMClass field from @info. This represents the
WM_CLASS property of the main window of the application, if launched
through @info.- Returns:
- the startup WM class, or %NULL if none is set in the desktop file.
-
getString
Looks up a string value in the keyfile backing @info.
The @key is looked up in the "Desktop Entry" group.- Parameters:
key
- the key to look up- Returns:
- a newly allocated string, or %NULL if the key is not found
-
getString
Looks up a string value in the keyfile backing @info.
The @key is looked up in the "Desktop Entry" group.- Parameters:
key
- the key to look up- Returns:
- a newly allocated string, or %NULL if the key is not found
-
hasKey
Returns whether @key exists in the "Desktop Entry" group
of the keyfile backing @info.- Parameters:
key
- the key to look up- Returns:
- %TRUE if the @key exists
-
hasKey
Returns whether @key exists in the "Desktop Entry" group
of the keyfile backing @info.- Parameters:
key
- the key to look up- Returns:
- %TRUE if the @key exists
-
launchAction
Activates the named application action.
You may only call this function on action names that were
returned from g_desktop_app_info_list_actions().
Note that if the main entry of the desktop file indicates that the
application supports startup notification, and @launch_context is
non-%NULL, then startup notification will be used when activating the
action (and as such, invocation of the action on the receiving side
must signal the end of startup notification when it is completed).
This is the expected behaviour of applications declaring additional
actions, as per the desktop file specification.
As with g_app_info_launch() there is no way to detect failures that
occur while using this function.- Parameters:
action_name
- the name of the action as from g_desktop_app_info_list_actions()launch_context
- a #GAppLaunchContext
-
launchAction
Activates the named application action.
You may only call this function on action names that were
returned from g_desktop_app_info_list_actions().
Note that if the main entry of the desktop file indicates that the
application supports startup notification, and @launch_context is
non-%NULL, then startup notification will be used when activating the
action (and as such, invocation of the action on the receiving side
must signal the end of startup notification when it is completed).
This is the expected behaviour of applications declaring additional
actions, as per the desktop file specification.
As with g_app_info_launch() there is no way to detect failures that
occur while using this function.- Parameters:
action_name
- the name of the action as from g_desktop_app_info_list_actions()launch_context
- a #GAppLaunchContext
-
getImplementations
Gets all applications that implement @interface.
An application implements an interface if that interface is listed in
the Implements= line of the desktop file of the application.- Parameters:
_interface
- the name of the interface- Returns:
- a list of #GDesktopAppInfo objects.
-
asAppInfo
Implements interfaceAppInfo
. Call this to get access to interface functions.- Returns:
AppInfo
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-