|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-EC49B54F-7724-433B-BD7F-201DE3B7DAA6" xml:lang="en"><title>Resource |
|
13 file structure</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <p><xref href="GUID-5F749184-C804-41FC-BA81-038783BDC967.dita">Resource</xref> files |
|
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> |
|
18 <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> |
|
20 <p>A resource file has the following structure:</p> |
|
21 <section id="GUID-727A33A2-4324-4834-88B2-0D461C2A1732"><title>Comments</title> |
|
22 <p>You can use either C (<parmname>/* */</parmname>) or C++ (<parmname>//</parmname>) |
|
23 style comments.</p> |
|
24 <p>For more information on the lexical conventions of resource files, see |
|
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> |
|
27 <section id="GUID-D8ED42A3-6BB7-4A7E-A0AB-3932D4366AAE"><title>NAME statements</title> |
|
28 <p>The first non-comment statement in a resource must be the <parmname>NAME</parmname> statement. |
|
29 The syntax is as follows:</p> |
|
30 <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 |
|
32 application. This ID is used to differentiate and access resource files when |
|
33 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> |
|
35 </section> |
|
36 <section id="GUID-F27B120A-3B53-4B8A-828C-302B95E6E520"><title>C++ pre-processor |
|
37 statements</title> |
|
38 <p>The resource compiler supports a set of pre-processor statements, including:</p> |
|
39 <ul> |
|
40 <li><p><parmname>#define</parmname></p></li> |
|
41 <li><p><parmname>#include</parmname></p></li> |
|
42 <li><p><parmname>#ifdef</parmname></p></li> |
|
43 <li><p><parmname>#ifndef</parmname></p></li> |
|
44 <li><p><parmname>#if</parmname></p></li> |
|
45 <li><p><parmname>#else</parmname></p></li> |
|
46 <li><p><parmname>#endif</parmname></p></li> |
|
47 </ul> |
|
48 <p>For more information on the supported pre-processor statements, see |
|
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> |
|
50 <p>Typically, resource files contain <parmname>#includes</parmname> statements |
|
51 for the following files:</p> |
|
52 <ul> |
|
53 <li><p><parmname>appinfo.rh</parmname></p></li> |
|
54 <li><p><parmname>avkon.rh</parmname></p></li> |
|
55 <li><p><parmname>avkon.rsg</parmname></p></li> |
|
56 <li><p><parmname>eikon.rh</parmname></p></li> |
|
57 </ul> |
|
58 <p>These files are located under the <parmname>/Epoc32/include</parmname> folder. |
|
59 They contain the structure declarations for commonly used data structures |
|
60 in the Symbian platform.</p> |
|
61 |
|
62 </section> |
|
63 <section id="GUID-9D5B35E3-21F3-4E22-B03B-8C9E6E1027C9"><title>RESOURCE statements |
|
64 syntax</title> |
|
65 <p>The RESOURCE keyword is used to declare a resource in a resource file. |
|
66 The syntax is as follows:</p> |
|
67 <codeblock id="GUID-88C7579F-4917-488F-8834-0579A3150D85" xml:space="preserve">RESOURCE <STRUCT_NAME> | <resource_name> | |
|
68 { |
|
69 <resource-initialiser-list> |
|
70 }</codeblock> |
|
71 <p>where:</p> |
|
72 <ul> |
|
73 <li><p><parmname><STRUCT_NAME></parmname> is the name of a declared |
|
74 data structure in an included resource header file.</p><p><parmname><STRUCT_NAME></parmname> must |
|
75 be in upper case.</p></li> |
|
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> |
|
79 <li><p><parmname>resource-initialiser-list</parmname> contains the |
|
80 values the members of the structure should be initialized with when the default |
|
81 values should not be used.</p></li> |
|
82 </ul> |
|
83 <p><parmname>RESOURCE</parmname> statements may include resources defined |
|
84 within other resource statements in the resource file. For example:</p> |
|
85 <codeblock id="GUID-7F4CC81B-A596-4341-ACF2-61FEF518A9FF" xml:space="preserve">RESOURCE EIK_APP_INFO |
|
86 { |
|
87 menubar = r_name; |
|
88 }</codeblock> |
|
89 <p>uses a resource declared in a later statement to define its menu bar. |
|
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> |
|
91 <p>Resource statements may also included nested resource structures. For |
|
92 example:</p> |
|
93 <codeblock id="GUID-4A787831-2658-4BC0-939A-1346C3C05FE4" xml:space="preserve">RESOURCE MENU_PANE r_name2 |
|
94 { |
|
95 items = |
|
96 { |
|
97 MENU_TITLE |
|
98 { |
|
99 menu_pane = r_name3; |
|
100 } |
|
101 }; |
|
102 }</codeblock> |
|
103 <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 |
|
105 statements</xref>.</p> |
|
106 <p>For more information on structures, see:</p> |
|
107 <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 |
|
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> |
|
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 |
|
112 within structs</xref></p></li> |
|
113 </ul> |
|
114 <p>For more on resource statements, see:</p> |
|
115 <ul> |
|
116 <li><p><xref href="GUID-23A60DE7-B72D-41BD-9F1E-882D31A7E3C7.dita">Required |
|
117 resource file statements</xref></p> |
|
118 </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> |
|
125 </section> |
|
126 </conbody></concept> |