In EPOC, much of the information that defines the appearance, behaviour and functionality of an application is stored in a resource file — external to the main body of the program. This is unlike some other programming environments, in which a single executable contains all the code and information used by the application.
The two types of resource file used in EPOC are application information files (aif
files) and resource files. The difference between these file types is that application information files define application behaviour within the system context, while ordinary resource files define the appearance and behaviour within an application.
The GUI tool AIF Builder provides a simple way to create aif
files: for details see Introduction to AIF Builder. It is possible though to write the required source files by hand, and compile them using command-line tools, and this section contains the information to do so.
This section describes some of the advantages gained by separating an application’s resources from its executable code, and provides a listing of the file types used in the resource compilation process.
For C++ programs, the Uikon programming framework requires that some aspects of an application’s layout and behaviour, such as the menu, are defined in a resource file.
This can have powerful implications for application development. Small changes to the resource file can change an application significantly.
Resource files are not restricted to declaring information used by the Uikon framework. A resource file might also, for example, define resources for dialog text, error messages, and program initialisation.
Again, the advantages of declaring user information in a resource file are that information is loaded only when needed, that resource files can be compressed, and that they can be localised without recompiling the main program.
The application information file is a special type of resource file, which defines application properties within the system context. These properties include:
the appearance of the application icon within the system shell
whether the application can be embedded
whether the application is visible in the system shell
whether new documents for the application can be created from the system shell
In addition, some applications support MIME types, and this property is also defined in the aif
file.
The structure of the application information resource file is similar to that of the ordinary resource file. However, since the information to be contained is pre-defined, formatting of aif
resource files is very simple.
The resource compilation process uses a number of file types:
|
Resource files are usually delivered with other application files as part of an installation file — see Application Installation Guide.
The installation file should be configured so that the aif
file is copied to the same directory as its associated application file. If the application is to appear on the shell, this should be the directory \System\Apps\
AppName
\
folder in any drive.