<> <> <> <> <<>> <> <<>> <> <> <> <> <> <<>> DIRECTORY Rope USING [ROPE], SilKernel USING [SilModel] ; SilFile: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; SilModel: TYPE = SilKernel.SilModel; <> FontType: TYPE = {print, display}; UserFonts: TYPE = [0..9]; MacroFonts: TYPE = [4..9]; FileMacroFonts: TYPE = [4..4]; PresetFonts: TYPE = [0..3]; LibraryFonts: TYPE = [5..9]; InternalFonts: TYPE = [0..15]; InternalMacroFonts: TYPE = [8..13]; InternalFileMacroFonts: TYPE = [8..8]; InternalPresetFonts: TYPE = [0..7]; InternalLibraryFonts: TYPE = [9..13]; InternalRopeFonts: TYPE = [0..13]; --those fonts which do not denote boxes. See below InternalBoxFonts: TYPE = [14..15]; InternalForegroundBoxFonts: TYPE = [14..14]; InternalBackgroundBoxFonts: TYPE = [15..15]; InternalFileMacroFont: InternalFonts = 8; foregroundBoxFont: InternalFonts = 14; backgroundBoxFont: InternalFonts = 15; <> <<>> <> <<0: Font 0>> <<1: Font 0 Bold>> <<2: Font 1>> <<3: Font 1 Bold>> <<4: Font 2>> <<5: Font 2 Bold>> <<6: Font 3>> <<7: Font 3 Bold>> <<8: Font 4 - macro definitions looked up in File>> <<9: Font 5 - macro definitions looked up in Sil.lb5>> <<10: Font 6 - macro definitions looked up in Sil.lb6>> <<11: Font 7 - macro definitions looked up in Sil.lb7>> <<12: Font 8 - macro definitions looked up in Sil.lb8>> <<13: Font 9 - macro definitions looked up in Sil.lb9>> <<14: Object is a box (no associated Rope)>> <<15: Object is a background box (no associated Rope)>> <<>> SilSelection: TYPE = RECORD[ model: SilModel _ NIL, objects: SilObject _ NIL, lastObject: SilObject _ NIL, --this is a dummy object marking the end of the select chain numObjects: INTEGER _ 0, xMin, yMin, xMax, yMax: INTEGER _ 0 ]; PrintingChars: TYPE = CHAR['!..'~]; -- the range of Ascii chars which print meaningfully MacroName: TYPE = CHAR['!..'~]; -- only printing characters are used MacroNameSize: INTEGER = ('~ - '!) + 1; -- number of macro names SilObject: TYPE = LIST OF SilObjectRec; SilObjectRec: TYPE = RECORD[ xMin, yMin: INTEGER, -- Upper Left boundary of box or string xMax, yMax: INTEGER, -- Lower right boundary of box, guess for lower right of string color: Color, -- Color used to display or print object font: InternalFonts, -- Only interesting for Ropes (fonts 0-13) italic: BOOL, -- Only interesting for Ropes (fonts 0-13), TRUE for italic strings value: ROPE _ NIL, selectObj: SilObject _ NIL -- chain together all the currently selected objects ]; Color: TYPE = [0..15]; maxRopeLen: INTEGER = 256; --the longest a String can be (1 byte for its length) PictureType: TYPE = {none, fgnd, bkgnd, macro}; BuildMarkArray: TYPE = ARRAY BuildMarkIndex OF BuildMark; BuildMarkIndex: TYPE = [1..4]; BuildMark: TYPE = RECORD[ xMin, yMin: INTEGER, -- Upper Left boundary of mark xMax, yMax: INTEGER -- Lower right boundary of mark ]; buildMarks: BuildMarkArray = [ [0, 753, 80, 760], [162, 753, 242, 760], [324, 753, 404, 760], [486, 753, 566, 760] ]; InitSil: PROC[] ; <> <> <> <> NewSilModel: PROC[] RETURNS [model: SilModel]; <> MainFileToModel: PROC[model: SilModel, name: ROPE, relative: BOOL]; <> <> <> <> <> ModelToFile: PROC[model: SilModel, name: ROPE, clipIt: BOOL _ FALSE, large: BOOL _ FALSE, xMin, yMin, xMax, yMax: INTEGER _ 0] RETURNS [wasClipped: BOOL _ FALSE]; <> <> <> ClearModel: PROC[model: SilModel]; <> ClearMacros: PROC[model: SilModel]; <> AddObjectToMainPicture: PROC [model: SilModel, sobr: SilObjectRec] RETURNS [sob: SilObject _ NIL]; <> <<>> GetObjectList: PROC [model: SilModel, mode: PictureType _ fgnd, fontNumber: InternalFonts _ 8, c: CHAR _ '!] RETURNS [oblist: SilObject]; <> <<>> CheckSelectionsForMacroDefs: PROC[model: SilModel, disallowName: BOOL _ FALSE, name: MacroName _ '!] RETURNS [SelectionOk: BOOL _ TRUE]; <> DefineMacroFromSelection: PROC[model: SilModel, name: MacroName _ '!, xRef, yRef: INTEGER]; <> <<>> GetMacroBoundingBox: PROC [model: SilModel, fontNumber: InternalFonts _ 8, c: CHAR _ '!] RETURNS [xMin, yMin, xMax, yMax: INTEGER]; <> <<>> GetSelection: PROC [] RETURNS [selection: SilSelection]; <> <<>> CopySelection: PROC [] RETURNS [copiedSelection: SilSelection]; <> EvaluateSelection: PROC; <> DefineSelectWithBox: PROC [model: SilModel, xMin, yMin, xMax, yMax: INTEGER] RETURNS[objXMin, objYMin, objXMax, objYMax: INTEGER _ 0]; <> <> <<>> DefineSelectWithObject: PROC [model: SilModel, sob: SilObject]; <> <<>> Deselect: PROC [model: SilModel, sob: SilObject]; <> <<>> DeselectAll: PROC []; <> <<>> DeleteAndCacheSelection: PUBLIC PROC[cache: BOOL _ FALSE]; <> <<>> DeleteAndCacheObject: PUBLIC PROC[model: SilModel, sob: SilObject]; <> <<>> Undelete: PROC[model: SilModel] RETURNS [sob: SilObject]; <> <<>> ObjectAtPos: PROC [model: SilModel, x, y: INTEGER] RETURNS [sob: SilObject _ NIL]; < with the smallest bounding box and return that object. If there is no object at return NIL.>> <<>> ObjectIsSelected: PROC [model: SilModel, sob: SilObject] RETURNS [selected: BOOL]; <> <<>> FontNameFromInternalFont: PROC[font: PresetFonts, fontType: FontType _ display] RETURNS [fName: ROPE]; <> InternalFontFromUserFont: PUBLIC PROC [font: UserFonts, bold: BOOL] RETURNS [ifont: InternalFonts]; <> <<>> UserFontFromInternalFont: PUBLIC PROC [ifont: InternalFonts] RETURNS [font: UserFonts, bold: BOOL]; <> <<>> FontIsBold: PROC [font: InternalFonts] RETURNS [bold: BOOL]; <> <<>> GetActiveFileName: PROC [model: SilModel] RETURNS [name: ROPE]; <> <<>> GetLastActiveFileName: PROC [model: SilModel] RETURNS [name: ROPE]; <> <<>> <> MarkFileAsEdited: PROC [model: SilModel] RETURNS [deletedBuildBoxes: BOOL _ FALSE]; <> END.