7 Nokia Corporation - initial contribution. |
7 Nokia Corporation - initial contribution. |
8 Contributors: |
8 Contributors: |
9 --> |
9 --> |
10 <!DOCTYPE concept |
10 <!DOCTYPE concept |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
12 <concept id="GUID-EC49B54F-7724-433B-BD7F-201DE3B7DAA6" xml:lang="en"><title>Resource |
12 <concept id="GUID-EC49B54F-7724-433B-BD7F-201DE3B7DAA6" xml:lang="en"><title>Resource file structure</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
13 file structure</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
13 <p><xref href="GUID-5F749184-C804-41FC-BA81-038783BDC967.dita">Resource</xref> files may consist of comments, C++ pre-processor statements, and |
14 <p><xref href="GUID-5F749184-C804-41FC-BA81-038783BDC967.dita">Resource</xref> files |
14 structure statements indicated by predefined keywords.</p> |
15 may consist of comments, C++ pre-processor statements, and structure statements |
|
16 indicated by predefined keywords.</p> |
|
17 <p>For more information on the format of resource files, see <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/ToolsAndUtilities94/DevTools-ref/ResourceFileFormat/index.html#DevTools%2dref%2erss" format="application/java-archive">Resource file source format</xref>.</p> |
15 <p>For more information on the format of resource files, see <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/ToolsAndUtilities94/DevTools-ref/ResourceFileFormat/index.html#DevTools%2dref%2erss" format="application/java-archive">Resource file source format</xref>.</p> |
18 <p>For a commented example of a resource file, see <xref href="GUID-411ACFE6-0324-4330-ABCD-97A925759A3C.dita">Resource |
16 <p>For a commented example of a resource file, see <xref href="GUID-411ACFE6-0324-4330-ABCD-97A925759A3C.dita">Resource |
19 management example: HelloWorldBasic</xref>.</p> |
17 management example: HelloWorldBasic</xref>.</p> |
20 <p>A resource file has the following structure:</p> |
18 <p>A resource file has the following structure:</p> |
21 <section id="GUID-727A33A2-4324-4834-88B2-0D461C2A1732"><title>Comments</title> |
19 <section id="GUID-727A33A2-4324-4834-88B2-0D461C2A1732"><title>Comments</title> |
22 <p>You can use either C (<parmname>/* */</parmname>) or C++ (<parmname>//</parmname>) |
20 <p>You can use either C (<parmname>/* */</parmname>) or C++ (<parmname>//</parmname>) style comments.</p> |
23 style comments.</p> |
21 <p>For more information on the lexical conventions of resource |
24 <p>For more information on the lexical conventions of resource files, see |
22 files, see <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/ToolsAndUtilities94/DevTools-ref/ResourceFileFormat/Tool_Ref_RSS-file-format.conventions.html#DevTools%2dref%2erss%2e2" format="application/java-archive">Lexical conventions</xref>.</p> |
25 <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/ToolsAndUtilities94/DevTools-ref/ResourceFileFormat/Tool_Ref_RSS-file-format.conventions.html#DevTools%2dref%2erss%2e2" format="application/java-archive">Lexical conventions</xref>.</p> |
|
26 </section> |
23 </section> |
27 <section id="GUID-D8ED42A3-6BB7-4A7E-A0AB-3932D4366AAE"><title>NAME statements</title> |
24 <section id="GUID-D8ED42A3-6BB7-4A7E-A0AB-3932D4366AAE"><title>NAME |
28 <p>The first non-comment statement in a resource must be the <parmname>NAME</parmname> statement. |
25 statements</title> |
29 The syntax is as follows:</p> |
26 <p>The first non-comment statement in a resource must be the <parmname>NAME</parmname> statement. The syntax is as follows:</p> |
30 <codeblock id="GUID-C90E900E-4539-47BB-B51B-0F600B0DE86E" xml:space="preserve">NAME name</codeblock> |
27 <codeblock id="GUID-C90E900E-4539-47BB-B51B-0F600B0DE86E" xml:space="preserve">NAME name</codeblock> |
31 <p>where <parmname>name</parmname> is a 4 letter ID that is unique in the |
28 <p>where <parmname>name</parmname> is a 4 letter ID that is unique |
32 application. This ID is used to differentiate and access resource files when |
29 in the application. This ID is used to differentiate and access resource |
33 an application uses multiple resource files.</p> |
30 files when an application uses multiple resource files.</p> |
34 <p>For more information on the <parmname>NAME</parmname> statement, see <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/ToolsAndUtilities94/DevTools-ref/ResourceFileFormat/Tool_Ref_RSS-file-format-NAME.html#DevTools%2dref%2erss%2dname" format="application/java-archive">NAME statement</xref>. </p> |
31 <p>For more information on the <parmname>NAME</parmname> statement, |
|
32 see <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/ToolsAndUtilities94/DevTools-ref/ResourceFileFormat/Tool_Ref_RSS-file-format-NAME.html#DevTools%2dref%2erss%2dname" format="application/java-archive">NAME statement</xref>. </p> |
35 </section> |
33 </section> |
36 <section id="GUID-F27B120A-3B53-4B8A-828C-302B95E6E520"><title>C++ pre-processor |
34 <section id="GUID-F27B120A-3B53-4B8A-828C-302B95E6E520"><title>C++ pre-processor |
37 statements</title> |
35 statements</title> |
38 <p>The resource compiler supports a set of pre-processor statements, including:</p> |
36 <p>The resource compiler supports a set of pre-processor statements, |
|
37 including:</p> |
39 <ul> |
38 <ul> |
40 <li><p><parmname>#define</parmname></p></li> |
39 <li><p><parmname>#define</parmname></p></li> |
41 <li><p><parmname>#include</parmname></p></li> |
40 <li><p><parmname>#include</parmname></p></li> |
42 <li><p><parmname>#ifdef</parmname></p></li> |
41 <li><p><parmname>#ifdef</parmname></p></li> |
43 <li><p><parmname>#ifndef</parmname></p></li> |
42 <li><p><parmname>#ifndef</parmname></p></li> |
44 <li><p><parmname>#if</parmname></p></li> |
43 <li><p><parmname>#if</parmname></p></li> |
45 <li><p><parmname>#else</parmname></p></li> |
44 <li><p><parmname>#else</parmname></p></li> |
46 <li><p><parmname>#endif</parmname></p></li> |
45 <li><p><parmname>#endif</parmname></p></li> |
47 </ul> |
46 </ul> |
48 <p>For more information on the supported pre-processor statements, see |
47 <p>For more information on the supported pre-processor statements, |
49 <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/ToolsAndUtilities94/DevTools-ref/ResourceFileFormat/Tool_Ref_RSS-file-format.preprocess.html#DevTools%2dref%2erss%2e3" format="application/java-archive">C++ pre-processor statements</xref>.</p> |
48 see <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/ToolsAndUtilities94/DevTools-ref/ResourceFileFormat/Tool_Ref_RSS-file-format.preprocess.html#DevTools%2dref%2erss%2e3" format="application/java-archive">C++ pre-processor statements</xref>.</p> |
50 <p>Typically, resource files contain <parmname>#includes</parmname> statements |
49 <p>Typically, resource files contain <parmname>#includes</parmname> statements for the following files:</p> |
51 for the following files:</p> |
|
52 <ul> |
50 <ul> |
53 <li><p><parmname>appinfo.rh</parmname></p></li> |
51 <li><p><parmname>appinfo.rh</parmname></p></li> |
54 <li><p><parmname>avkon.rh</parmname></p></li> |
52 <li><p><parmname>avkon.rh</parmname></p></li> |
55 <li><p><parmname>avkon.rsg</parmname></p></li> |
53 <li><p><parmname>avkon.rsg</parmname></p></li> |
56 <li><p><parmname>eikon.rh</parmname></p></li> |
54 <li><p><parmname>eikon.rh</parmname></p></li> |
57 </ul> |
55 </ul> |
58 <p>These files are located under the <parmname>/Epoc32/include</parmname> folder. |
56 <p>These files are located under the <parmname>/Epoc32/include</parmname> folder. They contain the structure declarations for commonly used |
59 They contain the structure declarations for commonly used data structures |
57 data structures in the Symbian platform.</p> |
60 in the Symbian platform.</p> |
|
61 |
58 |
62 </section> |
59 </section> |
63 <section id="GUID-9D5B35E3-21F3-4E22-B03B-8C9E6E1027C9"><title>RESOURCE statements |
60 <section id="GUID-9D5B35E3-21F3-4E22-B03B-8C9E6E1027C9"><title>RESOURCE |
64 syntax</title> |
61 statements syntax</title> |
65 <p>The RESOURCE keyword is used to declare a resource in a resource file. |
62 <p>The RESOURCE keyword is used to declare a resource in a resource |
66 The syntax is as follows:</p> |
63 file. The syntax is as follows:</p> |
67 <codeblock id="GUID-88C7579F-4917-488F-8834-0579A3150D85" xml:space="preserve">RESOURCE <STRUCT_NAME> | <resource_name> | |
64 <codeblock id="GUID-88C7579F-4917-488F-8834-0579A3150D85" xml:space="preserve">RESOURCE <STRUCT_NAME> | <resource_name> | |
68 { |
65 { |
69 <resource-initialiser-list> |
66 <resource-initialiser-list> |
70 }</codeblock> |
67 }</codeblock> |
71 <p>where:</p> |
68 <p>where:</p> |
72 <ul> |
69 <ul> |
73 <li><p><parmname><STRUCT_NAME></parmname> is the name of a declared |
70 <li><p><parmname><STRUCT_NAME></parmname> is the name |
74 data structure in an included resource header file.</p><p><parmname><STRUCT_NAME></parmname> must |
71 of a declared data structure in an included resource header file.</p> |
75 be in upper case.</p></li> |
72 <p><parmname><STRUCT_NAME></parmname> must be in upper case.</p> |
76 <li><p><parmname>resource_name</parmname> identifies the resource |
|
77 .</p><p><parmname>resource_name</parmname> must be in lower case.</p> |
|
78 </li> |
73 </li> |
79 <li><p><parmname>resource-initialiser-list</parmname> contains the |
74 <li><p><parmname>resource_name</parmname> identifies the |
80 values the members of the structure should be initialized with when the default |
75 resource .</p><p><parmname>resource_name</parmname> must be |
81 values should not be used.</p></li> |
76 in lower case.</p></li> |
|
77 <li><p><parmname>resource-initialiser-list</parmname> contains |
|
78 the values the members of the structure should be initialized with |
|
79 when the default values should not be used.</p></li> |
82 </ul> |
80 </ul> |
83 <p><parmname>RESOURCE</parmname> statements may include resources defined |
81 <p><parmname>RESOURCE</parmname> statements may include resources |
84 within other resource statements in the resource file. For example:</p> |
82 defined within other resource statements in the resource file. For |
|
83 example:</p> |
85 <codeblock id="GUID-7F4CC81B-A596-4341-ACF2-61FEF518A9FF" xml:space="preserve">RESOURCE EIK_APP_INFO |
84 <codeblock id="GUID-7F4CC81B-A596-4341-ACF2-61FEF518A9FF" xml:space="preserve">RESOURCE EIK_APP_INFO |
86 { |
85 { |
87 menubar = r_name; |
86 menubar = r_name; |
88 }</codeblock> |
87 }</codeblock> |
89 <p>uses a resource declared in a later statement to define its menu bar. |
88 <p>uses a resource declared in a later statement to define its |
90 For more information, see<xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-resource/uikon/EIK_APP_INFO.html#EIK_APP_INFO" format="application/java-archive"><parmname>EIK_APP_INFO</parmname></xref>.</p> |
89 menu bar. For more information, see<xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-resource/uikon/EIK_APP_INFO.html#EIK_APP_INFO" format="application/java-archive"><parmname>EIK_APP_INFO</parmname></xref>.</p> |
91 <p>Resource statements may also included nested resource structures. For |
90 <p>Resource statements may also included nested resource structures. |
92 example:</p> |
91 For example:</p> |
93 <codeblock id="GUID-4A787831-2658-4BC0-939A-1346C3C05FE4" xml:space="preserve">RESOURCE MENU_PANE r_name2 |
92 <codeblock id="GUID-4A787831-2658-4BC0-939A-1346C3C05FE4" xml:space="preserve">RESOURCE MENU_PANE r_name2 |
94 { |
93 { |
95 items = |
94 items = |
96 { |
95 { |
97 MENU_TITLE |
96 MENU_TITLE |
99 menu_pane = r_name3; |
98 menu_pane = r_name3; |
100 } |
99 } |
101 }; |
100 }; |
102 }</codeblock> |
101 }</codeblock> |
103 <p>For more information on the <parmname>MENU_PANE</parmname> resource |
102 <p>For more information on the <parmname>MENU_PANE</parmname> resource |
104 see , <xref href="GUID-E849C798-07A0-47B3-BDBF-203325062FBD.dita">Menu bar resource |
103 see , <xref href="GUID-E849C798-07A0-47B3-BDBF-203325062FBD.dita">Menu |
105 statements</xref>.</p> |
104 bar resource statements</xref>.</p> |
106 <p>For more information on structures, see:</p> |
105 <p>For more information on structures, see:</p> |
107 <ul> |
106 <ul> |
108 <li><p><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/ToolsAndUtilities94/DevTools-ref/ResourceFileFormat/Tool_Ref_RSS-file-format.struct.html#DevTools%2dref%2erss%2dstruct" format="application/java-archive">STRUCT |
107 <li><p><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/ToolsAndUtilities94/DevTools-ref/ResourceFileFormat/Tool_Ref_RSS-file-format.struct.html#DevTools%2dref%2erss%2dstruct" format="application/java-archive">STRUCT statement</xref></p></li> |
109 statement</xref></p></li> |
|
110 <li><p><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/ToolsAndUtilities94/DevTools-ref/ResourceFileFormat/Tool_Ref_RSS-file-format.struct-member.html#DevTools%2dref%2erss%2ddefine%2dmember" format="application/java-archive">STRUCT member types</xref></p></li> |
108 <li><p><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/ToolsAndUtilities94/DevTools-ref/ResourceFileFormat/Tool_Ref_RSS-file-format.struct-member.html#DevTools%2dref%2erss%2ddefine%2dmember" format="application/java-archive">STRUCT member types</xref></p></li> |
111 <li><p><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/ToolsAndUtilities94/DevTools-ref/ResourceFileFormat/Tool_Ref_RSS-file-format.arrays.html#DevTools%2dref%2erss%2darray" format="application/java-archive">Arrays |
109 <li><p><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/ToolsAndUtilities94/DevTools-ref/ResourceFileFormat/Tool_Ref_RSS-file-format.arrays.html#DevTools%2dref%2erss%2darray" format="application/java-archive">Arrays within structs</xref></p></li> |
112 within structs</xref></p></li> |
|
113 </ul> |
110 </ul> |
114 <p>For more on resource statements, see:</p> |
111 <p>For more on resource statements, see:</p> |
115 <ul> |
112 <ul> |
116 <li><p><xref href="GUID-23A60DE7-B72D-41BD-9F1E-882D31A7E3C7.dita">Required |
113 <li><p><xref href="GUID-23A60DE7-B72D-41BD-9F1E-882D31A7E3C7.dita">Required resource file statements</xref></p></li> |
117 resource file statements</xref></p> |
114 <li><p><xref href="GUID-2C74E932-B1CA-434B-AF96-66D52D689620.dita">Optional resource file statements</xref></p></li> |
118 </li> |
115 <li><p><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/ToolsAndUtilities94/DevTools-ref/ResourceFileFormat/Tool_Ref_RSS-file-format.resource.html#DevTools%2dref%2erss%2dresource" format="application/java-archive">RESOURCE statement</xref>.</p></li> |
119 <li><p><xref href="GUID-2C74E932-B1CA-434B-AF96-66D52D689620.dita">Optional |
|
120 resource file statements</xref></p> |
|
121 </li> |
|
122 <li><p><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/ToolsAndUtilities94/DevTools-ref/ResourceFileFormat/Tool_Ref_RSS-file-format.resource.html#DevTools%2dref%2erss%2dresource" format="application/java-archive">RESOURCE |
|
123 statement</xref>.</p></li> |
|
124 </ul> |
116 </ul> |
125 </section> |
117 </section> |
126 </conbody></concept> |
118 </conbody></concept> |