Symbian Getting Started - Project File & Name Specifications

xiaoxiao2021-03-06  41

After new Symbian Project, you will see a lot of strange suffixes in the project folder: .mmp, .hrh ... ... there will be many strange prefix during programming: r-, t -........ Will talk to them. - Feng Xiao Yun --------------------------------- The new project under Symbian OS contains multiple folders, and the specific role refers to "Symbian Getting Started Guide - Contact". The following mainly introduces several important documents:

1../ Group / *. MMP (Project Definition File) Symbian OS Development Project To generate a program for different environments, if we run in the emulator (X86 instruction set), we use debuggered generation, so you can perform relevant debugging; If you target your target, use the ARM instruction set, so the published code is of course different. Different item files are required because each type of generation requires different project files. For simplicity, a general project definition file is established, and then the file is translated into a corresponding project file for different generating environments. The following is a simple sample: //hello.mmpTARGET Hello.exeTARGETTYPE exeSOURCEPATH .UID 0SOURCE hello.cppUSERINCLUDE .SYSTEMINCLUDE / epco32 / includeLIBRARY euser.lib defined above information is sufficient to specify the entire project TARGET resulting executable file is confirmed that TARGETTYPE The location UID of the Exe sourcePath project source file is independent, mainly for the GUI program Source Source File Information Userinclude SystemInClude Top Two parameters Specify the user search directory library to link library information, running time you need to call

2. ../group/bld.inf (Component Definition File) Symbian OS Build Tool also needs to submit a component definition file, the name of this file is bld.inf, which contains a list of all project definition files, only one in most cases file. Some will also contain more information related to the generation. //Brd.infprj_mmpfileshello.mmp

3. ../inc/*.hrh extension is. HRH file is designed to be included in the C program and resource script, the C program requires them to indicate the processed command, and the resource script requires them to indicate command. It contains enumeration constants for the application command. ENUM Thelloids {EHELLOCOMMAND1 = 1 // Start Value Must NOT BE 0};

4. ../group/.rss (resource file) Used to define resources, such as string r_hello_text_item1, enumeration variable Ehellocmd1, UI menu, and shortcuts, etc. Let's take a look at the entire resource file .RSS: head name hell # include #include #include #include "Hello.hrh"

The name provided in the Name statement is used to generate some IDs of each resource in the file. If the application uses multiple resource files, you must ensure that the name is different, and the ID conflict between the resources of different files is not caused. #include statement loads the definition of structures and constants used within the resource file.

Define shortcuts and menu application shortcuts in the HotKeys resource, indicated by symbol ID r_hellogui_hotkeys, which is used in conjunction with symbol IDs given in EIK_APP_INFO resources. (Generally does not specify shortcuts for UIQ or S60 applications, because these devices do not have a keyboard)

The menu routines are as follows: resource menu_bar r_hello_menubar {titles = {menu_title {menu_pane = r_hello_menu;}};

Resource menu_pane r_hello_menu {items = {menu_item {command = ehellocommand1; txt = "hello";}, menu_item {command = EaknsoftKeyExit; // command ID txt = "exit"; // command text}};} each menu item A command is associated with some text. If the corresponding menu item is added, simply use the code above the code to add Menu_Item.

String Resource Resource TBUF R_DEFAULT_DOCUMENT_NAME {BUF = "";} Correctly Building a Symbian OS application should allow all of its portable string resources to enable them to transplant strings without changing C code.

5. ../sis/.pkg (package file) is used to generate the installation package, enter the command makesys * .pkg can create * .sis, you can install this file to your phone. -------------------------------------------------- - Next to tell the naming specification developed in the Symbian OS, saying that it is more appropriate to make a habit, like the global variables in C use m_ .. macro variables and constants are similar to uppercase letters, in Symbian OS Development applications also have a commonly used naming specification, and more stringent than C . Class T-class TDESC, TPOINT..T class has no destructor. Their behavior is similar to the built-in type. This is why all built-in type TypeDef starts with T. T class can be allocated as an automatic variable, assigned as a member of other classes, or in the pile of C-class CACTIVE, CBASE .. distributed from CBase. Class C is always allocated on the default pile. When the object is assigned, the CBASE's Operator New () initials all member data to zero. CBASE also includes a false preframe function, thus calling Delete, correctly destructing any object R-class RFile, RTimer .. owns all classes on the default pile by correctly destructing DELETE. Usually allocated as a member variable or automatic variable; in a few cases, it can be assigned on the heap. Most R Class uses Close () to release the resource M class, interface MeikMenuobServer .. consists of pure virtual functions, and does not contain member data. Static class User, Math .. It is completely unforgettable static function. This class is a container of library functions

The data name enumeration often Emonday .. The constant in the enumeration itself should have a T preruption, and the enumeration is a member of the enumeration; #defined constant sometimes uses the E prefix constant krgbred .. # defined Type or Const Tint Type constant member variable IDEvice, ix .. Any non-static member variable parameter adevice .. declares that arbitrary variables of parameters, "a" represents parameter automatic variables Device, X .. declaration is any variable for automatic variables

In the Symbian OS, the sense of the first letter is not as important as the end of the letter. _L () Tail Letter is L, indicating an abnormal exit function, may need to allocate memory, open files, etc. In general, some operations that may fail due to insufficient resources or other related conditions. When such a function is called, it will always take into account the abnormality to exit. _LC () and L The function of the end is basically, but after allocating the object, put it into the cleaning stack (this concept will be described later). If the function fails, it is abnormally exiting.

There are also some function name requirements not very strict, which can follow the naming specifications in C . For the above, the reader can experience their actual use in the development process, here because there is limited space, there is no way to talk about a detailed one, and the remaining part requires you to carefully summarize.

转载请注明原文地址:https://www.9cbs.com/read-75619.html

New Post(0)