Helper Application Database File
This document describes the purpose and format of the PiHelperAppDB.txt file.
Purpose
The PiHelperAppDB.txt file is a database containing helper
application descriptions. Helper applications are programs that can be
launched through mechanisms in the Cosmo Create and Cosmo Worlds
plug-in architecture.
Format
The format of the file is line-oriented and very simple. The file
should contain zero or more application description blocks, each
beginning with "Begin" and ending with "End."
Within the block, each line describes a single attribute of the
application description. The line consists of the field's ID, followed
by a colon and then the value of the attribute.
Begin
ID: com.sgi.cosmo.photoshop
UINAME: Photoshop
REPTYPE: PiUnixApp
FLAVOR: Editor
EXECUTABLE: photoshop
ARGS: -open %f
PIXMAP: photoshop.xpm
NATIVE: PhotoshopDocument
FILETYPES: PhotoshopDocument GIFImageFile TIFFImage SGIImage
End
Field Meanings
-
ID: the unique string ID of the helper application.
-
UINAME: the name that should appear in the user interface to
represent this application.
-
REPTYPE: the name of the class that should represent this
application at runtime. Currently, only "PiUnixApp" is
supported here. A PiUnixApp is started with some forks(), and FAM (the
File Alteration Monitor) is used to monitor changes to the file being
edited.
-
FLAVOR: specify "Editor."
-
EXECUTABLE: this is the executable to run. It may be an
absolute path. If it is relative, the user's path is searched.
-
ARGS: the arguments to pass the program when running it.
-
PIXMAP: the filename of an XPM file containing the pixmap
for this helper application.
-
NATIVE: this is the FTR name of the application's
"preferred" file type -- the type that should be created if
you need to make a new file of this type. This field should have only
one value. This value should be included in the FILETYPES field.
-
FILETYPES: these are the FTR names of the file types the
application will handle. This list should include the name in NATIVE. Note:
you do not have to put all of the file types that your
application handles, just the ones you are willing to have the database
offer it for.
PiUnixApp launching
PiUnixApp uses the EXECUTABLE and ARGS fields of its application
description when it launches the application.
Since the application is used by a PiEditSession to edit a file on the
disk, the arguments can be parameterized by information about that file
(similar to a mailcap file). The basic input is the file to be operated
on. Different parameters are available to provide information about
different parts of it.
File-Centric Parameters
-
%D -- the directory of the file to be edited
-
%f -- the filename of the file to edit (without directory)
-
%F-- absolute path to the file to edit
-
%copy -- filenames of the input copy of the file (without directory)
-
%COPY -- absolute paths to the input copy file
Some programs require both an input and an output file. We provide
%copy and %COPY for these programs. If the PiUnixApp sees one of these
parameters, it copies the input file to a temporary file in the same
directory and sets %copy and %COPY appropriately.
Window Mapping Parameter
-
%wr -- for window role property. This will be replaced by something
like
-xrm *windowRole: PiUnixAppXXXXXXX
Put %wr in your args only if you support -xrm args. You probably
support them if you pass your arguments to XtInitialize.