summaryrefslogtreecommitdiff
path: root/specs/appA.xml
blob: 76454dea0bbd3f2325bb5939bc092277db9e437d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">

<appendix id='Resource_File_Format'>
<title>Resource File Format</title>
<para>
A resource file contains text representing the default resource values for an
application or set of applications.
</para>

<para>
The format of resource files is defined by
<emphasis remap='I'>Xlib &mdash; C Language X Interface.</emphasis> and is reproduced here
for convenience only.
</para>

<para>The format of a resource specification is</para>
<informaltable frame='none'>
  <?dbfo keep-together="always" ?>
  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
  <colspec colwidth='0.3*' colname='c1'/>
  <colspec colwidth='1.0*' colname='c2'/>
  <tbody>
    <row>
      <entry>ResourceLine</entry>
      <entry>= Comment | IncludeFile | ResourceSpec | &lt;empty line&gt;</entry>
    </row>
    <row>
      <entry>Comment</entry>
      <entry>=&ldquo;!&rdquo; {&lt;any character except null or newline&gt;}</entry>
    </row>
    <row>
      <entry>IncludeFile</entry>
      <entry>= &ldquo;#&rdquo; WhiteSpace &ldquo;include&rdquo; WhiteSpace FileName WhiteSpace</entry>
    </row>
    <row>
      <entry>FileName</entry>
      <entry>= &lt;valid filename for operating system&gt;</entry>
    </row>
    <row>
      <entry>ResourceSpec</entry>
      <entry>= WhiteSpace ResourceName WhiteSpace &ldquo;:&rdquo; WhiteSpace Value</entry>
    </row>
    <row>
      <entry>ResourceName</entry>
      <entry>= [Binding] {Component Binding} ComponentName</entry>
    </row>
    <row>
      <entry>Binding</entry>
      <entry>=&ldquo;.&rdquo; | &ldquo;*&rdquo;</entry>
    </row>
    <row>
      <entry>WhiteSpace</entry>
      <entry>= {&lt;space> | &lt;horizontal tab&gt;}</entry>
    </row>
    <row>
      <entry>Component</entry>
      <entry>= &ldquo;?&rdquo; | ComponentName</entry>
    </row>
    <row>
      <entry>ComponentName</entry>
      <entry>= NameChar {NameChar}</entry>
    </row>
    <row>
      <entry>NameChar</entry>
      <entry>= &ldquo;a&rdquo;&ndash;&ldquo;z&rdquo; | &ldquo;A&rdquo;&ndash;&ldquo;Z&rdquo; | &ldquo;0&rdquo;&ndash;&ldquo;9&rdquo; | &ldquo;_&rdquo; | &ldquo;-&rdquo;</entry>
    </row>
    <row>
      <entry>Value</entry>
      <entry>={&lt;any character except null or unescaped newline&gt;}</entry>
    </row>
  </tbody>
  </tgroup>
</informaltable>

<para>
Elements separated by vertical bar (|) are alternatives.
Curly braces ({...}) indicate zero or more repetitions
of the enclosed elements.
Square brackets ([...]) indicate that the enclosed element is optional.
Quotes (&ldquo;...&rdquo;) are used around literal characters.
</para>

<para>
If the last character on a line is a backslash (\),
that line is assumed to continue on the next line.
</para>

<para>
To allow a Value to begin with whitespace,
the two-character sequence &ldquo;\<emphasis remap='I'>space</emphasis>&rdquo; (backslash followed by space)
is recognized and replaced by a space character,
and the two-character sequence &ldquo;\<emphasis remap='I'>tab</emphasis>&rdquo;
(backslash followed by horizontal tab)
is recognized and replaced by a horizontal tab character.
</para>
<para>
To allow a Value to contain embedded newline characters,
the two-character sequence &ldquo;\n&rdquo; is recognized and replaced by a
newline character.
To allow a Value to be broken across multiple lines in a text file,
the two-character sequence &ldquo;\<emphasis remap='I'>newline</emphasis>&rdquo;
(backslash followed by newline) is
recognized and removed from the value.
</para>
<para>
To allow a Value to contain arbitrary character codes,
the four-character sequence &ldquo;\<emphasis remap='I'>nnn</emphasis>&rdquo;,
where each <emphasis remap='I'>n</emphasis> is a digit character in the range of &ldquo;0&rdquo;&ndash;&ldquo;7&rdquo;,
is recognized and replaced with a single byte that contains
the octal value specified by the sequence.
Finally, the two-character sequence &ldquo;\\&rdquo; is recognized
and replaced with a single backslash.
</para>
</appendix>