diff -r 80ef3a206772 -r 48780e181b38 Symbian3/SDK/Source/GUID-EC49B54F-7724-433B-BD7F-201DE3B7DAA6.dita --- a/Symbian3/SDK/Source/GUID-EC49B54F-7724-433B-BD7F-201DE3B7DAA6.dita Fri Jul 16 17:23:46 2010 +0100 +++ b/Symbian3/SDK/Source/GUID-EC49B54F-7724-433B-BD7F-201DE3B7DAA6.dita Tue Jul 20 12:00:49 2010 +0100 @@ -1,126 +1,118 @@ - - - - - -Resource -file structure -

Resource files -may consist of comments, C++ pre-processor statements, and structure statements -indicated by predefined keywords.

-

For more information on the format of resource files, see Resource file source format.

-

For a commented example of a resource file, see Resource -management example: HelloWorldBasic.

-

A resource file has the following structure:

-
Comments -

You can use either C (/* */) or C++ (//) -style comments.

-

For more information on the lexical conventions of resource files, see - Lexical conventions.

-
-
NAME statements -

The first non-comment statement in a resource must be the NAME statement. -The syntax is as follows:

-NAME name -

where name is a 4 letter ID that is unique in the -application. This ID is used to differentiate and access resource files when -an application uses multiple resource files.

-

For more information on the NAME statement, see NAME statement.

-
-
C++ pre-processor -statements -

The resource compiler supports a set of pre-processor statements, including:

-
    -
  • #define

  • -
  • #include

  • -
  • #ifdef

  • -
  • #ifndef

  • -
  • #if

  • -
  • #else

  • -
  • #endif

  • -
-

For more information on the supported pre-processor statements, see - C++ pre-processor statements.

-

Typically, resource files contain #includes statements -for the following files:

-
    -
  • appinfo.rh

  • -
  • avkon.rh

  • -
  • avkon.rsg

  • -
  • eikon.rh

  • -
-

These files are located under the /Epoc32/include folder. -They contain the structure declarations for commonly used data structures -in the Symbian platform.

- -
-
RESOURCE statements -syntax -

The RESOURCE keyword is used to declare a resource in a resource file. -The syntax is as follows:

-RESOURCE <STRUCT_NAME> | <resource_name> | -{ -<resource-initialiser-list> -} -

where:

-
    -
  • <STRUCT_NAME> is the name of a declared -data structure in an included resource header file.

    <STRUCT_NAME> must -be in upper case.

  • -
  • resource_name identifies the resource -.

    resource_name must be in lower case.

    -
  • -
  • resource-initialiser-list contains the -values the members of the structure should be initialized with when the default -values should not be used.

  • -
-

RESOURCE statements may include resources defined -within other resource statements in the resource file. For example:

-RESOURCE EIK_APP_INFO - { - menubar = r_name; - } -

uses a resource declared in a later statement to define its menu bar. -For more information, seeEIK_APP_INFO.

-

Resource statements may also included nested resource structures. For -example:

-RESOURCE MENU_PANE r_name2 - { - items = - { - MENU_TITLE - { - menu_pane = r_name3; - } - }; - } -

For more information on the MENU_PANE resource -see , Menu bar resource -statements.

-

For more information on structures, see:

-
    -
  • STRUCT -statement

  • -
  • STRUCT member types

  • -
  • Arrays -within structs

  • -
-

For more on resource statements, see:

-
    -
  • Required -resource file statements

    -
  • -
  • Optional -resource file statements

    -
  • -
  • RESOURCE -statement.

  • -
-
+ + + + + +Resource file structure +

Resource files may consist of comments, C++ pre-processor statements, and +structure statements indicated by predefined keywords.

+

For more information on the format of resource files, see Resource file source format.

+

For a commented example of a resource file, see Resource +management example: HelloWorldBasic.

+

A resource file has the following structure:

+
Comments +

You can use either C (/* */) or C++ (//) style comments.

+

For more information on the lexical conventions of resource +files, see Lexical conventions.

+
+
NAME +statements +

The first non-comment statement in a resource must be the NAME statement. The syntax is as follows:

+NAME name +

where name is a 4 letter ID that is unique +in the application. This ID is used to differentiate and access resource +files when an application uses multiple resource files.

+

For more information on the NAME statement, +see NAME statement.

+
+
C++ pre-processor +statements +

The resource compiler supports a set of pre-processor statements, +including:

+
    +
  • #define

  • +
  • #include

  • +
  • #ifdef

  • +
  • #ifndef

  • +
  • #if

  • +
  • #else

  • +
  • #endif

  • +
+

For more information on the supported pre-processor statements, +see C++ pre-processor statements.

+

Typically, resource files contain #includes statements for the following files:

+
    +
  • appinfo.rh

  • +
  • avkon.rh

  • +
  • avkon.rsg

  • +
  • eikon.rh

  • +
+

These files are located under the /Epoc32/include folder. They contain the structure declarations for commonly used +data structures in the Symbian platform.

+ +
+
RESOURCE +statements syntax +

The RESOURCE keyword is used to declare a resource in a resource +file. The syntax is as follows:

+RESOURCE <STRUCT_NAME> | <resource_name> | +{ +<resource-initialiser-list> +} +

where:

+
    +
  • <STRUCT_NAME> is the name +of a declared data structure in an included resource header file.

    +

    <STRUCT_NAME> must be in upper case.

    +
  • +
  • resource_name identifies the +resource .

    resource_name must be +in lower case.

  • +
  • resource-initialiser-list contains +the values the members of the structure should be initialized with +when the default values should not be used.

  • +
+

RESOURCE statements may include resources +defined within other resource statements in the resource file. For +example:

+RESOURCE EIK_APP_INFO + { + menubar = r_name; + } +

uses a resource declared in a later statement to define its +menu bar. For more information, seeEIK_APP_INFO.

+

Resource statements may also included nested resource structures. +For example:

+RESOURCE MENU_PANE r_name2 + { + items = + { + MENU_TITLE + { + menu_pane = r_name3; + } + }; + } +

For more information on the MENU_PANE resource +see , Menu +bar resource statements.

+

For more information on structures, see:

+
    +
  • STRUCT statement

  • +
  • STRUCT member types

  • +
  • Arrays within structs

  • +
+

For more on resource statements, see:

+
    +
  • Required resource file statements

  • +
  • Optional resource file statements

  • +
  • RESOURCE statement.

  • +
+
\ No newline at end of file