Le samedi 22 avril 2006 à 10:04 +0200, Vincent Untz a écrit :
> Hi,
> 
> Here's a small patch fixing really minor stuff in the desktop entry
> spec:

I did some more work this morning.

Here's a bunch of patches to apply in the following order:
  cleanup.diff
  cleanup2.diff
  encoding.diff
  swallow.diff
  reorganize.diff
  group.diff
  keys.diff

cleanup.diff: the patch I sent a few weeks ago
cleanup2.diff: some more cleanup, mainly adding some <literal> tags
encoding.diff: move all of the legacy-mixed encoding stuff to the
               appendix
swallow.diff: deprecate the Swallow* keys
reorganize.diff: move lots of text around. It makes the spec easier to
                 understand, IMHO.
group.diff: improve definition of group headers
keys.diff: reorder the list of standard keys so they are sorted by type

I believe this should be okay for everyone, but make sure to verify :-)

I don't have a fd.o cvs account, so I won't be able to commit them. But
I can ask for one if necessary.


Here's a list of things that I intend to work on:

  + move all the FSDevice-related keys to appendix B ("Currently
    reserved for use within KDE"). I won't make the change if some
    other project is using those keys or if people disagree.

  + define the type of regexp that is accepted. Any feedback on what it
    should be?

  + tell what should happen when multiple group headers have the same
    name. We could either merge them, only use the first, only use
    the last, etc. I'd say we should only use the last one.

  + change the type of the version key to string and specify its format
    (MAJOR.MINOR.MICRO where MAJOR, MINOR and MICRO are positive
    integers). 0.9.4 is not a numeric value ;-)

  + I don't think the SortOrder key is useful with the menu spec. Should
    it be deprecated?

  + is the FilePattern key used?

Is there any other issue in this spec that we should solve?

Vincent

-- 
Les gens heureux ne sont pas pressés.
Index: desktop-entry-spec/desktop-entry-spec.xml
===================================================================
--- desktop-entry-spec.orig/desktop-entry-spec.xml	2006-05-20 09:37:17.000000000 +0200
+++ desktop-entry-spec/desktop-entry-spec.xml	2006-05-20 09:41:10.000000000 +0200
@@ -68,15 +68,11 @@
       be other groups present in the file, but this is the most
       important group which explicitly needs to be supported.  This
       group should also be used as the "magic key" for automatic MIME
-      type detection.  There should be nothing proceeding this group in
+      type detection.  There should be nothing preceding this group in
       the desktop entry file but possibly one or more comments (see
       below).
     </para>
     <para>
-      Group headers may not contain the characters <literal>[</literal> and
-      <literal>]</literal> as those delimit the header.
-    </para>
-    <para>
       Lines beginning with a <literal>#</literal> and blank lines are
       considered comments and will be ignored, however they should be
       preserved across reads and writes of the desktop entry file.
@@ -97,6 +93,11 @@
       sign is the actual delimiter.
     </para>
     <para>
+      Case is significant.  The keys <varname>Name</varname> and <varname>NAME</varname> are not equivalent.
+      The same holds for group names.  Key values are case sensitive as
+      well.
+    </para>
+    <para>
       The escape sequences <literal>\s</literal>, <literal>\n</literal>,
       <literal>\t</literal>, <literal>\r</literal>, and
       <literal>\\</literal> are supported, meaning ASCII space, newline,
@@ -237,12 +238,7 @@
       then the value of the <varname>Name</varname> keyed by <literal>sr_YU</literal> is used.
     </para>
     <para>
-      Case is significant.  The keys <varname>Name</varname> and <varname>NAME</varname> are not equivalent.
-      The same holds for group names.  Key values are case sensitive as
-      well.
-    </para>
-    <para>
-      Keys are either OPTIONAL or REQUIRED.  If a key is optional it may or
+      Keys are either OPTIONAL or REQUIRED.  If a key is OPTIONAL it may or
       may not be present in the file.  However, if it isn't, the
       implementation of the standard should not blow up, it must provide
       some sane defaults.  Additionally, keys either MUST or MAY be
@@ -361,10 +357,9 @@
           name is an absolute path, the given file will be
           used. If the name is not an absolute path, an
           implementation-dependent search algorithm will be used
-          to locate the icon. Icons may be localized with the
-          <literal>Icon[xx]=</literal> syntax.
+          to locate the icon.
 	    </entry>
-	    <entry>string</entry>
+	    <entry>localestring</entry>
 	    <entry>NO</entry>
 	    <entry>YES</entry>
 		<entry>1-4</entry>
@@ -474,7 +469,7 @@
 	    <entry>
            The MIME type(s) supported by this entry.
 	    </entry>
-	    <entry>strings(s)</entry>
+	    <entry>string(s)</entry>
 	    <entry>NO</entry>
 	    <entry>NO</entry>
 		<entry>1</entry>
@@ -741,7 +736,7 @@
 	    </entry>
 	  </row>
 	  <row>
-	    <entry>%i</entry>
+	    <entry><literal>%i</literal></entry>
 	    <entry>
               The <varname>Icon</varname> field of the desktop entry
               expanded as two parameters, first
Index: desktop-entry-spec/desktop-entry-spec.xml
===================================================================
--- desktop-entry-spec.orig/desktop-entry-spec.xml	2006-05-20 09:43:16.000000000 +0200
+++ desktop-entry-spec/desktop-entry-spec.xml	2006-05-20 09:46:37.000000000 +0200
@@ -107,8 +107,10 @@
   <sect1 id="value-types">
     <title>Possible value types</title>
     <para>
-      The value types recognized are string, localestring, regexp,
-      boolean (encoded as the string true/false), and numeric.
+      The value types recognized are <literal>string</literal>,
+      <literal>localestring</literal>, <literal>regexp</literal>,
+      <literal>boolean</literal> (encoded as the string true/false), and
+      <literal>numeric</literal>.
     </para>
     <para>
       Values of type <literal>string</literal> must contain only ASCII
@@ -127,7 +129,8 @@
   <sect1 id="recognized-keys">
     <title>Recognized desktop entry keys</title>
     <para>
-	  Keys  with type localestring may be postfixed by [<replaceable>LOCALE</replaceable>],
+	  Keys  with type <literal>localestring</literal> may be postfixed by
+	  [<replaceable>LOCALE</replaceable>],
 	  where <replaceable>LOCALE</replaceable> is the locale type of the
 	  entry.  <replaceable>LOCALE</replaceable> must be of the form
 	  <literal><replaceable>lang</replaceable>_<replaceable>COUNTRY</replaceable>.<replaceable>ENCODING</replaceable>@<replaceable>MODIFIER</replaceable></literal>,
@@ -621,14 +624,14 @@
       </listitem>
       <listitem>
        <para>
-         Values of type string may contain all ASCII characters except
-         for control characters.
+	 Values of type <literal>string</literal> may contain all ASCII
+	 characters except for control characters.
        </para>
       </listitem>
       <listitem>
        <para>
-          Values of type boolean must either be the string <literal>true</literal> or
-          <literal>false</literal>.
+	  Values of type <literal>boolean</literal> must either be the string
+	  <literal>true</literal> or <literal>false</literal>.
        </para>
       </listitem>
       <listitem>
@@ -644,8 +647,8 @@
       contain characters not in ASCII is encouraged.
     </para>
 	<para>
-	  The encoding for values of type localestring is determined by the
-	  <varname>Encoding</varname> field. 
+	  The encoding for values of type <literal>localestring</literal> is
+	  determined by the <varname>Encoding</varname> field. 
 	</para>
   </sect1>
   <sect1 id="exec-variables">
@@ -1000,7 +1003,7 @@
     <para>
       The <constant>Legacy-Mixed</constant> encoding corresponds to the traditional encoding
       of desktop files in older versions of the GNOME and KDE desktop
-      files. In this encoding, the encoding of each localestring key
+      files. In this encoding, the encoding of each <literal>localestring</literal> key
       is determined by the locale tag for that key, if any. For keys
       without a locale tag, the value must contain only ASCII 
       characters.
Index: desktop-entry-spec/desktop-entry-spec.xml
===================================================================
--- desktop-entry-spec.orig/desktop-entry-spec.xml	2006-05-20 10:04:41.000000000 +0200
+++ desktop-entry-spec/desktop-entry-spec.xml	2006-05-20 10:07:48.000000000 +0200
@@ -116,8 +116,7 @@
       Values of type <literal>string</literal> must contain only ASCII
       characters excluding control characters.  Values of type
       <literal>localestring</literal> are user displayable, and are
-      encoded in UTF-8 unless the <constant>Legacy-Mixed</constant>
-      Encoding is specified (see <xref linkend="legacy-mixed"/>.)
+      encoded in UTF-8.
     </para>
     <para>
       Some keys can have multiple values; these should be separated by a
@@ -148,11 +147,7 @@
       <replaceable>LOCALE</replaceable> postfixes of all occurrences
       of the key, with the
       <literal>.<replaceable>ENCODING</replaceable></literal> part
-      stripped. The
-      <literal>.<replaceable>ENCODING</replaceable></literal> field is
-      used only when the value of the <varname>Encoding</varname> key
-      for the desktop entry file is <constant>Legacy-Mixed</constant>
-      (see <xref linkend="legacy-mixed"/>.)
+      stripped.
     </para>
     <para>
 	  The matching of is done as follows.  If
@@ -296,18 +291,6 @@
 		<entry>1-4</entry>
 	  </row>
 	  <row>
-	    <entry id="key-encoding"><varname>Encoding</varname></entry>
-	    <entry>
-	      Encoding of the whole desktop entry file
-	      (<constant>UTF-8</constant> or
-	      <constant>Legacy-Mixed</constant>).
-	    </entry>
-	    <entry>string</entry>
-	    <entry>YES</entry>
-	    <entry>YES</entry>
-		<entry>1-4</entry>
-	  </row>
-	  <row>
 	    <entry id="key-name"><varname>Name</varname></entry>
 	    <entry>
           Specific name of the application, for example "Mozilla".
@@ -646,10 +629,6 @@
       (except for LF). However, using UTF-8 for comment lines that
       contain characters not in ASCII is encouraged.
     </para>
-	<para>
-	  The encoding for values of type <literal>localestring</literal> is
-	  determined by the <varname>Encoding</varname> field. 
-	</para>
   </sect1>
   <sect1 id="exec-variables">
     <title>List of valid <varname>Exec</varname> parameter variables</title>
@@ -876,7 +855,6 @@
 [Desktop Entry]
 Version=1.0
 Type=Application
-Encoding=UTF-8
 Name=Foo Viewer
 Comment=The best viewer for Foo objects available!
 TryExec=fooview
@@ -953,9 +931,11 @@
       </listitem>
       <listitem>
         <para>
-          <literal>Encoding=Legacy-Mixed</literal>, which allowed
-          localestrings in the encoding of the specified locale, is
-          deprecated.
+	  The <literal>Encoding</literal> key is deprecated. It was used to
+	  specify whether keys of type <literal>localestring</literal> were
+	  encoded in UTF-8 or in the specified locale. Possible values are
+	  <literal>UTF-8</literal> and <literal>Legacy-Mixed</literal>. See
+	  <xref linkend="legacy-mixed"/> for more details.
         </para>
       </listitem>
       <listitem>
@@ -1001,12 +981,12 @@
   <appendix id="legacy-mixed">
     <title>The <constant>Legacy-Mixed</constant> Encoding (Deprecated)</title>
     <para>
-      The <constant>Legacy-Mixed</constant> encoding corresponds to the traditional encoding
-      of desktop files in older versions of the GNOME and KDE desktop
-      files. In this encoding, the encoding of each <literal>localestring</literal> key
-      is determined by the locale tag for that key, if any. For keys
-      without a locale tag, the value must contain only ASCII 
-      characters.
+      The <constant>Legacy-Mixed</constant> encoding corresponds to the
+      traditional encoding of desktop files in older versions of the GNOME and
+      KDE desktop files. In this encoding, the encoding of each
+      <literal>localestring</literal> key is determined by the locale tag for
+      that key, if any, instead of being UTF-8. For keys without a locale tag,
+      the value must contain only ASCII characters.
     </para>
     <para>
       If the file specifies an unsupported encoding, the implementation
Index: desktop-entry-spec/desktop-entry-spec.xml
===================================================================
--- desktop-entry-spec.orig/desktop-entry-spec.xml	2006-05-20 10:52:41.000000000 +0200
+++ desktop-entry-spec/desktop-entry-spec.xml	2006-05-20 10:56:41.000000000 +0200
@@ -87,20 +87,27 @@
     <sect2 id="group-header">
       <title>Group headers</title>
       <para>
+	A group header with name <literal>groupname</literal> is a line in the
+	format:
+      </para>
+      <programlisting>[groupname]</programlisting>
+      <para>
+	Group names may contain all ASCII characters except for
+	<literal>[</literal> and <literal>]</literal> and control characters.
+      </para>
+      <para>
+	All <literal>{key,value}</literal> pairs following a group header until
+	a new group header belong to the group.
+      </para>
+      <para>
 	The basic format of the desktop entry file requires that there be
-	a "group" header named <literal>[Desktop Entry]</literal>.  This
-	"group" entry denotes that all <literal>{key,value}</literal>
-	pairs following it belong in the Desktop Entry group.  There may
+	a group header named <literal>Desktop Entry</literal>.  There may
 	be other groups present in the file, but this is the most
 	important group which explicitly needs to be supported.  This
 	group should also be used as the "magic key" for automatic MIME
 	type detection.  There should be nothing preceding this group in
 	the desktop entry file but possibly one or more comments.
       </para>
-      <para>
-	Group names may contain all ASCII characters except for
-	<literal>[</literal> and <literal>]</literal> and control characters.
-      </para>
     </sect2>
     <sect2 id="entries">
       <title>Entries</title>
Index: desktop-entry-spec/desktop-entry-spec.xml
===================================================================
--- desktop-entry-spec.orig/desktop-entry-spec.xml	2006-05-20 10:56:41.000000000 +0200
+++ desktop-entry-spec/desktop-entry-spec.xml	2006-05-20 11:03:42.000000000 +0200
@@ -325,9 +325,9 @@
 	    <entry id="key-type"><varname>Type</varname></entry>
 	    <entry>
 	      There are 4 types of desktop entries:
-	      <constant>Application</constant>,
-	      <constant>Link</constant>, <constant>FSDevice</constant>
-	      and <constant>Directory</constant>.
+	      <constant>Application</constant> (type 1),
+	      <constant>Link</constant> (type 2), <constant>FSDevice</constant>
+	      (type 3) and <constant>Directory</constant> (type 4).
 	    </entry>
 	    <entry>string</entry>
 	    <entry>YES</entry>
@@ -424,6 +424,22 @@
 		<entry>1-4</entry>
 	  </row>
 	  <row>
+	    <entry id="key-onlyshowin"><varname>OnlyShowIn</varname>, <varname>NotShowIn</varname></entry>
+	    <entry>
+           A list of strings identifying the environments that should
+           display/not display a given desktop entry. Only one of
+           these keys, either <varname>OnlyShowIn</varname> or
+           <varname>NotShowIn</varname>, may appear in a group (for
+           possible values see the <ulink
+           url="http://www.freedesktop.org/Standards/menu-spec";>Desktop
+           Menu Specification</ulink>).
+	    </entry>
+	    <entry>string(s)</entry>
+	    <entry>NO</entry>
+	    <entry>NO</entry>
+		<entry>1-4</entry>
+	  </row>
+	  <row>
 	    <entry id="key-filepattern"><varname>FilePattern</varname></entry>
 	    <entry>
 		  A list of regular expressions to match against for a
@@ -499,60 +515,65 @@
 		<entry>1</entry>
 	  </row>
 	  <row>
-	    <entry id="key-sortorder"><varname>SortOrder</varname></entry>
+	    <entry id="key-categories"><varname>Categories</varname></entry>
 	    <entry>
-           This may specify the order in which to display files.
+          Categories in which the entry should be shown in a menu (for
+          possible values see the <ulink
+          url="http://www.freedesktop.org/Standards/menu-spec";>Desktop
+          Menu Specification</ulink>).
 	    </entry>
 	    <entry>string(s)</entry>
 	    <entry>NO</entry>
 	    <entry>NO</entry>
-		<entry>4</entry>
+		<entry>1</entry>
 	  </row>
 	  <row>
-	    <entry id="key-dev"><varname>Dev</varname></entry>
+	    <entry id="key-startupnotify"><varname>StartupNotify</varname></entry>
 	    <entry>
-           The device to mount.
+			If true, it is KNOWN that the application will send a "remove"
+			message when started with the <envar>DESKTOP_LAUNCH_ID</envar> environment variable
+			set (see the <ulink url="http://www.freedesktop.org/Standards/startup-notification-spec";>Startup Notification Protocol Specification</ulink> for more details).
 	    </entry>
-	    <entry>string</entry>
+	    <entry>boolean</entry>
 	    <entry>NO</entry>
 	    <entry>NO</entry>
-		<entry>3</entry>
+		<entry>1</entry>
 	  </row>
 	  <row>
-	    <entry id="key-fstype"><varname>FSType</varname></entry>
+	    <entry id="key-startupwmclass"><varname>StartupWMClass</varname></entry>
 	    <entry>
-           The type of file system to try to mount.
+			If true, it is KNOWN that the application will map at least one
+			window with the given string as its WM class or WM name hint (see the <ulink url="http://www.freedesktop.org/Standards/startup-notification-spec";>Startup Notification Protocol Specification</ulink> for more details).
 	    </entry>
 	    <entry>string</entry>
 	    <entry>NO</entry>
 	    <entry>NO</entry>
-		<entry>3</entry>
+		<entry>1</entry>
 	  </row>
 	  <row>
-	    <entry id="key-mountpoint"><varname>MountPoint</varname></entry>
+	    <entry id="key-url"><varname>URL</varname></entry>
 	    <entry>
-           The mount point of the device in question.
+           If entry is Link type, the URL to access.
 	    </entry>
 	    <entry>string</entry>
 	    <entry>NO</entry>
-	    <entry>NO</entry>
-		<entry>3</entry>
+	    <entry>YES</entry>
+		<entry>2</entry>
 	  </row>
 	  <row>
-	    <entry id="key-readonly"><varname>ReadOnly</varname></entry>
+	    <entry id="key-dev"><varname>Dev</varname></entry>
 	    <entry>
-           Specifies whether or not the device is read only.
+           The device to mount.
 	    </entry>
-	    <entry>boolean</entry>
+	    <entry>string</entry>
 	    <entry>NO</entry>
 	    <entry>NO</entry>
 		<entry>3</entry>
 	  </row>
 	  <row>
-	    <entry id="key-unmounticon"><varname>UnmountIcon</varname></entry>
+	    <entry id="key-fstype"><varname>FSType</varname></entry>
 	    <entry>
-           Icon to display when device is not mounted.  Mounted devices display icon from the <varname>Icon</varname> key.
-		   <varname>UnmountIcon</varname>s may be localized with the <literal>UnmountIcon[xx]=</literal> syntax.
+           The type of file system to try to mount.
 	    </entry>
 	    <entry>string</entry>
 	    <entry>NO</entry>
@@ -560,66 +581,45 @@
 		<entry>3</entry>
 	  </row>
 	  <row>
-	    <entry id="key-url"><varname>URL</varname></entry>
+	    <entry id="key-mountpoint"><varname>MountPoint</varname></entry>
 	    <entry>
-           If entry is Link type, the URL to access.
+           The mount point of the device in question.
 	    </entry>
 	    <entry>string</entry>
 	    <entry>NO</entry>
-	    <entry>YES</entry>
-		<entry>2</entry>
-	  </row>
-	  <row>
-	    <entry id="key-categories"><varname>Categories</varname></entry>
-	    <entry>
-          Categories in which the entry should be shown in a menu (for
-          possible values see the <ulink
-          url="http://www.freedesktop.org/Standards/menu-spec";>Desktop
-          Menu Specification</ulink>).
-	    </entry>
-	    <entry>string(s)</entry>
-	    <entry>NO</entry>
 	    <entry>NO</entry>
-		<entry>1</entry>
+		<entry>3</entry>
 	  </row>
 	  <row>
-	    <entry id="key-onlyshowin"><varname>OnlyShowIn</varname>, <varname>NotShowIn</varname></entry>
+	    <entry id="key-readonly"><varname>ReadOnly</varname></entry>
 	    <entry>
-           A list of strings identifying the environments that should
-           display/not display a given desktop entry. Only one of
-           these keys, either <varname>OnlyShowIn</varname> or
-           <varname>NotShowIn</varname>, may appear in a group (for
-           possible values see the <ulink
-           url="http://www.freedesktop.org/Standards/menu-spec";>Desktop
-           Menu Specification</ulink>).
+           Specifies whether or not the device is read only.
 	    </entry>
-	    <entry>string(s)</entry>
+	    <entry>boolean</entry>
 	    <entry>NO</entry>
 	    <entry>NO</entry>
-		<entry>1-4</entry>
+		<entry>3</entry>
 	  </row>
 	  <row>
-	    <entry id="key-startupnotify"><varname>StartupNotify</varname></entry>
+	    <entry id="key-unmounticon"><varname>UnmountIcon</varname></entry>
 	    <entry>
-			If true, it is KNOWN that the application will send a "remove"
-			message when started with the <envar>DESKTOP_LAUNCH_ID</envar> environment variable
-			set (see the <ulink url="http://www.freedesktop.org/Standards/startup-notification-spec";>Startup Notification Protocol Specification</ulink> for more details).
+           Icon to display when device is not mounted.  Mounted devices display icon from the <varname>Icon</varname> key.
+		   <varname>UnmountIcon</varname>s may be localized with the <literal>UnmountIcon[xx]=</literal> syntax.
 	    </entry>
-	    <entry>boolean</entry>
+	    <entry>string</entry>
 	    <entry>NO</entry>
 	    <entry>NO</entry>
-		<entry>1</entry>
+		<entry>3</entry>
 	  </row>
 	  <row>
-	    <entry id="key-startupwmclass"><varname>StartupWMClass</varname></entry>
+	    <entry id="key-sortorder"><varname>SortOrder</varname></entry>
 	    <entry>
-			If true, it is KNOWN that the application will map at least one
-			window with the given string as its WM class or WM name hint (see the <ulink url="http://www.freedesktop.org/Standards/startup-notification-spec";>Startup Notification Protocol Specification</ulink> for more details).
+           This may specify the order in which to display files.
 	    </entry>
-	    <entry>string</entry>
+	    <entry>string(s)</entry>
 	    <entry>NO</entry>
 	    <entry>NO</entry>
-		<entry>1</entry>
+		<entry>4</entry>
 	  </row>
 	</tbody>
       </tgroup>
Index: desktop-entry-spec/desktop-entry-spec.xml
===================================================================
--- desktop-entry-spec.orig/desktop-entry-spec.xml	2006-05-20 10:51:28.000000000 +0200
+++ desktop-entry-spec/desktop-entry-spec.xml	2006-05-20 10:52:41.000000000 +0200
@@ -61,21 +61,8 @@
       should be simply called <filename>.directory</filename>.
     </para>
     <para>
-      The basic format of the desktop entry file requires that there be
-      a "group" header named <literal>[Desktop Entry]</literal>.  This
-      "group" entry denotes that all <literal>{key,value}</literal>
-      pairs following it belong in the Desktop Entry group.  There may
-      be other groups present in the file, but this is the most
-      important group which explicitly needs to be supported.  This
-      group should also be used as the "magic key" for automatic MIME
-      type detection.  There should be nothing preceding this group in
-      the desktop entry file but possibly one or more comments (see
-      below).
-    </para>
-    <para>
-      Lines beginning with a <literal>#</literal> and blank lines are
-      considered comments and will be ignored, however they should be
-      preserved across reads and writes of the desktop entry file.
+      Desktop entry files are encoded as lines of 8-bit characters separated
+      by LF characters. Case is significant everywhere in the file.
     </para>
     <para>
       Compliant implementations MUST not remove any fields from the file,
@@ -84,49 +71,110 @@
       This ensures that any desktop-specific extensions will be preserved
       even if another system accesses and changes the file.
     </para>
+    <sect2 id="comments">
+      <title>Comments</title>
     <para>
-      Entries in the file are <literal>{key,value}</literal> pairs in the format:
-    </para>
-    <programlisting>Key=Value</programlisting>
-    <para>
-      Space before and after the equals sign should be ignored; the <literal>=</literal>
-      sign is the actual delimiter.
-    </para>
-    <para>
-      Case is significant.  The keys <varname>Name</varname> and <varname>NAME</varname> are not equivalent.
-      The same holds for group names.  Key values are case sensitive as
-      well.
+      Lines beginning with a <literal>#</literal> and blank lines are
+      considered comments and will be ignored, however they should be
+      preserved across reads and writes of the desktop entry file.
     </para>
     <para>
-      The escape sequences <literal>\s</literal>, <literal>\n</literal>,
-      <literal>\t</literal>, <literal>\r</literal>, and
-      <literal>\\</literal> are supported, meaning ASCII space, newline,
-      tab, carriage return, and backslash, respectively.
+      Comment lines are uninterpreted and may contain any character
+      (except for LF). However, using UTF-8 for comment lines that
+      contain characters not in ASCII is encouraged.
     </para>
+    </sect2>
+    <sect2 id="group-header">
+      <title>Group headers</title>
+      <para>
+	The basic format of the desktop entry file requires that there be
+	a "group" header named <literal>[Desktop Entry]</literal>.  This
+	"group" entry denotes that all <literal>{key,value}</literal>
+	pairs following it belong in the Desktop Entry group.  There may
+	be other groups present in the file, but this is the most
+	important group which explicitly needs to be supported.  This
+	group should also be used as the "magic key" for automatic MIME
+	type detection.  There should be nothing preceding this group in
+	the desktop entry file but possibly one or more comments.
+      </para>
+      <para>
+	Group names may contain all ASCII characters except for
+	<literal>[</literal> and <literal>]</literal> and control characters.
+      </para>
+    </sect2>
+    <sect2 id="entries">
+      <title>Entries</title>
+      <para>
+	Entries in the file are <literal>{key,value}</literal> pairs in the
+	format:
+      </para>
+      <programlisting>Key=Value</programlisting>
+      <para>
+	Space before and after the equals sign should be ignored; the
+	<literal>=</literal> sign is the actual delimiter.
+      </para>
+      <para>
+	Key names must contain only the characters <literal>A-Za-z0-9-</literal>
+      </para>
+      <para>
+	As the case is significant, the keys <varname>Name</varname> and
+	<varname>NAME</varname> are not equivalent.
+      </para>
+    </sect2>
   </sect1>
   <sect1 id="value-types">
     <title>Possible value types</title>
     <para>
       The value types recognized are <literal>string</literal>,
       <literal>localestring</literal>, <literal>regexp</literal>,
-      <literal>boolean</literal> (encoded as the string true/false), and
+      <literal>boolean</literal>, and
       <literal>numeric</literal>.
     </para>
+    <itemizedlist>
+      <listitem>
+       <para>
+	 Values of type <literal>string</literal> may contain all ASCII
+	 characters except for control characters.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+	 Values of type <literal>localestring</literal> are user displayable,
+	 and are encoded in UTF-8.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+	  Values of type <literal>boolean</literal> must either be the string
+	  <literal>true</literal> or <literal>false</literal>.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+	  Values of type <literal>numeric</literal> must be a valid floating
+	  point number as recognized by the <literal>%f</literal> specifier for
+	  <function>scanf</function>.
+       </para>
+      </listitem>
+    </itemizedlist>
     <para>
-      Values of type <literal>string</literal> must contain only ASCII
-      characters excluding control characters.  Values of type
-      <literal>localestring</literal> are user displayable, and are
-      encoded in UTF-8.
+      The escape sequences <literal>\s</literal>, <literal>\n</literal>,
+      <literal>\t</literal>, <literal>\r</literal>, and
+      <literal>\\</literal> are supported for values of type
+      <literal>string</literal> and <literal>localestring</literal>, meaning
+      ASCII space, newline, tab, carriage return, and backslash, respectively.
     </para>
     <para>
-      Some keys can have multiple values; these should be separated by a
-      semicolon.  Those keys which have several values should have a
-      semicolon as the trailing character.  Semicolons in these values
-      need to be escaped using <literal>\;</literal>.
+      Some keys can have multiple values. In such a case, the value of the key
+      is specified as a plural: for example, <literal>string(s)</literal>. The
+      multiple values should be separated by a semicolon.  Those keys which
+      have several values should have a semicolon as the trailing character.
+      Semicolons in these values need to be escaped using
+      <literal>\;</literal>.
     </para>
   </sect1>
-  <sect1 id="recognized-keys">
-    <title>Recognized desktop entry keys</title>
+  <sect1 id="localized-keys">
+    <title>Localized values for keys</title>
     <para>
 	  Keys  with type <literal>localestring</literal> may be postfixed by
 	  [<replaceable>LOCALE</replaceable>],
@@ -235,6 +283,9 @@
     <para>
       then the value of the <varname>Name</varname> keyed by <literal>sr_YU</literal> is used.
     </para>
+  </sect1>
+  <sect1 id="recognized-keys">
+    <title>Recognized desktop entry keys</title>
     <para>
       Keys are either OPTIONAL or REQUIRED.  If a key is OPTIONAL it may or
       may not be present in the file.  However, if it isn't, the
@@ -567,49 +618,6 @@
       </tgroup>
     </table>
   </sect1>
-  <sect1 id="character-encoding">
-    <title>Character set encoding of the file</title>
-    <para>
-      Desktop entry files are encoded as lines of 8-bit characters separated
-      by LF characters.
-    </para>
-    <itemizedlist>
-      <listitem>
-       <para>
-         Key names must contain only the characters <literal>A-Za-z0-9-</literal>
-       </para>
-      </listitem>
-      <listitem>
-       <para>
-         Group names may contain all ASCII characters except for
-         <literal>[</literal> and <literal>]</literal> and control characters.
-       </para>
-      </listitem>
-      <listitem>
-       <para>
-	 Values of type <literal>string</literal> may contain all ASCII
-	 characters except for control characters.
-       </para>
-      </listitem>
-      <listitem>
-       <para>
-	  Values of type <literal>boolean</literal> must either be the string
-	  <literal>true</literal> or <literal>false</literal>.
-       </para>
-      </listitem>
-      <listitem>
-       <para>
-          Numeric values must be a valid floating point number as recognized
-          by the <literal>%f</literal> specifier for <function>scanf</function>.
-       </para>
-      </listitem>
-    </itemizedlist>
-    <para>
-      Comment lines are uninterpreted and may contain any character 
-      (except for LF). However, using UTF-8 for comment lines that
-      contain characters not in ASCII is encouraged.
-    </para>
-  </sect1>
   <sect1 id="exec-variables">
     <title>List of valid <varname>Exec</varname> parameter variables</title>
     <para>
Index: desktop-entry-spec/desktop-entry-spec.xml
===================================================================
--- desktop-entry-spec.orig/desktop-entry-spec.xml	2006-05-20 10:07:48.000000000 +0200
+++ desktop-entry-spec/desktop-entry-spec.xml	2006-05-20 10:18:45.000000000 +0200
@@ -421,26 +421,6 @@
 		<entry>1</entry>
 	  </row>
 	  <row>
-	    <entry id="key-swallowtitle"><varname>SwallowTitle</varname></entry>
-	    <entry>
-           If entry is swallowed onto the panel, this should be the title of the window.
-	    </entry>
-	    <entry>localestring</entry>
-	    <entry>NO</entry>
-	    <entry>NO</entry>
-		<entry>1</entry>
-	  </row>
-	  <row>
-	    <entry id="key-swallowexec"><varname>SwallowExec</varname></entry>
-	    <entry>
-           Program to exec if swallowed app is clicked.
-	    </entry>
-	    <entry>string</entry>
-	    <entry>NO</entry>
-	    <entry>NO</entry>
-		<entry>1</entry>
-	  </row>
-	  <row>
 	    <entry id="key-actions"><varname>Actions</varname></entry>
 	    <entry>
            Additional actions possible, see MIME type discussion in <xref linkend="mime-types"/>.
@@ -951,7 +931,7 @@
       <listitem>
         <para>
           Deprecated keys: <varname>MiniIcon</varname> (small icon for
-          menus, etc), <varname>TerminalOptions</varname> (if the
+          menus, etc.), <varname>TerminalOptions</varname> (if the
           program runs in a terminal, any options that should be
           passed to the terminal emulator before actually executing
           the program), <varname>Protocols</varname>,
@@ -962,6 +942,17 @@
       </listitem>
       <listitem>
         <para>
+	  The <literal>SwallowTitle</literal> and
+	  <literal>SwallowExec</literal> keys are deprecated.
+	  The <literal>SwallowTitle</literal> key is of type
+	  <literal>localestring</literal> and specifies the title of the window
+	  if is swallowed onto the panel. The <literal>SwallowExec</literal>
+	  key is of type <literal>string</literal> and specifies the
+	  program to exec if swallowed app is clicked.
+        </para>
+      </listitem>
+      <listitem>
+        <para>
     Historically some booleans have been represented by the numeric
     entries <constant>0</constant> or <constant>1</constant>. With
     this version of the standard they are now to be represented as a
_______________________________________________
xdg mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/xdg

Reply via email to