From: Dan Winship Date: Wed, 30 May 2007 14:25:34 +0000 (+0000) Subject: add defines for desktop file handling. #339225, original patch from X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=90320fba4fcd952a7ac023da1edbdf0988bcc897;p=dana%2Fcg-glib.git add defines for desktop file handling. #339225, original patch from * glib/gkeyfile.h: add defines for desktop file handling. #339225, original patch from Vincent Untz. svn path=/trunk/; revision=5521 --- diff --git a/ChangeLog b/ChangeLog index 584d89e7..5e035788 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-05-30 Dan Winship + + * glib/gkeyfile.h: add defines for desktop file handling. #339225, + original patch from Vincent Untz. + 2007-05-29 Cody Russell * configure.in: Fix a sed script that doesn't correctly detect diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index bdb0b66e..2558b7d1 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,8 @@ +2007-05-30 Dan Winship + + * glib/glib-sections.txt: + * glib/tmpl/keyfile.sgml: add G_KEY_FILE_DESKTOP_* macros + 2007-05-2626 Matthias Clasen * gobject/tmpl/objects.sgml: Fix a typo diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt index 9b61bf85..1af7da81 100644 --- a/docs/reference/glib/glib-sections.txt +++ b/docs/reference/glib/glib-sections.txt @@ -1501,6 +1501,8 @@ GKeyFile G_KEY_FILE_ERROR GKeyFileError GKeyFileFlags + + g_key_file_new g_key_file_free g_key_file_set_list_separator @@ -1545,6 +1547,31 @@ g_key_file_remove_group g_key_file_remove_key g_key_file_remove_comment + +G_KEY_FILE_DESKTOP_GROUP +G_KEY_FILE_DESKTOP_KEY_TYPE +G_KEY_FILE_DESKTOP_KEY_VERSION +G_KEY_FILE_DESKTOP_KEY_NAME +G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME +G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY +G_KEY_FILE_DESKTOP_KEY_COMMENT +G_KEY_FILE_DESKTOP_KEY_ICON +G_KEY_FILE_DESKTOP_KEY_HIDDEN +G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN +G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN +G_KEY_FILE_DESKTOP_KEY_TRY_EXEC +G_KEY_FILE_DESKTOP_KEY_EXEC +G_KEY_FILE_DESKTOP_KEY_PATH +G_KEY_FILE_DESKTOP_KEY_TERMINAL +G_KEY_FILE_DESKTOP_KEY_MIME_TYPE +G_KEY_FILE_DESKTOP_KEY_CATEGORIES +G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY +G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS +G_KEY_FILE_DESKTOP_KEY_URL +G_KEY_FILE_DESKTOP_TYPE_APPLICATION +G_KEY_FILE_DESKTOP_TYPE_LINK +G_KEY_FILE_DESKTOP_TYPE_DIRECTORY + g_key_file_error_quark diff --git a/docs/reference/glib/tmpl/keyfile.sgml b/docs/reference/glib/tmpl/keyfile.sgml index d63ead05..d61688fc 100644 --- a/docs/reference/glib/tmpl/keyfile.sgml +++ b/docs/reference/glib/tmpl/keyfile.sgml @@ -601,3 +601,285 @@ Flags which influence the parsing. @error: + + +The name of the main group of a desktop entry file, as defined in the +Desktop +Entry Specification. Consult the specification for more +details about the meanings of the keys below. + + +@Since: 2.14 + + + + +A key under G_KEY_FILE_DESKTOP_GROUP +whose value is a string giving the type of the desktop entry. Usually +G_KEY_FILE_DESKTOP_TYPE_APPLICATION, +G_KEY_FILE_DESKTOP_TYPE_LINK, or +G_KEY_FILE_DESKTOP_TYPE_DIRECTORY. + + +@Since: 2.14 + + + + + +A key under G_KEY_FILE_DESKTOP_GROUP +whose value is a string giving the version of the Desktop +Entry Specification used for the desktop entry file. + + +@Since: 2.14 + + + + + +A key under G_KEY_FILE_DESKTOP_GROUP +whose value is a localized string giving the specific name of the +desktop entry. + + +@Since: 2.14 + + + + + +A key under G_KEY_FILE_DESKTOP_GROUP +whose value is a localized string giving the generic name of the +desktop entry. + + +@Since: 2.14 + + + + + +A key under G_KEY_FILE_DESKTOP_GROUP +whose value is a boolean stating whether the desktop entry should be +shown in menus. + + +@Since: 2.14 + + + + + +A key under G_KEY_FILE_DESKTOP_GROUP +whose value is a localized string giving the tooltip for the desktop +entry. + + +@Since: 2.14 + + + + + +A key under G_KEY_FILE_DESKTOP_GROUP +whose value is a localized string giving the name of the icon to be +displayed for the desktop entry. + + +@Since: 2.14 + + + + + +A key under G_KEY_FILE_DESKTOP_GROUP +whose value is a boolean stating whether the desktop entry has been +deleted by the user. + + +@Since: 2.14 + + + + + +A key under G_KEY_FILE_DESKTOP_GROUP +whose value is a list of strings identifying the environments that +should display the desktop entry. + + +@Since: 2.14 + + + + + +A key under G_KEY_FILE_DESKTOP_GROUP +whose value is a list of strings identifying the environments that +should not display the desktop entry. + + +@Since: 2.14 + + + + + +A key under G_KEY_FILE_DESKTOP_GROUP +whose value is a string giving the file name of a binary on disk +used to determine if the program is actually installed. It is only +valid for desktop entries with the Application +type. + + +@Since: 2.14 + + + + + +A key under G_KEY_FILE_DESKTOP_GROUP +whose value is a string giving the command line to execute. It is only +valid for desktop entries with the Application +type. + + +@Since: 2.14 + + + + + +A key under G_KEY_FILE_DESKTOP_GROUP +whose value is a string containing the working directory to run the +program in. It is only valid for desktop entries with the +Application type. + + +@Since: 2.14 + + + + + +A key under G_KEY_FILE_DESKTOP_GROUP +whose value is a boolean stating whether the program should be +run in a terminal window. It is only valid for desktop entries with +the Application type. + + +@Since: 2.14 + + + + + +A key under G_KEY_FILE_DESKTOP_GROUP +whose value is a list of strings giving the MIME types supported +by this desktop entry. + + +@Since: 2.14 + + + + + +A key under G_KEY_FILE_DESKTOP_GROUP +whose value is a list of strings giving the categories in which the +desktop entry should be shown in a menu. + + +@Since: 2.14 + + + + + +A key under G_KEY_FILE_DESKTOP_GROUP +whose value is a boolean stating whether the application supports +the Startup +Notification Protocol Specification. + + +@Since: 2.14 + + + + + +A key under G_KEY_FILE_DESKTOP_GROUP +whose value is string identifying the WM class or name hint of a +window that the application will create, which can be used to emulate +Startup Notification with older applications. + + +@Since: 2.14 + + + + + +A key under G_KEY_FILE_DESKTOP_GROUP +whose value is a string giving the URL to access. It is only valid +for desktop entries with the Link type. + + +@Since: 2.14 + + + + + +The value of the G_KEY_FILE_DESKTOP_KEY_TYPE +key for desktop entries representing applications. + + +@Since: 2.14 + + + + + +The value of the G_KEY_FILE_DESKTOP_KEY_TYPE +key for desktop entries representing links to documents. + + +@Since: 2.14 + + + + + +The value of the G_KEY_FILE_DESKTOP_KEY_TYPE +key for desktop entries representing directories. + + +@Since: 2.14 + + + diff --git a/glib/gkeyfile.h b/glib/gkeyfile.h index de86cd87..d78dd7cc 100644 --- a/glib/gkeyfile.h +++ b/glib/gkeyfile.h @@ -214,6 +214,33 @@ void g_key_file_remove_group (GKeyFile *key_file, const gchar *group_name, GError **error); +/* Defines for handling freedesktop.org Desktop files */ +#define G_KEY_FILE_DESKTOP_GROUP "Desktop Entry" + +#define G_KEY_FILE_DESKTOP_KEY_TYPE "Type" +#define G_KEY_FILE_DESKTOP_KEY_VERSION "Version" +#define G_KEY_FILE_DESKTOP_KEY_NAME "Name" +#define G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME "GenericName" +#define G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY "NoDisplay" +#define G_KEY_FILE_DESKTOP_KEY_COMMENT "Comment" +#define G_KEY_FILE_DESKTOP_KEY_ICON "Icon" +#define G_KEY_FILE_DESKTOP_KEY_HIDDEN "Hidden" +#define G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN "OnlyShowIn" +#define G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN "NotShowIn" +#define G_KEY_FILE_DESKTOP_KEY_TRY_EXEC "TryExec" +#define G_KEY_FILE_DESKTOP_KEY_EXEC "Exec" +#define G_KEY_FILE_DESKTOP_KEY_PATH "Path" +#define G_KEY_FILE_DESKTOP_KEY_TERMINAL "Terminal" +#define G_KEY_FILE_DESKTOP_KEY_MIME_TYPE "MimeType" +#define G_KEY_FILE_DESKTOP_KEY_CATEGORIES "Categories" +#define G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY "StartupNotify" +#define G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS "StartupWMClass" +#define G_KEY_FILE_DESKTOP_KEY_URL "URL" + +#define G_KEY_FILE_DESKTOP_TYPE_APPLICATION "Application" +#define G_KEY_FILE_DESKTOP_TYPE_LINK "Link" +#define G_KEY_FILE_DESKTOP_TYPE_DIRECTORY "Directory" + G_END_DECLS #endif /* __G_KEY_FILE_H__ */