Catalog(constchar*domainName,Creator*,floatversion)
Construct a catalog, supplying an application-unique domain name, a creator object, and a version
number. Unidraw objects may use the domain name for file type checking purposes, and they may
rely on the version number to handle evolving storage formats.
virtualbooleanSave(EditorInfo*,constchar*)virtualbooleanSave(Component*,constchar*)virtualbooleanSave(Command*,constchar*)virtualbooleanSave(Tool*,constchar*)
Save an object instance under the specified name. The catalog stores a textual representation for
the object in a file with the given name; therefore a name with embedded slashes corresponds to
the path name for the file containing the textual representation. These operations return false
if the file could not be written.
virtualbooleanRetrieve(constchar*,EditorInfo*&)virtualbooleanRetrieve(constchar*,Component*&)virtualbooleanRetrieve(constchar*,Command*&)virtualbooleanRetrieve(constchar*,Tool*&)
Retrieve an object instance having the specified name. The catalog reconstructs an instance of
the object from the corresponding file when the instance is first retrieved. Subsequent
retrievals with the same name return a reference to the instance already in memory. These
operations return false if the instance could not be reconstructed from the file.
virtualvoidForget(EditorInfo*,constchar*=nil)virtualvoidForget(Component*,constchar*=nil)virtualvoidForget(Command*,constchar*=nil)virtualvoidForget(Tool*,constchar*=nil)
Forget the name-to-object mapping for the given instance. If the optional string is supplied, the
catalog forgets a specific name-to-object mapping, which is useful when an instance has been saved
under different names.
virtualconstchar*GetName(EditorInfo*)virtualconstchar*GetName(Component*)virtualconstchar*GetName(Command*)virtualconstchar*GetName(Tool*)
Get a name associated with an instance. These operations do not specify which name is returned
for instances that have been saved under more than one name.
virtualbooleanValid(constchar*,EditorInfo*&)virtualbooleanValid(constchar*,Component*&)virtualbooleanValid(constchar*,Command*&)virtualbooleanValid(constchar*,Tool*&)
Return whether the given name has an instance already associated with it (i.e., it has been saved
or retrieved) and if so return that instance in the second parameter.
virtualComponent*Copy(Component*)virtualCommand*Copy(Command*)virtualTool*Copy(Tool*)
Copy an instance by saving it under a temporary name, then retrieving it, and finally forgetting
the temporary name. A component, command, or tools subclass can use the corresponding function to
implement their Copy function easily, possibly at the expense of run-time performance.
virtualbooleanExists(constchar*)
Return whether a file with the given name exists. A return value of true does not necessarily
mean that an object has been saved under the specified name.
virtualbooleanWritable(constchar*)
Return whether it is permitted to save an object under the given name.
voidSetClipboard(Clipboard*)Clipboard*GetClipboard()
Set or get a globally-accessible clipboard object.
voidSetEditorInfo(EditorInfo*)EditorInfo*GetEditorInfo()
Set or get a globally-accessible editor info object.
constchar*GetName()Creator*GetCreator()floatGetVersion()
Return the values of constructor-specified parameters.
floatFileVersion()
Return the Unidraw version number of the file being read currently.
constchar*GetAttribute(constchar*)
Return the value of a user preference with the given name as stored in the global PropertySheet.
This operation is equivalent to the World operation of the same name.
voidWriteVersion(int,ostream&)voidWriteClassId(ClassId,ostream&,intid=0)voidWriteComponent(Component*,ostream&)voidWriteCommand(Command*,ostream&)voidWriteTool(Tool*,ostream&)voidWriteStateVar(StateVar*,ostream&)voidWriteTransferFunct(TransferFunct*,ostream&)voidWriteBgFilled(boolean,ostream&)voidWriteBrush(PSBrush*,ostream&)voidWriteColor(PSColor*,ostream&)voidWriteFont(PSFont*,ostream&)voidWritePattern(PSPattern*,ostream&)voidWriteTransformer(Transformer*,ostream&)voidWriteString(constchar*,ostream&)voidWriteControlInfo(ControlInfo*,ostream&)voidWriteEditorInfo(EditorInfo*,ostream&)voidWriteBitmap(Bitmap*,ostream&)voidWriteBitmapData(Bitmap*,ostream&)voidWriteGraymap(Raster*,ostream&)voidWriteGraymapData(Raster*,ostream&)voidWriteRaster(Raster*,ostream&)voidWriteRasterData(Raster*,ostream&)intReadVersion(istream&)ClassIdReadClassId(istream&,int&id)Component*ReadComponent(istream&)Command*ReadCommand(istream&)Tool*ReadTool(istream&)StateVar*ReadStateVar(istream&)TransferFunct*ReadTransferFunct(istream&)intReadBgFilled(istream&)PSBrush*ReadBrush(istream&)PSColor*ReadColor(istream&)PSFont*ReadFont(istream&)PSPattern*ReadPattern(istream&)Transformer*ReadTransformer(istream&)char*ReadString(istream&)ControlInfo*ReadControlInfo(istream&)EditorInfo*ReadEditorInfo(istream&)Bitmap*ReadBitmap(istream&)Bitmap*ReadBitmapData(istream&)Raster*ReadGraymap(istream&)Raster*ReadGraymapData(istream&)Raster*ReadRaster(istream&)Raster*ReadRasterData(istream&)
Write and read information via streams. Catalog-managed classes use these operations in their
Write and Read functions to write and read the objects they contain. The operations for writing
and reading bitmaps and rasters have accompanying operations that write and read only the ASCII
data (i.e., omitting transformation and other Unidraw format-specific data) that encodes their
information content.
PSBrush*ReadBrush(constchar*definition,intindex)PSColor*ReadColor(constchar*definition,intindex)PSFont*ReadFont(constchar*definition,intindex)PSPattern*ReadPattern(constchar*,intindex)
Return a PostScript paint object corresponding to the value of a user preference with the given
definition and index number as stored in the global PropertySheet. Each string in the X defaults
database of the form ``<applicationName>.resource:definition'' sets a resource. The resource
names and their definitions are specified as follows:
brushi: Define the ith brush resource. The ReadBrush operation retrieves the brush object for
this resource given a definition. The definition usually specifies two numbers: a 16-bit
hexadecimal number to define the brush's line style (each 1 bit draws a dash and each 0 bit
produces a gap), and a decimal integer to define the brush's width in pixels. For example, ``ffff
1'' defines a single pixel wide solid line. If the definition specifies only the string ``none'',
then it defines the nonexistent brush.
fgcolori: Define the ith foreground color resource. The ReadColor operation retrieves the color
object for this resource given a definition. The definition contains a string defining the name
of the color, optionally followed by three decimal numbers between 0 and 65535 to define the red,
green, and blue components of the color's intensity. The intensities override the name; that is,
the catalog will look the name up in the database of common colors only if you omit the
intensities. For example, ``Indigo 48896 0 65280'' defines a color which is a mixture of red and
blue. You can define shades of gray by using equal proportions of each primary color.
bgcolori: The background color resource definition is specified in the same manner as the
foreground color.
fonti: Define the ith font resource. The ReadFont operation retrieves the font object for this
resource given a definition. The definition contains three strings separated by whitespace. The
first string defines the font's name, the second string the corresponding print font, and the
third string the print size. For example, ``8x13bold Courier-Bold 13'' defines the third font
entry.
patterni: Define the ith pattern resource. The ReadPattern operation retrieves the pattern object
for this resource given a definition. The definition can specify the pattern for a 16x16 bitmap,
a 8x8 bitmap, a 4x4 bitmap, a grayscale number, or the string ``none''. You specify the 16x16
bitmap with sixteen 16-bit hexadecimal numbers, the 8x8 bitmap with eight 8-bit hexadecimal
numbers, the 4x4 bitmap with a single 16-bit hexadecimal number, and the grayscale number with a
single floating point number. The floating point number must contain a period to distinguish
itself from the single hexadecimal number, and it must lie between 0.0 and 1.0, where 0.0
corresponds to a solid pattern and 1.0 to a clear pattern. On the printer, the bitmap patterns
appear as bitmaps, the grayscale patterns appear as halftoned shades, and the ``none'' patterns
never obscure underlying graphics. For example, ``pattern8:8421'' defines a diagonally hatched
pattern.
PSBrush*FindNoneBrush()PSBrush*FindBrush(int,int)PSColor*FindColor(constchar*,int=0,int=0,int=0)PSFont*FindFont(constchar*,constchar*,constchar*)PSPattern*FindNonePattern()PSPattern*FindGrayLevel(float)PSPattern*FindPattern(int[],int)
Return a PostScript paint object with the corresponding attributes. These operations return a new
paint object if no object with the given attributes already exists; otherwise the operations
return an existing instance with matching attributes.
voidSkip(istream&)voidMark(ostream&)
Mark injects a synchronization sequence defined by MARK (see globals(3U)) into the output stream.
Skip searches for the same sequence in the given input stream and position the stream immediately
after that sequence.