Presdec User Manual

The Palm-os RESource file DE-Compiler

 

SYNOPSIS

Presdec will take the PalmOS Resource File (the one ending with .prc), containing a complete PalmOS application, split it into the separate resources, and save a description of the GUI in a file. The GUI description file is compatible with PilRC and can be compiled again.

There are some applications for this program: It could be used to make the examples from the PalmOS SDK useable for the free GCC / PilRC environment, or to easily localize applications without the need for source code (respecting copyright issues of course).

Presdec has the following features, that separates it from other programs of similar functionality:


 

CONTENTS

Copyright and License information
Requirements for running presdec
How to install presdec
      Unix
      Windows
      Mac
      Other Systems
Using presdec
      Command Line
      Options
Bugs
History
The Future

 

COPYING

If you just want to use the presdec application, then continue reading at the next chapter.

Presdec is freeware. That means it may be copied without charge, provided the following copyright notice remains intact:

        Presdec is Copyright Thomas Holland, thomas@innot.de
        To get the latest version free of charge take a look at the presdec homepage.
    

The program may be made available online, and on low cost CD-ROMs. If it is bundled with other software and sold commercially then the author requires one copy of the complete software package as license fee. (I love new programs :))

If you take any part of the sourcecode for your own projects something similar to the following copyright notice has to be included either in the source code (if it is freely available) or at program startup (if source is not made available):

        This Program contains code from the presdec application, 
        Copyright Thomas Holland, thomas@innot.de
    
Finally -as always- The author makes no guarantees whatsoever. If the program breaks, you get to keep both parts. If it trashes your hard drive, melts your screen or lets your computer explode then take a look here.
 

REQUIREMENTS

Java with java system libraries version 1.1 or higher
Earlier versions of Java (1.0) might work, but have not been tested. Also a command line interface is recommended, since presdec has only a very rudimentary GUI (just a file selector).

PilRC 2.0a or higher
If you plan to compile the generated resource files you need PilRC with version 2.0a or higher (at the time of this writing 2.3 is the most current version). Earlier versions of PilRC do not support all attribute tags generated by presdec.
 

INSTALLATION

Unix/Windows
  1. Unpack the distribution file, presdec.zip. You can do this either by using the jar program that comes with Sun's JDK:
        jar xvf presdec.zip
    or by using a public domain version of unzip:
        unzip presdec.zip
     
    Either method will yield these files:

    README Like readme.html but without any fancy styles
    readme.html You are reading it right now :-)
    presdec.sh Unix shell script wrapper for starting presdec
    presdec.bat DOS batchfile wrapper for starting presdec
    example/pilrctst.prc Example prc file for testing presdec
    presdec.jar Archive with all required classes
    presdec_src.jar Archive with the presdec java sources*
    Makefile GNU Makefile for building presdec*
     
    *only in the source distribution
     

  2. Edit presdec.sh (for Unix) or presdec.bat (for Windows) and set the environment variables to match the place where you put presdec.jar
     
  3. On Unix systems, do the following to make presdec executable:
        mv presdec.sh presdec
        chmod +x presdec

  4. For easy access you can copy presdec (for Unix) or presdec.bat (for Windows) somewhere in your Path, e.g. /usr/bin/ or c:\windows\
     
  5. Do not unzip presdec.jar. It's executed directly by the presdec shell script / batch file.

 
MacOS:
Presdec is not 100% pure Java, since it only has a command line interface for setting options. But if someone tells me how to get it working on a Mac I will include a description here.
 
Other Systems:
If you write an wrapper script for some other OS you can mail them to me and I will include them in future versions of presdec.
 

 

USAGE

The syntax for using presdec is

presdec [-abBdhOsvV] [-o outputname] [-p pathname] [-t bitmaptype][prcfile]

Only one prcfile may be specified on the command line. If no prcfile is specified, a file requester will pop up, which allows selection of a prcfile.

Options:
-a Generates all resource attributes in the rcp file, even if they are default values for PilRC. The default is to leave those attributes off to keep the output short.
Examples of default attributes are:
	      MODAL, USABLE, SAVEBEHIND etc.
	  
-b Save resources that are not part of the resulting rcp file in binary form. The name of the binary resource files is ttttxxxx.bin, where t is the 4-letter type and x is the ID value of the resource in hex.
Examples of binary resource files are:
 
    code0000.bin CODE resource with id 0
    data0001.bin DATA resource with id 1
    tmid0709.bin Midi music data resource with id 1801
 
These files, together with the output of PilRC compiling the rcp file, can be used to build a new prc file. (Attention: this has not really been tested)
 
-B Save all resources as binary files.
This option is similar to -b, but this time all resources are written in binary form, even those that are part of the GUI and are decompiled into readable form.
Examples:
 
    tFRM0a8b.bin Form data resource with id 2700
    tSTR03e9.bin String resource with id 1001
 
The resulting files can all be linked together again to reconstruct the prc file.
 
-d Dump resources in a human readable way.
Some resources, which contain only binary data, can be dumped in a human readable way by using this option. The actual output depends on the type of resource and is only intended for information, not for further processing.
Currently supported for:
    data resources   -  Hex dump and reloc information

 
-h Prints out a short help text.

 
-o outputname The name of the generated rcp file.
Default is the name of the prc file with a new suffix of ".rcp".
 
-O Do not generate a rcp output file.
Useful in conjunction with the -B option to simply split the prc file into separate resources.
 
-p pathname Path for the rcp output file and all extracted resources.
Default is the current directory.
 
-s Sort the resources in the rcp file according to id, type and some additional rules.
Very often resources with similar id values are used together in the GUI. But in the final prc file this relationship is lost since the building tools will sort the resources by size or by type only.
To make the rcp file more readable presdec will place all global resources (APPLICATION, VERSION etc.) at the beginning of the rcp file. All other resources are first sorted by their ID. Then all resources, that are referenced within a FORM or ALERT resource (see MENUID, HELPID and FORMBITMAP) are placed right behind that form. Finally all Objects within a FORM are sorted by their left and top coordinates.
 
-t bitmaptype Type of conversion for bitmap resources.
All bitmap and icon resources (Tbmp and tAIB) will be converted before being written to disk. Currently the following (b/w) bitmap formats are supported by presdec:
 
bitmaptype description extension remarks
pbmascii PBM Type 1 (b/w, ascii file format) .pbm default
ascii Simple conversion to printable text for quick viewing with any text viewer. .asc not supported by PilRC
bmp Windows Bitmap file .bmp  
none No bitmap files are generated.    

 
The filename for each bitmap is tttxxxxx.ext, where ttt is "icn" for icons (special kind of bitmaps) or "bmp" for all other bitmaps, xxxxx is the decimal ID of the bitmap and ext is the extension as defined by the converterbitmaptype.
 
-v Print some diagnostic messages to stdout

 
-V Print some information about the structure of the prc file to stdout

 

 

BUGS

In the good tradition of almost every major piece of software written these days, presdec has only been tested superficially to leave it up to you, dear User, to find the remaining bugs. But the sourcecode is available, so everybody can hunt them down.

But don't forget to tell me about any modification...
 

HISTORY

V1.2 25-jun-1999 Write bitmaps as bmp
New option -d to dump resources in a human readable way
V1.0 30-sep-1998 First public release

FUTURE

Take a look at the source at presdec.Main#usage. You can find some ideas that might be included in future versions.

Please feel free to send me comments, suggestions and bug reports.

Thomas Holland

Langen, den 26. Juni 1999