Much of the information that defines the appearance, behaviour and functionality of a Symbian OS application is stored externally to the main body of the program, in a resource file. This is unlike some other programming environments, in which a single executable contains all the code and information used by the application. Resource files can have the advantages that information is loaded only when needed, which can reduce RAM requirements, they can be compressed, and they can be localised without needing to recompile the main program.

Resource files are developed as text files written in a Symbian OS-specific resource language. These source files are then compiled into a binary file format that can be loaded and read by programs. The source files can be compiled on their own using the command-line resource builder tool (epocrc), or as part of the standard project building process either from the command-line or from within an IDE.

Purposes of resource files
Resource files are used for the following purposes:

to define the application user interface. The C++ application programming framework requires that some aspects of an application’s layout and behaviour, such as the menu bars and dialogs, are defined in a resource file

to define application properties that are used by the application launcher or system shell.

Until v9.0, (.aif) are used to define the application's icon and caption, and various properties, for instance whether the application is exposed to users or hidden, whether the application can be embedded, and the priority at which the application should be associated with MIME data types.

From v9.0, aif files are replaced by application registration information. The caption and icon are defined either in a special resource file called a localisable icon/caption definition file, or, if more convenient, in the application's UI resource file. The application's properties and some other information is defined in another type of resource file called a registration file.

Literal strings and other constant data: for example, dialog text and error messages. The resource tool chain provides support for localisation of these.

File types reference
The resource compilation process uses a number of file types:

rss
resource source file

rls
defines localisable strings, for inclusion in the resource source file

h
header file, for inclusion in C++ file

rh
resource header, for inclusion in the resource source file

hrh
common C++ or resource header, for inclusion in either type of source file

rsg
resource header file output from the resource compiler

rsc
compiled resource file from the resource compiler


Related Posts :



0 comments