logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

PostScriptView, PostScriptViews - base classes for external representation objects that generate

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 external views.

Name

       PostScriptView,  PostScriptViews  -  base  classes  for  external  representation  objects  that generate
       PostScript code

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.

       virtualvoidComments(ostream&)virtualvoidPSVersion(ostream&)virtualvoidCreator(ostream&)virtualvoidFontNames(ostream&)virtualvoidPages(ostream&)virtualvoidBoundingBox(ostream&)
              The Comments operation generates a standard PostScript comments block.  Comments calls  the  other
              operations to generate a complete set of comments.

       virtualvoidPrologue(ostream&)virtualvoidVersion(ostream&)virtualvoidGridSpacing(ostream&)virtualvoidTrailer(ostream&)
              Operations that generate global data, procedures, and idraw-format-specific information.

       virtualvoidMinGS(ostream&)virtualvoidFullGS(ostream&)virtualvoidTextGS(ostream&)virtualvoidBrush(ostream&)virtualvoidFgColor(ostream&)virtualvoidBgColor(ostream&)virtualvoidFont(ostream&)virtualvoidPattern(ostream&)virtualvoidTransformation(ostream&)
              Operations that generate graphics state information.  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, foreground 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.

       virtualvoidSetPSFonts(UList*)virtualUList*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 generated output as required by standard
              PostScript conventions.

       virtualvoidGetBox(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.

       virtualvoidGridSpacing(float&,float&)
              Return the grid spacing, if applicable.  Idraw requires this information, and it is  buried  in  a
              comment.

       virtualvoidBeginProc(ostream&)virtualvoidEndProc(ostream&)
              Begin and end a scope for defining a graphical object.

       virtualvoidConstProcs(ostream&)
              Generate  PostScript  procedures  containing  constant information, such as the character encoding
              dictionary, string length limit, etc.

       virtualvoidSetGSProcs(ostream&)virtualvoidSetBrushProc(ostream&)virtualvoidSetFgColorProc(ostream&)virtualvoidSetBgColorProc(ostream&)virtualvoidSetFontProc(ostream&)virtualvoidSetPatternProc(ostream&)
              Generate PostScript procedures for setting graphics state attributes.

       virtualvoidObjectProcs(ostream&)virtualvoidBSplineProc(ostream&)virtualvoidCircleProc(ostream&)virtualvoidClosedBSplineProc(ostream&)virtualvoidEllipseProc(ostream&)virtualvoidLineProc(ostream&)virtualvoidMultiLineProc(ostream&)virtualvoidPolygonProc(ostream&)virtualvoidRectangleProc(ostream&)virtualvoidTextProc(ostream&)
              Generate PostScript procedures for instantiating basic graphical objects.

       virtualvoidMiscProcs(ostream&)virtualvoidDefinitionProc(ostream&)virtualvoidFillProc(ostream&)virtualvoidStrokeProc(ostream&)virtualvoidShowProc(ostream&)virtualvoidPatternProc(ostream&)virtualvoidMinMaxProcs(ostream&)virtualvoidMidpointProc(ostream&)virtualvoidThirdpointProc(ostream&)virtualvoidSubsplineProc(ostream&)virtualvoidStoreVerticesProc(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  position.   PatternProc creates a PostScript rendition of a pattern.  MinMaxProcs define
              min and max functions.  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.

       PostScriptView*CreatePSView(GraphicComp*)
              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 categories.

Postscriptview Protected Operations

PostScriptView(GraphicComp*=nil)
              Initialize a PostScriptView, optionally of the given GraphicComp.  The constructor is protected to
              disallow instantiation.

Postscriptview Public Operations

virtualbooleanEmit(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
              generate the PostScript fragment that defines their basic attributes.

       GraphicComp*GetGraphicComp()
              Return the subject.

Postscriptviews Protected Operations

UList*Elem(Iterator)
              A convenience function for extracting a UList from an iterator.

       voidDeleteView(Iterator&)voidDeleteViews()
              DeleteView removes a child and deletes it, while DeleteViews removes and deletes all children.

Postscriptviews Public Operations

PostScriptViews(GraphicComps*=nil)~
              The constructor takes the subject as an optional argument.

       virtualbooleanUpdate()
              For simplicity, PostScriptViews reconciles its state with its subject's by destroying its children
              and reconstructing them from scratch.

See Also

ExternView(3U), GraphicComp(3U), GraphicView(3U), UList(3U), classes(3U), idraw(1I), pspaint(3U)

Unidraw                                          19 January 1991                              PostScriptView(3U)

Synopsis

#include<Unidraw/Components/psview.h>

See Also