DIRECTORY Geom2D USING [Rect], Imager USING [Context], ImagerFont USING [Font], Rope USING [ROPE], SilDisplayInternal USING [CommandChange, defaultColor], SilFile USING [Color, InternalFonts, SilObject, SilObjectRec, UserFonts], SilKernel USING [SilData, SilDisplayData, SilModel, SilUIData], SilUserInput USING [Face], ViewerClasses USING [Viewer] ; SilDisplayUtils: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; SilData: TYPE = SilKernel.SilData; SilDisplayData: TYPE = SilKernel.SilDisplayData; SilModel: TYPE = SilKernel.SilModel; SilUIData: TYPE = SilKernel.SilUIData; SilObjectRec: TYPE = SilFile.SilObjectRec; CommandChange: TYPE = SilDisplayInternal.CommandChange; DisplayChoice: TYPE = {show, erase, select}; ContextChoice: TYPE = {normal, magnified}; ColorFontOrFace: TYPE = {color, font, face, invalid}; AttributeRec: TYPE = RECORD [ referenced: ColorFontOrFace, color: SilFile.Color _ SilDisplayInternal.defaultColor, font: SilFile.UserFonts _ 0, face: SilUserInput.Face _ italic ]; Orientation: TYPE = {vertical, horizontal}; BoxEnd: TYPE = {long, short}; FileType: TYPE = {input, output, largeOutput}; SilUtilsInit: PROC []; GetFont: PROC [font: SilFile.InternalFonts, italic: BOOL _ FALSE] RETURNS [fontRef: ImagerFont.Font]; SwapFonts: PROC [data: SilData, ctx: Imager.Context]; ModifyContext: PROC [makeContext: ContextChoice _ normal, dData: SilDisplayData, ctx: Imager.Context]; MagnifyDrawing: PROC [data: SilData, ctx: Imager.Context, xMin, yMin, xMax, yMax: INTEGER]; SilRebuild: PROC [data: SilData, ctx: Imager.Context]; MergeRebuild: PROC[dData: SilDisplayData, model: SilModel, xMin, yMin, xMax, yMax: INTEGER, selectedOnly: BOOL _ FALSE]; PaintObject: PROC [model: SilModel, sobr: SilFile.SilObjectRec, dMode: DisplayChoice, ctx: Imager.Context, oneLevel, foregroundOnly: BOOLEAN _ FALSE, print: BOOLEAN _ FALSE]; ChangeCommandLineData: PROC [data: SilData, ctx: Imager.Context, change: SilDisplayInternal.CommandChange _ Pos, boolArg: BOOL _ FALSE, intArg1: INTEGER _ 0, intArg2: INTEGER _ 0]; ExpandMacro: PROC[model: SilModel, char: CHAR, x, y: INTEGER, oneLevel: BOOL, ctx: Imager.Context]; EraseArea: PROC[xMin, yMin, xMax, yMax: INTEGER, ctx: Imager.Context]; MergeArea: PROC[dData: SilDisplayData, model: SilModel, xMin, yMin, xMax, yMax: INTEGER, ctx: Imager.Context]; BBoxFilter: PROC[xMin, yMin, xMax, yMax: INTEGER, sobr: SilFile.SilObjectRec] RETURNS [passed: BOOL]; AttributeFromChar: PROC[char: CHAR] RETURNS [AR: AttributeRec]; AttributeFilter: PROC[AR: AttributeRec, sobr: SilFile.SilObjectRec] RETURNS [passed: BOOL]; OffsetFilter: PUBLIC PROC[sobr: SilObjectRec, offsetDirection: Orientation, offset, xMin, yMin, xMax, yMax: INTEGER] RETURNS [passed: BOOL _ FALSE, bEnd: BoxEnd _ long]; StretchBox: PUBLIC PROC[sob: SilFile.SilObject, offsetDirection: Orientation, bEnd: BoxEnd, offset: INTEGER]; FixBoxConnectivity: PUBLIC PROC[dData: SilDisplayData, sobrIn: SilObjectRec, boxDir: Orientation] RETURNS [sobr: SilObjectRec]; BoundingBoxOfContext: PROC [ctx: Imager.Context] RETURNS[xMin, yMin, xMax, yMax: INTEGER]; DeselectAndPaintAll: PROC [model: SilModel, ctx: Imager.Context]; PaintAllSelectedAsDeselected: PROC [model: SilModel, ctx: Imager.Context]; DisplayGrid: PROC [eraseOrShow: SilDisplayUtils.DisplayChoice, dData: SilDisplayData, model: SilModel, ctx: Imager.Context]; DisplayFrames: PROC [eraseOrShow: SilDisplayUtils.DisplayChoice, dData: SilDisplayData, model: SilModel, ctx: Imager.Context]; AbortRopeInput: PROC[data: SilData, markX, markY: INTEGER, ctx: Imager.Context]; BoundingBoxOfObject: PROC[model: SilModel, sobr: SilObjectRec] RETURNS [xMin, yMin, xMax, yMax: INTEGER]; BoundingBoxOfModel: PROC[dData: SilDisplayData, model: SilModel, mapArea: BOOLEAN _ TRUE] RETURNS [rect: Geom2D.Rect]; GuessFileName: PROC[data: SilData, file: FileType]; GuessHardFileName: PROC[data: SilData, c: CHAR]; InputNamedFile: PROC[data: SilData, name: ROPE, ctx: Imager.Context]; OutputNamedFile: PROC[data: SilData, name: ROPE, viewer: ViewerClasses.Viewer]; KillConfirmedFile: PROC[data: SilData, ctx: Imager.Context, viewer: ViewerClasses.Viewer]; HardcopyFile: PROC[data: SilData, name: ROPE]; DefineConfirmedMacro: PROC[data: SilData, name: CHAR, ctx: Imager.Context]; ClearConfirmedMacroDefs: PROC[data: SilData, ctx: Imager.Context]; CheckFileExtension: PROC[name: ROPE, type: FileType] RETURNS[nameAndExt: ROPE]; MarkFileAsEdited: PROC[data: SilData, ctx: Imager.Context, viewer: ViewerClasses.Viewer]; EditText: PROC [EditThis: REF TEXT, c: CHAR] RETURNS [Edited: REF TEXT, Finished: BOOL _ FALSE, Aborted: BOOL _ FALSE, BackedUp: BOOL _ FALSE]; END.  SilDisplayUtils.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Tracy Larrabee: March 29, 1984 1:31:39 pm PST Last Edited by: Ken Pier, August 15, 1985 5:00:10 pm PDT A module defining the display service routines. Set global variables necessary to the correct functioning of the Display service routines ( various font refs). Return the font description for a given internal Font( number). toggle display font between "normal" and "hardcopy" display Modify the context to reflect the current state of the window as supplied in the display data. Enter Magnify mode. Modify the display of the drawing and the state of the display data to reflect the change. Send the boundin box of the region intended to be magnified. Rebuild the display inside the box given in dData. Set the fields in dData to reflect the fact that any current rebuilds should include the box defined by xMin, yMin, xMax, yMax. If SelectedOnly then only rebuild the selected objects. Paint one Sil Object on the screen Modify the Command Line data for this window to reflect the new info. Depending on change one or more of the arguments will be used to supply interesting values. In all cases except when change is pos, the display data of the Sil will be updated. Expand the Macro Given. If oneLevel then don't expand any contained macros. Erase an area of the screen. Used for making sure the screen starts from scratch. merge an area into the area needing rebuilding TRUE if some part of sobr appears inside the box defined in dData. Can make this an inline when the need arises. Return information about which attribute is referenced by the given char. char = 0-9 => font. char = D,R,O,Y,L,G,T,C,A,V,U,M,P,S,N,or W => color. char = b,B,i,or I => face. The AttributeRec contains a discription of certain attributes which sobr may or may not have Return TRUE if sobr has the attribute described in AR. Return TRUE if sobr represents a box with just one end inside the box defined by xMin, yMin, xMax, yMax and could be appropriately shortened or lengthened in the direction and by the amount given. Stretch the box given by sob by the amount given by offset in the direction given by offsetDirection at the box end given by bEnd. Figure out from the dData given if the current box is going to have to be extended by a box length in order to provide a nice connection in the lower right hand corner (you may have to draw a few boxes in Sil to feel comfortable with this statement). Return the bounding box of the context given, in integer coordinates. Deselect all of the objects which are currently selected. If there are objects selected from this model, paint all of them as deselected, but dont change the data structure. Erase or display the grids as specified in dData. Erase or display the page frames as specified in dData. Call this if the user was inputting a rope, but changed his mind for some reason. Return the bounding box of the Object given. Do not assume that the bounding box given in sobr is correct. Return the bounding box of the model given, in Client Coordinates. Guess as to the appropriate file name for input or output. Set appropriate data values and place file name in message window for user to edit. Guess as to the appropriate file name to produce for hardcopy output. Set appropriate data values and place file name in message window for user to edit. C will indicate what type of device to produce the PD file fo: R for Raven, H for Hornet, G for Gnat, P for PlateMaker, R for ReticleMaker, U for Puffin, and C for ColorVersatec. Input a named Sil file. It should be noted that a Sil file maybe read in more than once, and will result in two copies of each file object existing in the Sil environment (any number of different files can also be read in and co-exist). Output a named Sil file. Kill a Sil file. User has already confirmed this kill. Produce a hardcopy file (PD file) with the name given for the sil data given. Define a macro from the selected objects. User has already confirmed this definition. Clear all Macro Definitions. User has already confirmed this drastic act. If the filename given has no extension and no dot on the end add an appropriate extension to the name. Mark the file as edited. This may involve the removal of "build marks." (Visual cues put in Sil files by post processing DA programs. Reflect the effect of this input char on the text given. If the input character implies that this rope has been aborted or finished, return the apropriate values. Return BackedUp TRUE if the some characters in the rope had to be removed. ʘcodešœ™Kšœ Ïmœ1™<—K™-™8K™—K™/šÏk ˜ Kšœžœ˜Kšœžœ ˜Kšœ žœ˜Kšœžœžœ˜Kšœžœ˜7Kšœžœ<˜IKšœ žœ0˜?Kšœ žœ˜Kšœžœ ˜Kšœ˜—K˜šÏnœžœž œž˜*K˜Kšžœžœžœ˜Kšœ žœ˜"Kšœžœ˜0Kšœ žœ˜$Kšœ žœ˜&Kšœžœ˜*Kšœžœ$˜7Kšœžœ˜,Kšœžœ˜*Kšœžœ ˜5šœžœžœ˜K˜Kšœ7˜7Kšœ˜Kšœ ˜ K˜—Kšœ žœ˜+Kšœžœ˜Kšœ žœ ˜.K˜šŸ œžœ˜K™oK™—š Ÿœžœ'žœžœžœ˜eK™?K˜—šŸ œžœ&˜5K™;K˜—šŸ œžœS˜fK™^K™—šŸœžœ>žœ˜[K™­K™—šŸ œžœ&˜6K™2K˜—š Ÿ œžœAžœžœžœ˜xKšœ·™·K™—š Ÿ œžœtžœžœ žœžœ˜®K™"K™—š Ÿœžœ_žœžœ žœžœ˜´Kš œTÏbœ œ^ œ œ.™ùK˜—š Ÿ œžœžœžœ žœ˜cK™LK˜—šŸ œžœžœ˜FK™RK˜—šŸ œžœAžœ˜nK™.K˜—š Ÿ œžœžœžœ žœ˜e™pK™——š Ÿœžœžœžœžœ˜?šœI™IK™K™3K™K™——š Ÿœžœžœ,žœ žœ˜[šœ”™”K™——šŸ œžœžœSžœžœ žœžœ˜©K™ÄK™—šŸ œžœžœMžœ˜mKšœ‚™‚K™—šŸœžœžœCžœ˜K™ûK™—šŸœžœžœžœ˜[K™EK™—šŸœžœ(˜AKšœ9™9K˜—šŸœžœ(˜JK™sK™—šŸ œžœk˜|K™1K˜—šŸ œžœk˜~K™7K˜—šŸœžœžœ˜PK™QK™—šŸœžœ&žœžœ˜iKšœn™n—š Ÿœžœ2žœžœžœ˜vKšœB™BK™—šŸ œžœ ˜3K™K™—šŸœžœžœ˜0šœÚ™ÚKšœs™s—K™—šŸœžœžœ˜EKšœí™íK™—šŸœžœžœ ˜OKšœ™K™—šŸœžœC˜ZKšœ7™7K™—šŸ œžœžœ˜.KšœM™MK™—šŸœžœžœ˜KKšœV™VK™—šŸœžœ%˜BKšœI™IK™—š Ÿœžœžœžœ žœ˜OKšœg™gK™—šŸœžœC˜YK™‡K™—šŸœžœ žœžœžœžœ žœžœ žœžœ žœžœ žœžœ˜Kšœí™íK™——Kšžœ˜—…—*;