PilRC

`About - Download - History - Archive - Manual - Contributors`

## PilRC v3.2 (Palm internal version) User Manual | Aaron Ardiri (aaron@ardiri.com) Ben Combee (combee@techwood.org) John Marshall (jmarshall@users.sf.net) 17 July 2004

Check the PilRC home page for the latest version.

Description

PilRC -- A resource compiler for the Palm Computing Platform

Table of Contents

Usage
Understanding the Manual
Resource Language Reference
International Support
Known Bugs
Further Reading

Usage

`pilrc` |  | ``[-L LANGUAGE]` `[-I INCLUDE PATH]` `[-D MACRO(=VAL)]` `[-R RESFILE]` `[-H INCLUDE PATH]` `[-ro]` `[-ts]` `[-q]` `[-V]` `[-Loc CODE]` `[-StripLoc]` `[-Fh]` `[-Fj]` `[-F5]` `[-Fg]` `[-Fkm]` `[-Fkt]` `[-Fc]` `[-allowEditID]` `[-allowBadSize]` `[-allowLargeRes]` `[-LE32]` `[-noIFIH]` `[-AppIcon68K]` `[-amdc NAME]` `[-noEllipsis]` `[-o OUTPUTPATH]` `[-M]` `[-MD]` `file.rcp` `[output path]``
`pilrcui` |  | ``[-L LANGUAGE]` `file.rcp``

-L LANGUAGE | Generate resource files translated to the target language LANGUAGE -- see the International Support section for details. This option may be given more than once if so desired.
-I INCLUDE PATH | Search INCLUDE PATH when looking for include or bitmap files. NOTE: multiple paths be repeating the -I option.
-D MACRO[=VAL] | Define a pre-processor symbol with an optional value. The macros defined with the -D option can be referenced in #ifdef statements in the resource file for conditional compilation. NOTE: if no value is specified, the symbol will given the value of 1.
-R RESFILE | Output a `.res` file specifying all the resources emitted by `PilRC`.
-H INCFILE | Output a `.h` file containing auto-generated resource item IDs for resource items that were defined without an ID previously. NOTE: If -H is not specified then undefined IDs are considered errors.
-ro | Output a single .ro file in PRC format containing all the generated resources, instead of a collection of .bin files.
-ts | Put POSIX timestamp on .ro file generated.
-q | Less noisy output, for you minimalists.
-V | Generate M$ (VS-style) warning/error output (default is GNU-style).
-Fh | Use Hebrew font widths for AUTO width calculations.
-Fj | Use Japanese font widths for AUTO width calculations.
-F5 | Use Chinese (Big5) font widths for AUTO width calculations.
-Fg | Use Chinese (GB) font widths for AUTO width calculations.
-Fkm | Use Korean font widths for AUTO width calculations (Hanme font)
-Fkt | Use Korean font widths for AUTO width calculations (Hantip font)
-Fc | Use Cyrillic font widths for AUTO width calculations.
-allowEditID | Allow the use of "edit menu" ID values (10000-10007 inclusive) which are usually reserved to Palm.
-allowBadSize | Turn off warnings about bitmaps used for icons not matching the suggested sizes from the Palm OS UI guidelines.
-allowLargeRes | Turn off warnings about resources being emitted that exceed the safe size allowed for HotSync and Exchange Manager on most Palm OS devices.
-noEllipsis | Disable special handling of "..." and ellipsis character.
-palmRez | Uses the same default values than palmRez uses.
-noIFIH | Ignore includes files in header files.
-LE32 | Generate Little Endian 32 bits compatible resources (ARM, NT)
-AppIcon68K | Force AppIcon resources generation in 68K format.
-amdc NAME | Generate resource 'amdc' id=1 with NAME.dll as content.
file.rcp | Input file describing the resources to be emitted.
-Loc CODE | Compile only the resources with the attribute LOCALE "code" set. Supported LOCALEs: deDE, esES, enUS, frFR, itIT, jpJP.
-StripLoc | Don't compile "non localized resources". NOTE: "-Loc frFR -StripLoc" only includes the resources whose attribute "LOCALE" is set to "frFR". "-Loc frFR" only includes the resources whose attribute "LOCALE" is set to "frFR" and those without the attribute at all. When not specifying any of these options (-Loc -StripLoc) pilrc only includes the resources without any "LOCALE" attribute. Your rcp file should have all the localized resources tagged with the LOCALE and all non localized resources not having a "LOCALE" attribute. There are 2 different ways to distribute localized applications. Complete (standalone) French version: You need to use "-Loc frFR" when compiling. The generated prc will contain all non localized and all French localized resources. "Overlaid" version of your application: You would compile the "base" prc with no option at all. This base prc will contain only the non localized resources. You need to name it "XXX.prc". Then you would compile the "overlays", one for each language with "-Loc frFR -StripLoc". In this example, this would create a second PRC containing French resources only. This is different from the standalone version which includes French resources AND non localized resources. You have to name this prc "XXX_frFR.prc". However, this is not sufficient. You need an external tool to create the 'ovly' resources in both the base prc and the overlays. It is planned to have such a small tool available soon. This is a different approach than the one provided by the -L flag.
-type type | Specify the type to use when generating a prc directly (-ro). The type parameter MUST NOT be single quoted. Use abcd, not 'abcd'.
-creator crea | Specify the creator to use when generating a prc directly (-ro). The creator parameter MUST NOT be single quoted. Use abcd, not 'abcd'.
-name Name | Specify the database name to use when generating a prc directly (-ro).
-o OUTPUTPATH | Alternative way of specifying an output path (below).
-M | Generate dependency list only; suppress all other output. The list will be named the same as the input file, but with a .d extension appended.
-MD | Generate dependency list.
output path | Directory where .bin files should be generated, or name of the file to generate containing all the generated resources.

The resources generated are output as a collection of .bin files or as resources within a PRC file, depending on whether `-ro` is given:

- Without `-ro`, each resource is written as a separate file in the output path directory. Each output filename is constructed by appending the hexcode resource ID and ".bin" to the four character resource type.
- With `-ro`, the resources are written to a single file, with the name given by the `output path`. The extension ".ro" is added if the name has no extension. If no `output path` has been given, a filename is constructed from the input filename by replacing ".rcp" with ".ro" (or appending ".ro" if the input filename does not end in ".rcp"). It is possible to specify the type and creator directly using -type and -creator.

Example:

    pilrc myprogram.rcp
    pilrc -I c:\resources -L FRENCH myprogram.rcp
    pilrc -I c:\resources -L BIG5 -F5 -R myprogram.res myprogram.rcp c:\output
    pilrc -ro -o myresoures.ro myprogram.rcp
    pilrc -ro myprogram.rcp

Understanding the Manual

Syntax

Items in all CAPS appear as literals in the file.
Items enclosed in "<" and ">" are required fields.
Items enclosed in "[" and "]" are optional fields.

Each field's required type is indicated by a suffix after the field name (see below for types).

Types

`.i` | identifier example: `kFoo`
`.c` | character (may contain normal C style character escapes) example: `"O"`
`.s` | string (may contain normal C style character escapes) example: `"Click Me"`
`.ss` | multi line string `PilRC` will concatenate strings on separate lines example: `"Now is the time for all good " \` `"men to come and aid of their country"`
`.n` | number defined constant or simple arithmetic expression. Valid operators are "+", "-", "*" and "/". Precedence is left to right, unless changed with the use of parenthesis. NOTE: Math calculations are integer based. example: `23` `12+3+1` `12*(2+3)` `'PALM'`
`.p` | position co-ordinate may be a number, expression or one of the following keywords.
`AUTO` | Automatic width or height. Value is computed based on the text in the item.
`AUTO> <size.n>` | Constrained automatic width or height. Value is computed based on the text in the item, but if less than the number specified, is replaced by that number. For example, if you wanted a button that was at least 32 pixels wide, you could use this knowing that it would expand if the text got bigger.
`CENTER` | Centers the item either horizontally or vertically.
`CENTER@<coord.n>` | Centers the item at the co-ordinate following.
`RIGHT@<coord.n>` | Aligns the item at the right co-ordinate following.
`BOTTOM@<coord.n>` | Aligns the item at the bottom co-ordinate following.
`PREVLEFT` | Previous items left co-ordinate.
`PREVRIGHT` | Previous items right co-ordinate.
`PREVTOP` | Previous items top co-ordinate.
`PREVBOTTOM` | Previous items bottom co-ordinate.
`PREVWIDTH` | Previous items width.
`PREVHEIGHT` | Previous items height.
example: `PREVRIGHT+2` `CENTER@80/2` NOTE: `AUTO` and `CENTER` are not valid in arithmetic expressions.

Comments

Single line comments begin with "`//`".
Block comments exist between the "`/*`" and "`*/`" tokens.

Include Files

The `.rcp` file may contain `#include` directives.
This allows a programmer to have one header file for their project containing pre-defined resource IDs. Source code can reference the symbols as can `PilRC`.

`PilRC` understands four include file formats:

`.h` | `#define <Symbol.i><Value.n>`
`.inc` | `<Symbol.i> equ <Value.n>`
`.java, .jav` | `package <PackageName> public class <ClassName> { public static final short <Symbol.i> = <Value.n>; }`
`.rcp`, `.r*` | General PilRC source code

Files with any extension starting with `.r` will be included entirely as PilRC source code; files with the extension `.java` or `.jav` will be scanned for constants defined in Java syntax; and files with any other extension will be scanned for constants defined with either `#define` or `equ`. (All these filename extension comparisons are case-insensitive.)

Once defined, a symbol can be used in place of any number.

Preprocessor Macros and Conditionals

PilRC includes a rudimentary C-style preprocessor that can handle object-like macros and simple conditionals. The following are accepted:

`#define <Symbol.i>`
`#define <Symbol.i> <Value.n>`
`#define <Symbol.i> <StringValue.ss>`
`#undef <Symbol.i>`
`#ifdef <Symbol.i>`
`#ifndef <Symbol.i>`
`#else`
`#endif`

NOTE: neither function-like macros with parameters nor `#if` expressions are understood.

Resource Language Reference

The `.rcp` file may contain the following object definitions:

FORM | Form Resource
MENU | Form Menu Bar
ALERT | Alert Dialog Resource
VERSION | Version String
STRING | String Resource
STRINGTABLE | String List Resource
CATEGORIES | Default Category Names
APPLICATIONICONNAME | Application Icon Name
APPLICATION | Application Creator Identification
LAUNCHERCATEGORY | Default launcher Category Name
BITMAP, ICON, SMALLICON, etc | Bitmap or Icon Resource
TRAP | HackMaster Trap Resource
FONT | User Defined Font Resource
FONTFAMILY | User Defined Font Family Resource
FONTINDEX | Font Index table for Font Resource
FONTMAP | Font Map extension for Font Resource (i.e. japan)
HEX | Binary Resource (Hex/String based)
DATA | Binary Resource (Data File based)
INTEGER | 2-byte Integer Value
BYTELIST | 1-byte Integer Value List
WORDLIST | 2-byte Integer Value List
LONGWORDLIST | 4-byte Integer Value List
NAVIGATION | Form Navigation Order Specification
PALETTETABLE | Color List Resource
FEATURE | System reserved
GRAFFITIINPUTAREA | System reserved
COUNTRYLOCALISATION | System reserved
LOCALES | System reserved
KEYBOARD | System reserved
MIDI | Copy .aif or .mid to a Palm midi Resource
HARDSOFTBUTTONDEFAULT | System reserved
SYSAPPLICATIONPREFERENCES | System reserved
SEARCHTABLE | System reserved
TEXTTABLE | System reserved
TABLELIST | System reserved
CHARSETLIST | System reserved

The `.rcp` file may also contain the following directives:

TRANSLATION | Language Translation Strings
GENERATEHEADER | Generate a header file from IDs defined in the file
RESETAUTOID | Reset AutoID sequence number

FORM (tFRM)

    FORM ID <FormResourceId.n> AT (<Left.p> <Top.p> <Width.p> <Height.p>)
      [FRAME] [NOFRAME]
      [MODAL]
      [SAVEBEHIND] [NOSAVEBEHIND]
      [USABLE]
      [HELPID <HelpId.n>]
      [DEFAULTBTNID <BtnId.n>]
      [MENUID <MenuId.n>]
      [LOCALE <LocaleName.s>]
    BEGIN
      <OBJECTS>
    END

Where `<OBJECTS>` is one or more of:

`TITLE` | `<Title.ss>`
`BUTTON` | `<Label.ss> ID <Id.n> AT (<Left.p> <Top.p> <Width.p> <Height.p>) [USABLE] [NONUSABLE] [DISABLED] [LEFTANCHOR] [RIGHTANCHOR] [FRAME] [NOFRAME] [BOLDFRAME] [RECTFRAME] [FONT <FontId.n>] [GRAPHICAL] [BITMAPID <BitmapId.n>] [SELECTEDBITMAPID <BitmapId.n>]`
`PUSHBUTTON` | `<Label.ss> ID <Id.n> AT (<Left.p> <Top.p> <Width.p> <Height.p>) [USABLE] [NONUSABLE] [DISABLED] [LEFTANCHOR] [RIGHTANCHOR] [FONT <FontId>] [GROUP <GroupId.n>] [GRAPHICAL] [BITMAPID <BitmapId.n>] [SELECTEDBITMAPID <BitmapId.n>]`
`CHECKBOX` | `<Label.ss> ID <Id.n> AT (<Left.p> <Top.p> <Width.p> <Height.p>) [USABLE] [NONUSABLE] [DISABLED] [LEFTANCHOR] [RIGHTANCHOR] [FONT <FontId.n>] [GROUP <GroupId.n>] [CHECKED]`
`POPUPTRIGGER` | `<Label.ss> ID <Id.n> AT (<Left.p> <Top.p> <Width.p> <Height.p>) [USABLE] [NONUSABLE] [DISABLED] [LEFTANCHOR] [RIGHTANCHOR] [FONT <FontId.n>] [GRAPHICAL] [BITMAPID <BitmapId.n>] [SELECTEDBITMAPID <BitmapId.n>]`
`SELECTORTRIGGER` | `<Label.ss> ID <Id.n> AT (<Left.p> <Top.p> <Width.p> <Height.p>) [USABLE] [NONUSABLE] [DISABLED] [LEFTANCHOR] [RIGHTANCHOR] [FONT <FontId.n>] [GRAPHICAL] [BITMAPID <BitmapId.n>] [SELECTEDBITMAPID <BitmapId.n>]`
`REPEATBUTTON` | `<Label.ss> ID <Id.n> AT (<Left.p> <Top.p> <Width.p> <Height.p>) [USABLE] [NONUSABLE] [DISABLED] [LEFTANCHOR] [RIGHTANCHOR] [FRAME] [NOFRAME] [BOLDFRAME] [RECTFRAME] [FONT <FontId.n>] [GRAPHICAL] [BITMAPID <BitmapId.n>] [SELECTEDBITMAPID <BitmapId.n>]`
`LABEL` | `<Label.ss> ID <Id.n> AT (<Left.p> <Top.p>) [USABLE] [NONUSABLE] [FONT <FontId.n>]`
`FIELD` | `ID <Id.n> AT (<Left.p> <Top.p> <Width.p> <Height.p>) [USABLE] [NONUSABLE] [DISABLED] [LEFTALIGN] [RIGHTALIGN] [FONT <FontId.n>] [EDITABLE] [NONEDITABLE] [UNDERLINED] [SINGLELINE] [MULTIPLELINES] [DYNAMICSIZE] [MAXCHARS <MaxChars.n>] [AUTOSHIFT] [NUMERIC] [HASSCROLLBAR]`
`POPUPLIST` | `ID <ControlId.n> <ListId.n>`
`LIST` | `<Item.s> ... <Item.s> ID <Id.n> AT (<Left.p> <Top.p> <Width.p> <Height.p>) [USABLE] [NONUSABLE] [DISABLED] [VISIBLEITEMS <NumVisItems.n>] [FONT <FontId.n>] [SEARCH]`
`FORMBITMAP` | `AT (<Left.p> <Top.p>) [BITMAP <BitmapId.n>] [USABLE] [NONUSABLE]`
`GADGET` | `ID <Id.n> AT (<Left.p> <Top.p> <Width.p> <Height.p>) [USABLE] [NONUSABLE] [NONEXTENDED] [EXTENDED]`
`TABLE` | `ID <Id.n> AT (<Left.p> <Top.p> <Width.p> <Height.p>) [ROWS <NumRows.n>] [COLUMNS <NumCols.n>] [COLUMNWIDTHS <Col1Width.n> ... <ColNWidth.n>]`
`SCROLLBAR` | `ID <Id.n> AT (<Left.p> <Top.p> <Width.p> <Height.p>) [USABLE] [NONUSABLE] [VALUE <Value.n>] [MIN <MinValue.n>] [MAX <MaxValue.n>] [PAGESIZE <PageSize.n>]`
`GRAFFITISTATEINDICATOR` | `AT (<Left.p> <Top.p>)`
`NOGRAFFITISTATEINDICATOR`
`SLIDER` | `ID <Id.n> AT (<Left.p> <Top.p> <Width.p> <Height.p>) [USABLE] [NONUSABLE] [DISABLED] [VERTICAL] [FEEDBACK] [THUMBID <BitmapId.n>] [BACKGROUNDID <BitmapId.n>] [VALUE <Value.n>] [MIN <MinValue.n>] [MAX <MaxValue.n>] [PAGESIZE <PageSize.n>]`

Notes:

- `ID <Id.n>` can be replaced with `AUTOID`. `PilRC` will assign an identifier for each control which specifies `AUTOID`. This is useful for controls which you won't refer to within the application (ie: LABEL's). Auto ID numbers normally start at 9999 and count down, but that can be changed using the `RESETAUTOID` command.
- The bitmap referenced by the `FORMBITMAP` tag must appear as a separate resource in the rcp file via the `BITMAP` tag.
- `MAXCHARS` is required for `FIELD` tag to work properly.

- Any user defined fonts defined by `FONT` >= 128 and `FONT` <= 255 must be before above the FORM definition using the `FONT` tag.

- Any translations defined in the must be declared before the FORM definition using the `TRANSLATION` tag.
- `SEARCH` is option for `LIST` and works only with `POPUPTRIGGER`.
- `NOGRAFFITISTATEINDICATOR` is used to tell PilRC that your form intentionally has no Graffiti State Inficator, so it should not emit a warning it.

Example:

    FORM ID 1 AT (2 2 156 156)
      USABLE MODAL
      HELPID 1
      MENUID 1
      LOCALE "enUS"
    BEGIN
      TITLE "AlarmHack"
      LABEL "Repeat Datebook alarm sound" AUTOID AT (CENTER 16)
      PUSHBUTTON "1" ID 2001 AT (20 PrevBottom+2 12) AUTO GROUP 1
      PUSHBUTTON "2" ID 2002 AT (PrevRight+1 PrevTop PrevWidth PrevHeight) GROUP 1
      PUSHBUTTON "3" ID 2003 AT (PrevRight+1 PrevTop PrevWidth PrevHeight) GROUP 1

      LABEL "times. Ring again every" AUTOID AT (CENTER PrevBottom+2) FONT 0

      PUSHBUTTON "never" ID 3000 AT (13 PrevBottom+2 32 12) GROUP 2
      PUSHBUTTON "10 sec" ID 3001 AT (PrevRight+1 PrevTop PrevWidth PrevHeight) GROUP 2
      PUSHBUTTON "30 sec" ID 3002 AT (PrevRight+1 PrevTop PrevWidth PrevHeight) GROUP 2
      PUSHBUTTON "1 min" ID 3003 AT (PrevRight+1 PrevTop PrevWidth PrevHeight) GROUP 2

      LABEL "Alarm sound:" AUTOID AT (24 PrevBottom+4)
      POPUPTRIGGER "" ID 5000 AT (PrevRight+4 PrevTop 62 AUTO) LEFTANCHOR
      LIST "Standard" "Bleep" ID 6000 AT (PrevLeft PrevTop 52 1) VISIBLEITEMS 2 NONUSABLE
      POPUPLIST ID 5000 6000

      BUTTON "Test" ID 1202 AT (CENTER 138 AUTO AUTO)
      GRAFFITISTATEINDICATOR AT (100 100)
    END

MENU (MBAR)

    MENU ID <MenuResourceId.n>
    [LOCALE <LocaleName.s>]
    BEGIN
      <PULLDOWNS>
    END

Where `<PULLDOWNS>` is one or more of:

    PULLDOWN <PullDownTitle.s>
    BEGIN
      <MENUITEMS>
    END

Where `<MENUITEMS>` is one or more of:

    MENUITEM <MenuItem.s> ID <MenuItemId.n> [AccelChar.c]
    MENUITEM SEPARATOR [ID <MenuItemId.n>]

Example:

    MENU ID 100
    LOCALE "enUS"
    BEGIN
      PULLDOWN "File"
      BEGIN
        MENUITEM "Open..." ID 100 "O"
        MENUITEM SEPARATOR
        MENUITEM "Close..." ID 101 "C"
      END
      PULLDOWN "Options"
      BEGIN
        MENUITEM "Get Info..." ID 200 "I"
      END
    END

ALERT (Talt)

    ALERT ID <AlertResrouceId.n>
      [HELPID <HelpId.n>]
      [DEFAULTBUTTON <ButtonIdx.n>]
      [INFORMATION] [CONFIRMATION] [WARNING] [ERROR]
      [LOCALE <LocaleName.s>]
    BEGIN
      TITLE <Title.s>
      MESSAGE <Message.ss>
      BUTTONS <Button.s> ... <Button.s>
    END

Notes:

- The `DEFAULTBUTTON` tag can be used to specify the button number to select if the user switches to another application without pressing any button in the alert. The argument is the index of the button, where the left-most button is at index '0'.

Example:

    ALERT ID 1000
      HELPID 100
      DEFAULTBUTTON 1
      CONFIRMATION
      LOCALE "enUS"
    BEGIN
      TITLE "AlarmHack"
      MESSAGE "Continuing will cause you 7 years of bad luck\n" \
              "Are you sure?"
      BUTTONS "Ok" "Cancel"
    END

VERSION (tver)

    VERSION ID <VersionResourceId.n> <Version.s>
    VERSION <Version.s>

Notes:

- The ID can be 1 or 1000 - either will be accepted by the default launcher.

Example:

    VERSION ID 1 "1.0 beta"
    VERSION "1.0 beta"

STRING (tSTR)

    STRING ID <StringResourceId.n>
    [LOCALE <LocaleName.s>] <String.ss>
    STRING ID <StringResourceId.n>
    [LOCALE <LocaleName.s>] FILE <StringFile.s>

Notes:

- If string terminated by 3 '.' PilRC replace it by the char '...'.
- Character '\r' = 0x0D is replaced by '\n' = 0x0A.

Example:

    STRING ID 100 "This is a very long string that shows escape characters \n" \
                  "as well as continued .ss syntax strings"
    STRING ID 101 FILE "string.txt"

STRINGTABLE (tSTL)

    STRINGTABLE ID <StringTableResourceId.n>
    [LOCALE <LocaleName.s>] <PrefixString.ss>  ... <String.ss>

Notes:

- Using the `tSTL` resource:

  .. in a LIST

      [source.rcp]
      STRINGTABLE stringTableMetric
        "" "Litres" "Meters" "Celsius"    "Newtons"     "Kilograms"

      [source.c]
      MemHandle memHandle, memStringList;
      MemPtr    ptrTable;
      UInt16    count;

      memHandle = DmGetResource('tSTL', stringTableMetric);
      ptrTable  = (MemPtr)MemHandleLock(memHandle);

      // get the string count <-- "messy"
      count     =
        (*((UInt8 *)(ptrTable + StrLen((Char *)ptrTable) + 1)) << 8) |
         *((UInt8 *)(ptrTable + StrLen((Char *)ptrTable) + 2));

      // get the handle to an array of strings
      memStringList =
        SysFormPointerArrayToStrings(ptrTable + StrLen((Char *)ptrTable) + 3, count);

      // NOTE: the "prefix" is ignored here
      ...

      MemHandleUnlock(memHandle);
      DmReleaseResource(memHandle);

  .. to get a single STRING

      [source.rcp]
      STRINGTABLE stringTableTypes
        "Units are:" "Metric" "Imperial"

      [source.c]
      Char string[32];
      SysStringByIndex(stringTableTypes, 0, string, 32);

- a limitation of 384 strings apply

  Example:

      STRINGTABLE ID 100 "" "One" "Two" "Three" "Four"
      STRINGTABLE ID 100 "-" "One" "Two" "Three" "Four"

  CATEGORIES (tAIS)

      CATEGORIES ID <CategoryResourceId.n>
      [LOCALE <LocaleName.s>] <Category1.s> ... <Category2.s>

  Notes:
  - The CATEGORIES tag can be used to specify the default category names for the application.
    This resource can then be passed to the "CategoryInitialize()" API function function to create the category strings in the application info block.

  Example:

      CATEGORIES ID 100 "Unfiled" "Business" "Personal"

  APPLICATIONICONNAME (tAIN)

      APPLICATIONICONNAME ID <AINResourceId.n>
      [LOCALE <LocaleName.s>] <ApplicationName.s>

  Example:

      APPLICATIONICONNAME ID 100 "AlarmHack"

  APPLICATION (APPL)

      APPLICATION ID <ApplResourceId.n>
      [LOCALE <LocaleName.s>] <APPL.s>

  Notes:
  - `<APPL.s>` must be 4 characters long.
  - `<APPL.s>` represents the creator id for the application, which can be registered at http://www.palm.com/

  Example:

      APPLICATION ID 1 "PALM"

  LAUNCHERCATEGORY (taic)

      LAUNCHERCATEGORY [ID <LaunchCatResourceId.n>]
      [LOCALE <LocaleName.s>] <APPL.s>

  Example:

      LAUNCHERCATEGORY "Games"
      LAUNCHERCATEGORY ID 1000 "Games"

  BITMAP, ICON, and SMALLICON (Tbmp, Sbmp, tAIB, Tbsb)

  There are several different ways of specifying bitmaps and icons: PilRC's original simple syntax for individual bitmaps; two extensions of that syntax allowing several individual bitmaps of different bit depths to be collected into one resource (a bitmap family); and a newer more flexible syntax for specifying bitmap families.

  Common to all of these syntaxes is a set of `<BitmapAttributes>` that may be used to specify various aspects of bitmap processing:

      [NOCOMPRESS] [COMPRESS] [FORCECOMPRESS]
      [COMPRESSSCANLINE] [COMPRESSRLE] [COMPRESSPACKBITS] [COMPRESSBEST]
      [NOCOLORTABLE] [COLORTABLE] [BITMAPPALETTE <Filename.s>]
      [TRANSPARENT <R.n> <G.n> <B.n>] [TRANSPARENTINDEX <Index.n>]

  These control compression of the bitmap pixel data, whether a color table should be output, what palette to use if not the default Palm OS palette, and which color, if any, is really transparent. `BITMAPPALETTE` takes a file containing one color per line, each consisting of decimal red, green, and blue components (0..255) separated by whitespace.

  The flexible bitmap family syntax is the only way to specify high-density bitmaps. Individual bitmaps are added to the family as specified by their `BPP` and `DENSITY` values, and attributes can be specified for each individual bitmap separately:

      BITMAP [<ResType.s>] ID <ResId.n> [LOCALE <Locale.s>]
        [<BitmapCompression>...]
      BEGIN
        BITMAP <Filename.s> BPP <Depth.n> [<BitmapAttribute>...] [DENSITY <Density.n>]
        ...
      END

      [SMALL]ICON [ID <ResId.n>] [LOCALE <Locale.s>]
        [<BitmapCompression>...]
      BEGIN
        BITMAP <Filename.s> BPP <Depth.n> [<BitmapAttribute>...] [DENSITY <Density.n>]
        ...
      END

  - `BPP` must be one of 1, 2, 4, 5, 8, or 16 (5 means 4bpp/16 colors; compare to `BITMAPFAMILYSPECIAL` below).
  - `DENSITY` must be 1 or 72 (single density, which is the default), 108 (one and a half), or 2 or 144 (double density). (The values 1 and 2 are supported for legacy reasons.) Generally a bitmap family must contain at least one single-density member.
  - `DENSITY` may appear anywhere amongst the list of `<BitmapAttributes>`; it need not be last.
  - For compatibility with previous versions of PilRC, the keywords `BITMAPFAMILYEX`, `ICONFAMILYEX`, and `SMALLICONFAMILYEX` may also be used to introduce this style of bitmap or icon family definition; each is equivalent to the corresponding keyword without "`FAMILYEX`".
  - You may include `<BitmapCompression>` options in the prelude to provide a default for all the bitmaps in the family (which may be overridden by an individual bitmap's attributes); it may contain any `<BitmapAttribute>` related to compression, namely those in the first two lines of the list above.

  The original syntax allows the creation of bitmap and icon resources containing exactly one member bitmap. That member bitmap's depth depends on which of `BITMAP`/`BITMAPGREY`/etc is used, as described below.

      BITMAP|BITMAPGREY|etc [<ResType.s>] ID <ResId.n> [LOCALE <Locale.s>]
        <Filename.s> [<BitmapAttribute>...]

      [SMALL]ICON [ID <ResId.n>] [LOCALE <Locale.s>]
        <Filename.s> [<BitmapAttribute>...]

  - `BITMAP` creates a black & white bitmap resource.
  - `BITMAPGREY` creates a 2bpp (4 level grayscale) bitmap resource.
  - `BITMAPGREY16` creates a 4bpp (16 level grayscale) bitmap resource.
  - `BITMAPCOLOR16` creates a 4bpp (16 color) bitmap resource.
  - `BITMAPCOLOR` creates a 256 color bitmap resource.
  - `BITMAPCOLOR16K` creates a 16bpp direct color bitmap resource.
  - `BITMAPCOLOR24K` creates a 24bpp direct color bitmap resource.
  - `BITMAPCOLOR32K` creates a 32bpp direct color bitmap resource.
  - `ICON` and `SMALLICON` create black & white icon resources.

  An extension to this original syntax allows several bitmaps to be given:

      BITMAP|BITMAPFAMILYSPECIAL [<ResType.s>] ID <ResId.n> [LOCALE <Locale.s>]
        <Filename.s>... [<BitmapAttribute>...]

      [SMALL]ICON [ID <ResId.n>] [LOCALE <Locale.s>]
        <Filename.s>... [<BitmapAttribute>...]

  - You may specify up to seven filenames, which add black & white, 4 level grayscale, 16 level grayscale, 256 color, 16bpp direct color, 24bpp direct color, and 32bpp direct color bitmaps respectively. (The exception is `BITMAPFAMILYSPECIAL`, in which the third filename adds a 16 color bitmap instead.)
  - Bit-depths can be skipped by writing `""` (an empty string) for the filename.
  - For compatibility with previous versions of PilRC, the keywords `BITMAPFAMILY`, `ICONFAMILY`, and `SMALLICONFAMILY` may also be used to introduce this style of bitmap or icon family definition; each is equivalent to the corresponding keyword without "`FAMILY`".
  - `BOOTSCREENFAMILY` is another alternative here; it creates a '`Tbsb`' bootscreen family, which has extra size and checksum headers. It is system reserved.

  For compatibility with Handspring's tools, PilRC also supports the following syntax:

      BITMAP ID <ResId.n> [RSCTYPE <ResType.s>] [INCLUDECLUT] [LOCALE <Locale.s>]
        [<Filename.s>] [DEPTH2 <Filename.s>] [DEPTH4 <Filename.s>]
        [DEPTH8 <Filename.s>] [DEPTH16 <Filename.s>]
        [<BitmapAttribute>... | NOCOMPRESS|COMPRESS|FORCECOMPRESS [<Depth.n>...]...]

  - In addition to the normal compression attributes (which, as usual, set whether compression is done for all member bitmaps), the three compression attributes listed above can also be specified together with a list of depths (1, 2, 4, 8, 16) to which they should be applied. Multiple compression attributes with explicit depths can be present and will be evaluated from left to right.
  - `INCLUDECLUT` is equivalent to the `COLORTABLE` attribute.

  General notes applicable to all bitmap/icon definitions:

  - The word "`ID`" may in fact be omitted from "`ID <ResId.n>`" in each case, but this is deprecated.
  - In all of these keywords `GREY` may also be spelt as `GRAY`, and `COLOR` may also be spelt as `COLOUR`.
  - Definitions starting with any of the `BITMAP` keywords must specify a `<ResId.n>`, but the `<ResType.s>` is optional and will default to '`Tbmp`'.
  - Definitions starting with any of the `ICON` or `SMALLICON` keywords are always given type '`tAIB`', and may include an optional `<ResId.n>`. All `ICON`s have a default resource ID of 1000, while `SMALLICON`s default to 1001.
  - By default, the sizes of icons are checked: in single density, standard icons should be either 22x22, 32x22, or 32x32 and small icons should be 15x9. (And 33x48 et al or 22x13 in one and a half density; 64x44 et al or 30x18 in double density.)
  - Historically, compression has not been available for icons.
  - The inclusion of the bitmap color table is not recommended as it slows down system performance. PilRC implements a simple color table matching algorithm to match the bitmap's color table to the system palette.
  - `TRANSPARENTINDEX` is not compatible with direct color bit-depths (namely those greater than 8bpp).
  - Bitmaps with resource type '`Sbmp`' should only contain single density member bitmaps.
  - The 16 color bitmaps produced by `BPP 5`, `BITMAPCOLOR16`, and `BITMAPFAMILYSPECIAL` use by default the standard 16 color palette given in the code below (running at 4bpp means half as much memory to copy compared to 8bpp). They can be used with the following code:

        RGBColorType palette[] =
          {
            {  0, 0xff, 0xff, 0xff },
            {  1, 0x80, 0x80, 0x80 },
            {  2, 0x80, 0x00, 0x00 },
            {  3, 0x80, 0x80, 0x00 },
            {  4, 0x00, 0x80, 0x00 },
            {  5, 0x00, 0x80, 0x80 },
            {  6, 0x00, 0x00, 0x80 },
            {  7, 0x80, 0x00, 0x80 },
            {  8, 0xff, 0x00, 0xff },
            {  9, 0xc0, 0xc0, 0xc0 },
            { 10, 0xff, 0x00, 0x00 },
            { 11, 0xff, 0xff, 0x00 },
            { 12, 0x00, 0xff, 0x00 },
            { 13, 0x00, 0xff, 0xff },
            { 14, 0x00, 0x00, 0xff },
            { 15, 0x00, 0x00, 0x00 }
          };

        // change to 4bpp grayscale
        UInt32 depth = 4;
        WinScreenMode (winScreenModeSet, NULL, NULL, &depth, NULL);

        // and tweak to the 16 color palette
        WinPalette (winPaletteSet, 0, 16, palette);

  Examples:

      ICON "myicon.bmp"
      SMALLICONFAMILY "smic1bpp.bmp" "smic2bpp.bmp"
      ICON ID 1 "icon1bpp.bmp" "" "" "icon8bpp.bmp" TRANSPARENTINDEX 255

      BITMAP        ID 1000 LOCALE "enUS" "bitmap.bmp" COMPRESS
      BITMAPCOLOR16 ID 1001 "bmp4bpc.bmp" COMPRESS
      BITMAPCOLOR   ID 1002 "bmp8bpp.bmp" COMPRESS COLORTABLE

      BITMAP ID 1003
      COMPRESS
      BEGIN
          BITMAP "bmp-1.bmp" BPP 1
          BITMAP "bmp-4.bmp" BPP 2 DENSITY 72
          BITMAP "bmp-4.bmp" BPP 4 DENSITY 72
          BITMAP "bmp-8.bmp" BPP 8 DENSITY 72
          BITMAP "bmp-16.bmp" BPP 16 DENSITY 72
          BITMAP "bmp-8x.bmp" BPP 8 NOCOMPRESS DENSITY 108
          BITMAP "bmp-8d.bmp" BPP 8 NOCOMPRESS DENSITY 144
      END

      BITMAP ID 1004 INCLUDECLUT
        "monochrome.pbitm" DEPTH2 "grey4.pgm" DEPTH8 "color256.ppm" DEPTH16 "direct.ppm"
        TRANSPARENT 0 255 0 COMPRESS FORCECOMPRESS 8 16 NOCOMPRESS 1

  TRAP (TRAP)

      TRAP ID <TrapId.n> [VALUE] <TrapNumber.n>

  Notes:
  - DaggerWare's HackMaster required.
  - `<TrapId.n>` must be greater than 1000.
  - If you are using prc-tools, you may find that toolchain's stand-alone code resource facility more convenient than specifying the 'TRAP' resource separately with PilRC.
  Example:

      TRAP ID 1000 VALUE 367

  FONT (NFNT)

      FONT ID <FontResourceId.n>
      [LOCALE <LocaleName.s>] FONTID <FontId.n> <FontFileName.s>

  FONT file format

  The file containing the font information is plain ASCII. To understand how it works it is first necessary to understand how a font is arranged in memory. A font consists of four main parts, a header, a bitmap image, a bitmap location table, and an offset/width table. The bitmap image and location table are generated for you 100% automatically.

  The ASCII file consists of two parts, the header and the font data (glyph objects). A full font file is provided with the PilRC distribution.

  The FONT header has the following fields:

  `fontType` | The purpose of this field is unknown. The ROM fonts define this value to be 36864.
  `maxWidth` | Defined as "maximum character width". If not set it is automatically set to the width of the widest character.
  `kernMax` | Defined as "negative of maximum kern value". The purpose of this field is unknown.
  `nDescent` | Defined as "negative of descent". The purpose of this field is unknown, and is not used in the ROM fonts.
  `fRectWidth` | Defined as "width of font rectangle". If not set it is automatically set to the width of the widest character.
  `fRectHeight` | Defined as "height of font rectangle". If not set it is automatically set when the first glyph is defined. All characters must be exactly this height.
  `ascent` | The number of rows that make up the ascending part of the glyphs. Ascent plus descent equals fRectHeight. This value should be set.
  `descent` | The number of rows that make up the descending part of the glyphs. Descent plus ascent equals fRectHeight. This value should be set.
  `leading` | The purpose of this field is unknown.

  Each glyph has a bitmap, offset, and a width associated with it. The width can be overridden, however it is not recommended as it is set automatically. Notes:

  - `FONT` declarations must be defined before the font is used.
  - ALL font declarations must include a 'missing char' glyph as their last glyph. This is used by the OS when trying to display a char not present in the font. If this is not provided PilRC will generate a default empty one. For example:

        GLYPH -1
        -----
        -----
        -----
        -----
        #####
        #---#
        #---#
        #---#
        #---#
        #---#
        #---#
        #####
        -----
        -----
        -----

  - `<FontId.n>` must be between 128 and 255.
  - Custom `FONT` declarations can only be used on Palm Operating System 3.0 and later.
  - Palm Operating System 2.0 and before

        [source.rcp]
        FONT ID 1000 FONTID 128 "font.txt"

        [source.c]
        void *font128;
        font128=MemHandleLock(DmGetResource('NFNT', 1000));
        UICurrentFontPtr = font128;

  - Palm Operating System 3.0+

        [source.rcp]
        FONT ID 1000 FONTID 128 "font.txt"

        [source.c]
        FontPtr font128;
        font128=MemHandleLock(DmGetResource('NFNT', 1000));
        FntDefineFont(128, font128);

  - FONT support in PilRC is not complete, and has been reverse engineered.
  FONTFAMILY (nfnt)

      FONTFAMILY ID <ResId.n> FONTID <FontId.n> [LOCALE <LocaleName.s>]
      BEGIN
          FONT <FontFileName.s> DENSITY <Density.n>
          ...
      END

  Notes:

  - Use in PalmOS version 4.0 and after.
  - The densities supported are 72 and 144.
  - For compatibility with an earlier version of PilRC, the syntax "`DENSITY <Density.n> <FontFileName.s>`" is also accepted within the `BEGIN`/`END`, but this is deprecated.
  Example:

      FONTFAMILY ID 1000 FONTID 128 LOCALE "enUS"
      BEGIN
          FONT "font_100.txt" DENSITY 72
          FONT "font_101.txt" DENSITY 144
      END

  FONTINDEX (fnti)

      FONTINDEX ID <ResId.n>
      [LOCALE <LocaleName.s>]
      BEGIN
      	<FontType.s> <ResId.n>
      	...
      	[BEGIN
      		<FontId.n>
      		...
      	END]
      END

  Notes:

  - This resource is system reserved.
  Example:

      FONTINDEX ID 1000 LOCALE "enUS"
      BEGIN
      	"NFNT" 9001
      	"NFNT" 9002
      	"NFNT" 9003
      	"fntm" 9004
      	BEGIN
      		10000
      		10001
      		10002
      	END
      END

  FONTMAP (fntm)

      FONTMAP ID <ResId.n> [LOCALE <LocaleName.s>]
      BEGIN
      	<Flag.n><State.n><Value.n>
      	...
      END

  Notes:

  - This resource is system reserved.
  Example:

      FONTMAP ID 1000 LOCALE "enUS"
      BEGIN
      	FLAG 0 STATE 1 VALUE 0
      	FLAG 0 STATE 1 VALUE 0
      	FLAG 0 STATE 1 VALUE 0
      	FLAG 0 STATE 1 VALUE 0
      END

  HEX

      HEX <ResType.s> ID <ResId.n>
      [LOCALE <LocaleName.s>]
          <Byte.n> | <String.s>

  Notes:

  - String values within the data DO NOT have implicit null termination. You must add a 0x00 hex value after the string if needed.
  Example:

      HEX "junk" ID 1000
        0x00 0x00 0x00 0x23 "String" 0x00 "String2"
        0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

  DATA

      DATA <ResType.s> ID <ResId.n>
      [LOCALE <LocaleName.s>] <FileName.s>

  Example:

      DATA "junk" ID 1000 "binary.bin"

  INTEGER (tint)

      INTEGER ID <ResId.n>
      [LOCALE <LocaleName.s>] [VALUE] <Value.n>

  Notes:

  - `ResLoadConstant(..)` API can be used to load the 'tint' resource.
  Example:

      INTEGER ID 1000 VALUE 1966

  BYTELIST (BLST)

      BYTELIST ID <ResId.n>
      [LOCALE <LocaleName.s>]
      BEGIN
      	<Byte.n>
      	...
      END

  Example:

      BYTELIST ID 1000
      BEGIN
      	23
      	3
      	205
      	55
      	12 - 8
      END

  WORDLIST (wrdl)

      WORDLIST ID <ResId.n>
      [LOCALE <LocaleName.s>]
      BEGIN
      	<Word.n>
      	...
      END

  Example:

      WORDLIST ID 1000
      BEGIN
      	23
      	1303
      	2505
      	2055
      	42 * 68
      END

  LONGWORDLIST (DLST)

      LONGWORDLIST ID <ResId.n>
      [LOCALE <LocaleName.s>]
      BEGIN
      	<LongWord.n>
      	...
      END

  Example:

      LONGWORDLIST ID 1000
      BEGIN
      	123456789
      	130300
      	78005
      	200055
      	12345 * 20000
      END

  NAVIGATION (fnav)

      NAVIGATION ID <ResId.n>
          [VERSION <version.n>]
          INITIALSTATE <state.n>
          [INITIALOBJECTID <id.n>]
          [JUMPOBJECTID <id.n>]
          [BOTTOMLEFTOBJECTID <id.n>]
          BEGIN
              ID <ID.n> ABOVE <ID.n> BELOW <ID.n>
                  [SKIP] [FORCEINTERACTION] [BIGBUTTON]
              ...
          END

          or

          NAVIGATIONMAP
              ROW { <ID.n> [SKIP] [FORCEINTERACTION] [BIGBUTTON] } *
              ...
          END

  This resource is associated with a form with the same ID and defines the tab order of controls on the form, along with the up/down navigation order and where object focus should initially be placed. For a full description of this, see the PalmOne Treo 600 developer documentation. This format will likely be used for future PalmOne devices.

  For either syntax, the tab order is determined by the order that IDs are listed in the BEGIN/END or NAVIGATIONMAP section. These IDs should be the same as those used for form objects in the corresponding form resource. For a navigation map, the ABOVE and BELOW values for a row are the value of the ID that starts the previous and next rows, respectively.

  PilRC doesn't provide keywords for the values of INITIALSTATE. You should #define your own constant definitions, based on those in the Treo 600 headers. See the example for the most commonly used values.

  Example:

      #define	kFrmNavHeaderFlagsObjectFocusStartState  0x00000001
      #define	kFrmNavHeaderFlagsAppFocusStartState     0x00000002

      NAVIGATION ID 1000
          INITIALSTATE kFrmNavHeaderFlagsObjectFocusStartState
          INITIALOBJECTID 1001
          JUMPOBJECTID 1001
          BOTTOMLEFTOBJECTID 1005
          BEGIN
            ID 1001 BELOW 1003
            ID 1002 BELOW 1003 SKIP
            ID 1003 ABOVE 1001 BELOW 1004 FORCEINTERACTION
            ID 1004 ABOVE 1003 BIGBUTTON
            ID 1005 ABOVE 1003 SKIP FORCEINTERACTION BIGBUTTON
          END

      NAVIGATION ID 2000
          INITIALSTATE kFrmNavHeaderFlagsObjectFocusStartState
          INITIALOBJECTID 2001
          NAVIGATIONMAP
            ROW 2001
                2002 SKIP
            ROW 2003 FORCEINTERACTION
            ROW 2004 BIGBUTTON
                2005 SKIP FORCEINTERACTION BIGBUTTON
          END

  PALETTETABLE (tclt)

      PALETTETABLE ID <ResId.n>
      BEGIN
      	<index.n> <red.n> <green.n> <blue.n>
      	...
      END

  Example:

      PALETTETABLE ID 1000
      BEGIN
      	0x00 0xFF 0xFF 0xFF
      	0x01 0x00 0x00 0x00
      END

  FEATURE (feat)

      FEATURE ID <ResId.n>
      [LOCALE <LocaleName.s>]
      BEGIN
      	[CREATOR <creator.s>]
      	BEGIN
      		[ENTRY] [NUMBER <number.n>] [VALUE <value.n>]
      		...
      	END
      END

  Example:

      FEATURE ID 1000
      BEGIN
      	CREATOR "psys"
      	BEGIN
      		ENTRY NUMBER 5 VALUE 0
      		ENTRY NUMBER 6 VALUE 0
      	END
      END

  GRAFFITIINPUTAREA (silk)

      GRAFFITIINPUTAREA ID <GraffitiInputAreaId.n>
        [VERSION <version.n>]
        [CREATOR <creator.s>]
        [LANGUAGE <language.s>]
        [COUNTRY <country.s>]
        [LOCALE <LocaleName.s>]
      BEGIN
        <OBJECTS>
      END

  Where `<OBJECTS>` is one or more of:

  `AREA` | `AT (<Left.p> <Top.p> <Width.p> <Height.p>) [SCREEN] [GRAFFITI] [INDEX <index.n>]`
  `BUTTON` | `AT (<Left.p> <Top.p> <Width.p> <Height.p>) [KEYDOWNCHR <keydownchr.n>] [KEYDOWNKEYCODE <keydownkeycode.n>] [KEYDOWNMODIFIERS <keydownmodifiers.n>]`

  Notes:

  - This resource is system reserved.
  - `LANGUAGE` is one of this strings :
    "English", "French", "German", "Italian", "Spanish", "Japanese".
  - `COUNTRY` is one of this strings :
    "Australia", "Austria", "Belgium", "Brazil", "Canada", "Denmark", "Finland", "France", "Germany", "HongKong", "Iceland", "Ireland", "Italy", "Japan", "Luxembourg", "Mexico", "Netherlands", "NewZealand", "Norway", "Spain", "Sweden", "Switzerland", "UnitedKingdom", "UnitedStates", "India", "Indonesia", "Korea", "Malaysia", "RepChina", "Philippines", "Singapore", "Thailand", "Taiwan".
  Example:

      GRAFFITIINPUTAREA ID 10000
        VERSION 1
        CREATOR "psys"
        LANGUAGE "English"
        COUNTRY "UnitedStates"
      BEGIN
      	AREA AT (0 0 160 160) SCREEN INDEX 0
      	AREA AT (27 164 62 56) GRAFFITI INDEX 0
      	AREA AT (89 164 44 56) GRAFFITI INDEX 1
      	BUTTON AT (27 206 18 14) KEYDOWNCHR 272 KEYDOWNKEYCODE 0 KEYDOWNMODIFIERS 8
      	BUTTON AT (115 206 18 14) KEYDOWNCHR 273 KEYDOWNKEYCODE 0 KEYDOWNMODIFIERS 8
      	BUTTON AT (0 164 27 28) KEYDOWNCHR 264 KEYDOWNKEYCODE 0 KEYDOWNMODIFIERS 8
      	BUTTON AT (0 192 27 28) KEYDOWNCHR 261 KEYDOWNKEYCODE 0 KEYDOWNMODIFIERS 8
      	BUTTON AT (133 164 27 28) KEYDOWNCHR 267 KEYDOWNKEYCODE 0 KEYDOWNMODIFIERS 8
      	BUTTON AT (133 192 27 28) KEYDOWNCHR 266 KEYDOWNKEYCODE 0 KEYDOWNMODIFIERS 8
      END

  COUNTRYLOCALISATION (cnty)

      COUNTRYLOCALISATION ID <ResId.n>
      [LOCALE <LocaleName.s>]
      BEGIN
        BEGIN
          [NUMBER <number.n>]
          [NAME <name.s>]
          [DATEFORMAT <dateformat.n>]
          [LONGDATEFORMAT <longdateformat.n>]
          [WEEKSTARTDAY <weekstartday.n>]
          [TIMEFORMAT <timeformat.n>]
          [NUMBERFORMAT <numberformat.n>]
          [CURRENCYNAME <currencyname.s>]
          [CURRENCYSYMBOL <currencysymbol.s>]
          [CURRENCYUNIQUESYMBOL <currencyuniquesymbol.s>]
          [CURRENCYDECIMALPLACES <currencydecimalplaces.n>]
          [DAYLIGHTSAVINGS <daylightsavings.n>]
          [MINUTESWESTOFGMT <minuteswestofgmt.n>]
          [MEASUREMENTSYSTEM <measuresystem.n>]
        END
        BEGIN
          ...
        END
        ...
      END

  Notes:

  - This resource is system reserved.
  Example:

      COUNTRYLOCALISATION ID 10000
      BEGIN
      	BEGIN
      		NUMBER 7
      		NAME "France"
      		DATEFORMAT 1
      		LONGDATEFORMAT 8
      		WEEKSTARTDAY 1
      		TIMEFORMAT 2
      		NUMBERFORMAT 2
      		CURRENCYNAME "Franc"
      		CURRENCYSYMBOL "F"
      		CURRENCYUNIQUESYMBOL "FRF"
      		CURRENCYDECIMALPLACES 2
      		DAYLIGHTSAVINGS 3
      		MINUTESWESTOFGMT 60
      		MEASUREMENTSYSTEM 1
      	END
      	BEGIN
      		NUMBER 23
      		NAME "United States"
      		DATEFORMAT 0
      		LONGDATEFORMAT 7
      		WEEKSTARTDAY 0
      		TIMEFORMAT 1
      		NUMBERFORMAT 0
      		CURRENCYNAME "US Dollar"
      		CURRENCYSYMBOL "$"
      		CURRENCYUNIQUESYMBOL "$US"
      		CURRENCYDECIMALPLACES 2
      		DAYLIGHTSAVINGS 1
      		MINUTESWESTOFGMT 1140
      		MEASUREMENTSYSTEM 0
      	END
      END

  LOCALES (locs)

      LOCALES ID <ResId.n>
      [LOCALE <LocaleName.s>]
      BEGIN
        [VERSION <number.n>]
        BEGIN
          [LANGUAGES <languages.n>]
          [COUNTRYS <countrys.n>]
          [COUNTRYNAME <countryname.s>]
          [DATEFORMAT <dateformat.n>]
          [LONGDATEFORMAT <longdateformat.n>]
          [TIMEFORMAT <timeformat.n>]
          [WEEKSTARTDAY <weekstartday.n>]
          [TIMEZONE <timezone.n>]
          [NUMBERFORMAT <numberformat.n>]
          [CURRENCYNAME <currencyname.s>]
          [CURRENCYSYMBOL <currencysymbol.s>]
          [CURRENCYUNIQUESYMBOL <currencyuniquesymbol.s>]
          [CURRENCYDECIMALPLACES <currencydecimalplaces.n>]
          [MEASUREMENTSYSTEM <measuresystem.n>]
        END
        BEGIN
          ...
        END
        ...
      END

  Notes:

  - This resource is system reserved (only after version 4.0).
  Example:

      LOCALES ID 10000
      BEGIN
      	VERSION 1
      	BEGIN
      		LANGUAGES 1
      		COUNTRYS 7
      		COUNTRYNAME "France"
      		DATEFORMAT 1
      		LONGDATEFORMAT 8
      		TIMEFORMAT 2
      		WEEKSTARTDAY 1
      		TIMEZONE 60
      		NUMBERFORMAT 2
      		CURRENCYNAME "Franc"
      		CURRENCYSYMBOL "F"
      		CURRENCYUNIQUESYMBOL "FRF"
      		CURRENCYDECIMALPLACES 2
      		MEASUREMENTSYSTEM 1
      	END
      	BEGIN
      		LANGUAGES 0
      		COUNTRYS 23
      		COUNTRYNAME "United States"
      		DATEFORMAT 0
      		LONGDATEFORMAT 7
      		TIMEFORMAT 1
      		WEEKSTARTDAY 0
      		TIMEZONE -480
      		NUMBERFORMAT 0
      		CURRENCYNAME "US Dollar"
      		CURRENCYSYMBOL "$"
      		CURRENCYUNIQUESYMBOL "$US"
      		CURRENCYDECIMALPLACES 2
      		MEASUREMENTSYSTEM 0
      	END
      END

  KEYBOARD (tkbd)

      KEYBOARD ID <ResId.n>
      [LOCALE <LocaleName.s>] VALUE <Value.n>

  Notes:

  - Supported Value are:
    if keyboard is for United State then value = 0
    if keyboard is for French then value = 1
    if keyboard is for Germany then value = 2
    if keyboard is for Spain then value = 3
    if keyboard is for Italy then value = 4
    if keyboard is for Japanese then value = 5
  - This resource is system reserved.
  Example:

      KEYBOARD ID 1000 VALUE 0

  MIDI (MIDI)

      MIDI ID <ResId.n> <string.s>

  Notes:

  - This does not convert the file to midi resource. The .aif or .mid file must be Palm Midi compliant (see palm documentation for more information).
  Example:

      MIDI ID 1000 "trompette.mid"

  HARDSOFTBUTTONDEFAULT (hsbd)

      HARDSOFTBUTTONDEFAULT ID <ResId.n>
      [LOCALE <LocaleName.s>]
      BEGIN
      	BEGIN
      		[NUMBER <number.n>]
      		[CREATOR <creator.s>]
      	END
      	...
      END

  Notes:

  - The number parameter is keyCode.
  - This resource is system reserved (only after version 4.0).
  Example:

      HARDSOFTBUTTONDEFAULT ID 10000
      BEGIN
      	BEGIN
      		NUMBER 516
      		CREATOR "date"
      	END
      	BEGIN
      		NUMBER 517
      		CREATOR "addr"
      	END
      	BEGIN
      		NUMBER 518
      		CREATOR "todo"
      	END
      	BEGIN
      		NUMBER 519
      		CREATOR "memo"
      	END
      	BEGIN
      		NUMBER 521
      		CREATOR "sync"
      	END
      	BEGIN
      		NUMBER 264
      		CREATOR "lnch"
      	END
      	BEGIN
      		NUMBER 267
      		CREATOR "calc"
      	END

      END

  SYSAPPLICATIONPREFERENCES (pref)

      SYSAPPLICATIONPREFERENCES ID <ResId.n>
      [LOCALE <LocaleName.s>]
      		PRIORITY <Priority.n>
      		STACKSIZE <StackSize.n>
      		MINHEAPSPACE <MinHeapSpace.n>

  Notes:

  - This resource is system reserved.
  Example:

      SYSAPPLICATIONPREFERENCES ID 1000 PRIORITY 30 STACKSIZE 0x1000 MINHEAPSPACE 0x1000

  SEARCHTABLE (tSCH)

      SEARCHTABLE ID <ResId.n> [LOCALE <LocaleName.s>]
      BEGIN
      	OFFSET_s0 <Offset_s0.n>
      	OFFSET_sD <Offset_sD.n>
      	OFFSET_sK <Offset_sK.n>
      	OFFSET_sM <Offset_sM.n>
      	OFFSET_sU <Offset_sU.n>
      	OFFSET_sP <Offset_sP.n>
      	OFFSET_sA <Offset_sA.n>
      	OFFSET_sG <Offset_sG.n>
      	OFFSET_sR <Offset_sR.n>
      	BEGIN
      		ACTION <Action.n> NEXTSTATE <NextState.n> DATA <data.n>
      		...
      	END
      	BEGIN
      		ACTION <Action.n> NEXTSTATE <NextState.n> DATA <data.n>
      		...
      	END
      	BEGIN
      		ACTION <Action.n> NEXTSTATE <NextState.n> DATA <data.n>
      		...
      	END
      	BEGIN
      		ACTION <Action.n> NEXTSTATE <NextState.n> DATA <data.n>
      		...
      	END
      	BEGIN
      		ACTION <Action.n> NEXTSTATE <NextState.n> DATA <data.n>
      		...
      	END
      	BEGIN
      		ACTION <Action.n> NEXTSTATE <NextState.n> DATA <data.n>
      		...
      	END
      	BEGIN
      		ACTION <Action.n> NEXTSTATE <NextState.n> DATA <data.n>
      		...
      	END
      	BEGIN
      		ACTION <Action.n> NEXTSTATE <NextState.n> DATA <data.n>
      		...
      	END
      	BEGIN
      		ACTION <Action.n> NEXTSTATE <NextState.n> DATA <data.n>
      		...
      	END
      END

  Notes:

  - This resource is system reserved.
  Example:

      SEARCHTABLE ID 32001 LOCALE "jpJP"
      BEGIN
      	OFFSET_s0 18
      	OFFSET_sD 1042
      	OFFSET_sK 2066
      	OFFSET_sM 3090
      	OFFSET_sU 4114
      	OFFSET_sP 5138
      	OFFSET_sA 6162
      	OFFSET_sG 7186
      	OFFSET_sR 8210
      	BEGIN
      		ACTION 17 NEXTSTATE 0 DATA 256
      		ACTION 17 NEXTSTATE 0 DATA 257
      		ACTION 17 NEXTSTATE 0 DATA 258
      		...
      	END
      	...
      END

  TEXTTABLE (ttbl)

      TEXTTABLE ID <ResId.n> [LOCALE <LocaleName.s>] [COMPRESS]
      VERSION <Version.n>	9 or 10
      TABLETYPE <TableType.n> 1 .. 17
      FLAG <Flag.n>
      MIN <Min.n>
      MAX <Max.n>
      DEFAULTOUTPUT <DefaultOutput.n>
      NUMELEMENTBITS <NumElementBits.n>
      NUMINDEXEDDATALENBITS <NumIndexedDataLenBits.n>
      NUMRESULTBITS <NumResultBits.n>
      INDEXDATAOFFSET <IndexDataOffset.n>
      BEGIN
      	...
      END

  Notes:

  - This resource is system reserved.
  Example:

      TEXTTABLE ID 1000 LOCALE "jpJP" COMPRESS
      VERSION 9
      TABLETYPE 2
      FLAG 3758096384
      MIN 64
      MAX 252
      DEFAULTOUTPUT 1
      NUMELEMENTBITS 8
      NUMINDEXEDDATALENBITS 0
      NUMRESULTBITS 8
      INDEXDATAOFFSET 215
      BEGIN
      	...
      END

  TABLELIST (ttli)

      TABLELIST ID <ResId.n> [LOCALE <LocaleName.s>]
      BEGIN
      	TYPE <ResType.s> ID <ID.n> INDEX <Index.n>
      	...
      END

  Notes:

  - This resource is system reserved.
  Example:

      TABLELIST ID 1000
      BEGIN
      	TYPE "ttbl" ID 32034 INDEX 40
      	TYPE "ttbl" ID 32030 INDEX 46
      	TYPE "ttbl" ID 32008 INDEX 47
      	TYPE "ttbl" ID 32027 INDEX 10
      	TYPE "ttbl" ID 32028 INDEX 11
      	TYPE "ttbl" ID 32027 INDEX 12
      	TYPE "ttbl" ID 32029 INDEX 13
      	TYPE "ttbl" ID 32031 INDEX 45
      	TYPE "ttbl" ID 32032 INDEX 43
      	TYPE "ttbl" ID 32033 INDEX 44
      	TYPE "ttbl" ID 32035 INDEX 50
      	TYPE "tSTL" ID 32001 INDEX 16
      	TYPE "csli" ID 32001 INDEX 49
      END

  CHARSETLIST (csli)

      CHARSETLIST ID <ResId.n> [LOCALE <LocaleName.s>]
      BEGIN
      	NAME <Name.s> ID <ID.n>
      	...
      END

  Notes:

  - This resource is system reserved.
  Example:

      CHARSETLIST ID 1000
      BEGIN
      	NAME "us-ascii" ID 1
      	NAME "ASCII" ID 1
      	NAME "ISO646-US" ID 1
      	NAME "us" ID 1
      	NAME "IBM367" ID 1
      	NAME "cp367" ID 1
      	NAME "csASCII" ID 1
      	NAME "shift_jis" ID 4
      	NAME "shift-jis" ID 4
      	NAME "sjis" ID 4
      END

  ID Generation Support

  PilRC supports automatically generating a C header file with ID symbols used in the text. You can either specify this using the -H command line option, or by using a GENERATEHEADER command in your RCP file. To control the numbering used by this process, to allow multiple RCP files being build without conflicting ID numbers, you use the RESETAUTOID command to give each file its own ID number range. You can also use it to do different ranges for different items in one file. To emulate Constructor's numbering behavior, you could reset the auto ID number before each form to the next multiple of 100.

  As of version 3.2, PilRC will not update the header file if it would generate the same file that already exists on disk. This helps with systems that use file modification times to trigger rebuilds, as a change to your RCP file that doesn't affect ID numbering won't cause your other source files to be rebuilt.

  GENERATEHEADER

      GENERATEHEADER <HeaderFile.s>

  Example:

      GENERATEHEADER "ApplicationRsc.h"

  RESETAUTOID

      RESETAUTOID <IDBase.n>

  Example:

      RESETAUTOID 1000

  International Support

  PilRC supports a limited form of international tokenization. It works by substituting strings in the resource definitions with replacements specified in a TRANSLATION section. Multiple translation blocks may be specified in a resource script.

  The active language is specified with the -L option. If you use more than one `-L` option, several translation sections will be active; if several of these active translations contain substitutions for the same original string, the one that appears first in the source file will be used.

  Positioning of controls is a large problem if absolute values are used. It is recommended you use AUTO, CENTER and PREVRIGHT et al when defining the contents of your forms.

  Example:

      pilrc -L FRENCH myscript.rcp res

  TRANSLATION

      TRANSLATION <Language.s>
      BEGIN
        <STRINGTRANSLATIONS>
      END

  Where `<STRINGTRANSLATIONS>` is one or more of:

      <Original.s> = <Translated.ss>

  Notes:

  - Declare a short keyword for long strings, and define native and foreign translations for it.

  Example:

      TRANSLATION "FRENCH"
      BEGIN
        "Repeat Datebook alarm sound" = "Répétitions Alarme Agenda"
        "Ring again every" = "Rappel tous les"
      END

  Known Bugs

  - LIST
    - DISABLED does not work.
    - VISIBLEITEMS may be required for list objects to show properly.
  - FIELD
    - MAXCHARS required for field control to accept characters to work.
    - NUMERIC doesn't work in Palm Operating System prior to 3.0
  - FORM
    - Using NOSAVEBEHIND on Palm Operating System prior to 3.0 may cause errors.
  - FONT
    - Developed based on reverse-engineering.
      The complete operation of how Palm OS handles FONT manipulation has recently been documented in the Palm OS SDK 5 Reference Manual.

  Further Reading

  For Palm Computing Platform reference information, be sure to also visit the following websites:

  - http://www.palmsource.com/developers
    Provided by PalmSource.

  - http://prc-tools.sourceforge.net/
    Home page for prc-tools, a development kit supporting C and C++ programming on Palm OS using GCC.

  - http://www.falch.net/
    Developers of Falch.net Developer Studio for Palm OS and PilRC Designer for Palm OS.

  - http://www.metrowerks.com/palm/
    Developers of CodeWarrior Developer Studio for Palm OS.

  - http://www.palmoswerks.com/
    Development resources for Palm OS developers with a CodeWarrior focus.

  - http://www.massena.com/darrin/pilot/
    A great source of low level Palm Computing Platform information.
    Provided by Darrin Massena.