PostScriptView, PostScriptViews - base classes for exter-
nal representation objects that generate PostScript code
SYNOPSIS
#include <Unidraw/Components/psview.h>
DESCRIPTION
PostScriptView is a PreorderView that serves as the
abstract base class for external representation objects
for emitting PostScript code. A PostScriptView's subject
is normally a GraphicComp subclass. PostScriptViews is a
subclass of PostScriptView for composite PostScript exter-
nal views.
POSTSCRIPTVIEW PUBLIC OPERATIONS
virtual boolean Emit(ostream&)
PostScriptView redefines Emit to generate header
information. Thus you can call Emit on any
PostScriptView subclass to generate encapsulated
PostScript. Subclasses redefine Definition to gen-
erate the PostScript fragment that defines their
basic attributes.
GraphicComp* GetGraphicComp()
Return the subject.
POSTSCRIPTVIEW PROTECTED OPERATIONS
PostScriptView(GraphicComp* = nil)
Initialize a PostScriptView, optionally of the
given GraphicComp. The constructor is protected to
disallow instantiation.
PostScriptView defines numerous protected helper functions to
make it
easier for subclasses to generate the PostScript that
describes their appearance. The output conforms to the
original idraw PostScript format.
virtual void Comments(ostream&)
virtual void PSVersion(ostream&)
virtual void Creator(ostream&)
virtual void FontNames(ostream&)
virtual void Pages(ostream&)
virtual void BoundingBox(ostream&)
The Comments operation generates a standard
PostScript comments block. Comments calls the
other operations to generate a complete set of com-
ments.
virtual void Prologue(ostream&)
virtual void Version(ostream&)
virtual void GridSpacing(ostream&)
Operations that generate global data, procedures,
and idraw-format-specific information.
virtual void MinGS(ostream&)
virtual void FullGS(ostream&)
virtual void TextGS(ostream&)
virtual void Brush(ostream&)
virtual void FgColor(ostream&)
virtual void BgColor(ostream&)
virtual void Font(ostream&)
virtual void Pattern(ostream&)
virtual void Transformation(ostream&)
Operations that generate graphics state informa-
tion. All output the graphics state attribute that
their name suggests, with three exceptions: MinGS
outputs a minimal set of graphics state defined by
practical graphic objects, namely a brush, fore-
ground and background colors, a pattern, and a
transformation matrix. TextGS outputs the graphics
state required by textual graphics, including a
foreground color, a font, and a transformation
matrix. FullGS generates a full set of graphics
state.
virtual void SetPSFonts(UList*)
virtual UList* GetPSFonts()
Get and set the list of all PostScript font names
required by the PostScriptView. This set of names
appears in a comment near the beginning of the gen-
erated output as required by standard PostScript
conventions.
virtual void GetBox(Coord&, Coord&, Coord&, Coord&)
Return the bounding box of the graphic for which
PostScript is being generated. These values also
appear in a standard PostScript comment.
virtual void GridSpacing(float&, float&)
Return the grid spacing, if applicable. Idraw
requires this information, and it is buried in a
comment.
virtual void BeginProc(ostream&)
virtual void EndProc(ostream&)
Begin and end a scope for defining a graphical
object.
virtual void ConstProcs(ostream&)
Generate PostScript procedures containing constant
information, such as the character encoding dictio-
nary, string length limit, etc.
virtual void SetBrushProc(ostream&)
virtual void SetFgColorProc(ostream&)
virtual void SetBgColorProc(ostream&)
virtual void SetFontProc(ostream&)
virtual void SetPatternProc(ostream&)
Generate PostScript procedures for setting graphics
state attributes.
virtual void ObjectProcs(ostream&)
virtual void BSplineProc(ostream&)
virtual void CircleProc(ostream&)
virtual void ClosedBSplineProc(ostream&)
virtual void EllipseProc(ostream&)
virtual void LineProc(ostream&)
virtual void MultiLineProc(ostream&)
virtual void PolygonProc(ostream&)
virtual void RectangleProc(ostream&)
virtual void TextProc(ostream&)
Generate PostScript procedures for instantiating
basic graphical objects.
virtual void MiscProcs(ostream&)
virtual void DefinitionProc(ostream&)
virtual void FillProc(ostream&)
virtual void StrokeProc(ostream&)
virtual void ShowProc(ostream&)
virtual void PatternProc(ostream&)
virtual void MinMaxProcs(ostream&)
virtual void MidpointProc(ostream&)
virtual void ThirdpointProc(ostream&)
virtual void SubsplineProc(ostream&)
virtual void StoreVerticesProc(ostream&)
MiscProcs encapsulates calls to the subsequent
PostScript procedure-generating operations shown
above. DefinitionProc generates PostScript code
that declares a procedure. FillProc and StrokeProc
fill and stroke the path that a graphical object
defines. ShowProc fine-tunes a text object's posi-
tion. PatternProc creates a PostScript rendition
of a pattern. MinMaxProcs define min and max func-
tions. MidpointProc and ThirdpointProc calculate
the point midway and one-third the way between two
points, respectively. SubsplineProc breaks the
vertices defining a spline into smaller pieces to
allow approximating the spline with Bezier curves.
Finally, StoreVerticesProc stores a set of vertices
in arrays.
PSFont* GetFont(UList*)
PostScriptView* View(UList*)
Convenience functions that return the PSFont and
PostScriptView in UList elements, respectively.
Create the appropriate PostScriptView subclass for
the given GraphicComp. The relationship between
subjects, views, and view categories is encoded in
their class identifiers. See classes(3U) for more
information on class identifiers and view cate-
gories.
POSTSCRIPTVIEWS PUBLIC OPERATIONS
PostScriptViews(GraphicComps* = nil)~
The constructor takes the subject as an optional
argument.
virtual boolean Update()
For simplicity, PostScriptViews reconciles its
state with its subject's by destroying its children
and reconstructing them from scratch.
POSTSCRIPTVIEWS PROTECTED OPERATIONS
UList* Elem(Iterator)
A convenience function for extracting a UList from
an iterator.
void DeleteView(Iterator&)
void DeleteViews()
DeleteView removes a child and deletes it, while
DeleteViews removes and deletes all children.
SEE ALSO
ExternView(3U), GraphicComp(3U), GraphicView(3U),
UList(3U), classes(3U), idraw(1I), pspaint(3U)
Man(1) output converted with
man2html