PostScriptView(3U)
π PostScriptView(3U) π
okay so bestie, we're deep in the InterViews Reference Manual today and the main character is PostScriptView(3U). grab a snack, hydrate, we're doing this. πβ¨
β¨ NAME β¨
PostScriptView, PostScriptViews β base classes for external representation objects that generate PostScript code π
π SYNOPSIS π
#include <Unidraw/Components/psview.h>
π¦ DESCRIPTION π¦
So here's the tea. PostScriptView is a PreorderView, and it serves as the abstract base class for external representation objects that emit PostScript code. a PostScriptView's subject is normally a GraphicComp subclass β that's just how she rolls. π«Ά
PostScriptViews is a subclass of PostScriptView, and it exists for composite PostScript external views. group project energy, but make it PostScript. π
π POSTSCRIPTVIEW PUBLIC OPERATIONS π
virtual boolean Emit(ostream&)βPostScriptViewredefinesEmitso it generates header information. meaning: you can callEmiton literally anyPostScriptViewsubclass and get encapsulated PostScript out of it. subclasses do their own thing by redefiningDefinition, which generates the PostScript fragment that defines their basic attributes. slay. π₯GraphicComp* GetGraphicComp()β returns the subject. that's it, that's the function. π
π§ POSTSCRIPTVIEW PROTECTED OPERATIONS π§
PostScriptView(GraphicComp* = nil)β initializes aPostScriptView, optionally of the givenGraphicComp. this constructor is protected, which means you literally cannot instantiate it. look but don't touch, no cap. π
PostScriptView defines numerous protected helper functions to make it easier for subclasses to generate the PostScript that describes their appearance. and the output conforms to the original idraw PostScript format. periodt.
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, and Comments calls all the other operations here to generate a complete set of comments. she delegates, she's a manager. π
virtual void Prologue(ostream&)virtual void Version(ostream&)virtual void GridSpacing(ostream&)virtual void Trailer(ostream&)
These are the 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&)
These generate graphics state information. all of them output the graphics state attribute that their name suggests, with three exceptions:
MinGSoutputs a minimal set of graphics state defined by practical graphic objects β namely a brush, foreground and background colors, a pattern, and a transformation matrix.TextGSoutputs the graphics state required by textual graphics, including a foreground color, a font, and a transformation matrix.FullGSgenerates 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 shows up in a comment near the beginning of the generated output, as required by standard PostScript conventions. iykyk. πΈ
virtual void GetBox(Coord&, Coord&, Coord&, Coord&)β returns the bounding box of the graphic for which PostScript is being generated. these values also appear in a standard PostScript comment. two for one, iconic. β¨virtual void GridSpacing(float&, float&)β returns the grid spacing, if applicable. Idraw requires this information, and it is buried in a comment. she's shy like that. π¦virtual void BeginProc(ostream&)virtual void EndProc(ostream&)
Begin and end a scope for defining a graphical object. open and close, like a good conversation. π«Ά
virtual void ConstProcs(ostream&)β generates PostScript procedures containing constant information, such as the character encoding dictionary, string length limit, etc. βvirtual void SetGSProcs(ostream&)virtual void SetBrushProc(ostream&)virtual void SetFgColorProc(ostream&)virtual void SetBgColorProc(ostream&)virtual void SetFontProc(ostream&)virtual void SetPatternProc(ostream&)
These 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&)
These generate PostScript procedures for instantiating basic graphical objects. the whole shape squad. π
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&)
okay this group is a lot, let's break it down:
MiscProcsencapsulates calls to the subsequent PostScript procedure-generating operations shown above. she's the one wrangling everybody. πDefinitionProcgenerates PostScript code that declares a procedure.FillProcandStrokeProcfill and stroke the path that a graphical object defines.ShowProcfine-tunes a text object's position. a little nudge, a little glow-up. πPatternProccreates a PostScript rendition of a pattern.MinMaxProcsdefine min and max functions.MidpointProcandThirdpointProccalculate the point midway and one-third the way between two points, respectively.SubsplineProcbreaks the vertices defining a spline into smaller pieces to allow approximating the spline with Bezier curves.- finally,
StoreVerticesProcstores a set of vertices in arrays. PSFont* GetFont(UList*)PostScriptView* View(UList*)
Convenience functions that return the PSFont and PostScriptView in UList elements, respectively. little helpers, so thoughtful. π
PostScriptView* CreatePSView(GraphicComp*)β creates the appropriatePostScriptViewsubclass for the givenGraphicComp. the relationship between subjects, views, and view categories is encoded in their class identifiers. seeclasses(3U)for more information on class identifiers and view categories. π§
π«Ά POSTSCRIPTVIEWS PUBLIC OPERATIONS π«Ά
PostScriptViews(GraphicComps* = nil)~β the constructor takes the subject as an optional argument.virtual boolean Update()β for simplicity,PostScriptViewsreconciles its state with its subject's by destroying its children and reconstructing them from scratch. no incremental glow-up here, it's a full reset. π
π POSTSCRIPTVIEWS PROTECTED OPERATIONS π
UList* Elem(Iterator)β a convenience function for extracting aUListfrom an iterator. βvoid DeleteView(Iterator&)void DeleteViews()
DeleteView removes a child and deletes it, while DeleteViews removes and deletes all the children. goodbye, farewell, blocked. π
π SEE ALSO π
ExternView(3U), GraphicComp(3U), GraphicView(3U), UList(3U), classes(3U), idraw(1I), pspaint(3U)
and that's the whole page bestie, you ate it. this one came out of Unidraw and it's dated 19 January 1991 β vintage but still serving. ππβ¨
π¦ where this page comes from
- debian bookworm: ivtools-dev 2.0.11d.a1-1+b4
- debian trixie: ivtools-dev 2.0.11d.a1-3+b4
- ubuntu jammy: ivtools-dev 2.0.11d.a1-1build1
- ubuntu noble: ivtools-dev 2.0.11d.a1-3build1
- ubuntu questing: ivtools-dev 2.0.11d.a1-3build7
- ubuntu resolute: ivtools-dev 2.0.11d.a1-3build9
- ubuntu stonking: ivtools-dev 2.1.1+git.2025.07.26.a1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms