bartop

palmoswerks ARCHIVE
Palm OS programming tips from a (former) CodeWarrior insider

header

Navigation

Search
Home
About
Stories
Stuff I Like
Articles
PilRC
CodeWarrior
palmos.techwood.org
DevTools List
Palm OS Dev FAQ

 Permanent link to archive for 11/5/02.   Tuesday, November 5, 2002 daytail

Converting Constructor files to PilRC (RCP) Format

The original Palm OS tools grew out of the 68K tools originally designed for Mac OS, and it was natural that the original Palm OS resource tools were modified forms of the tools used to make Macintosh resources. The earliest resource definitions were done using Apple's Rez compiler and a template header file designed by the Palm OS designers. This tradition continued with the development of Constructor for Palm OS, a version of the Constructor tool that Metrowerks built to work with their PowerPlant C++ class library. Constructor for Palm OS was ported from Mac OS to Windows, and this formed the de facto resource editor for Palm OS programmers for many years.

Outside of the tools Palm used, a separate resource tradition was developed. Wes Cherry created the original third-party resource compiler, PilRC, back in 1997. The name, short for Pilot Resource Compiler, was similar to its model, WinRC, the Windows Resource Compiler. This connection continued to the language structure and the source file extension, RCP, which add a Pilot "P" to the RC extension used by Windows resource files.

Neil Rhodes did the Palm OS community a service by adapting PilRC to work as a CodeWarrior plugin, translating the .RCP files into .r files for the Rez compiler. This tool was included as an optional part of CW for Palm OS V7 and as a standard part of V8.

CodeWarrior for Palm OS V9 will be the first version of the CodeWarrior for Palm OS tools to provide support for the PilRC command-line compiler, called using a command-line adapter. This allows using the full capabilities of PilRC, not just the subset that can be successfully translated into Rez. It also means faster builds, and no extraneous files added to your project files.

The RCP format is fairly easy to edit, being based on text files. It can be a bit verbose, but there are several nice editors available that allow you to edit these files graphically. For example, Handspring's RcpEdit acts as a constrained text editor, letting you fill in fields and showing both the raw PilRC source and a preview of your form or alert.

How Do I Convert Constructor Files?

There are a few ways to get your resources in RCP format.

The easiest is the utility rsrc2rcp, available at http://www.palmgear.com/software/showsoftware.cfm?prodID=42412. This freeware application was written by Renaud Malaval, a developer at PalmSource in France. It has the advantage of reading both the .rsrc and .h files and using the identifiers in the header to label items in the output .rcp file. The output does support recent PilRC features to allow high-density bitmaps, something other tools lack.

There is an open source project with the same name, rsrc2rcp, at http://rsrc2rcp.sourceforge.net/. This one it written in Perl, so you can modify it to your taste, but its bitmap support seems a bit behind what's available in the other program.

I've used the excellent PRCExplorer, http://www.palmgear.com/software/showsoftware.cfm?prodID=40542, to get RCP files for some of my projects. This one lets you output RCP files from a build PRC file. To use, you would build your program using your existing resources, then disassemble the PRC file, outputting all of its resources to RCP form. The big advantage is that since it uses the PRC files directly, it has a much better chance of outputting useful bitmap files, and it also handles the high-density bitmap forms.

Finally, Falch.net's PilRC Designer tool includes the ability to open existing .rsrc files and output .rcp files. I've not used this very much, but it looks like it works quite well on most resources, although newer .rsrc files with high-density bitmaps may not work with the current version.

brought to you by weblogger.com

 
November 2002
Sun Mon Tue Wed Thu Fri Sat
  1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Oct   Dec


Send feedback to combee@techwood.org
Copyright © 2004 Benjamin L. Combee
Palm OS is a registered trademark of PalmSource, Inc.
Metrowerks and CodeWarrior are registered trademarks of Metrowerks Inc.

The views expressed on this website/weblog are those of mine alone and do not necessarily reflect the views of PalmSource or Metrowerks.

This is a Manila Site

qwertYAK / frobnovich