DIRECTORY Imager USING [Context], Rope USING [ROPE]; Icons: CEDAR DEFINITIONS = BEGIN iconW: INTEGER = 64; iconH: INTEGER = 64; IconFlavor: TYPE = MACHINE DEPENDENT { -- pre-defined icons document(0), dirtyDocument(1), fileCabinet(2), tool(3), typescript(4), private(177776B), -- will cause call of viewer paintProc to paint icon unInit(177777B) -- flag for unitialised icon type }; IconRef: TYPE = REF IconRep; IconRep: TYPE = MACHINE DEPENDENT RECORD [ bits: ARRAY [0..iconH*iconW/16) OF UNSPECIFIED, -- bit pattern; (required to be first field!) label: BOOL _ FALSE, -- if true, label icon with viewer name invertLabel: BOOL _ FALSE, -- if true, label drawn with white bits filler: [0..16384) _ 0, -- unused lx, ly, lw, lh: INTEGER _ 0, -- rectangle for label (from bottom left) proc: DrawIconProc _ NIL -- proc to draw pattern ]; DrawIconProc: TYPE = PROC [flavor: IconFlavor, context: Imager.Context, x, y: INTEGER _ 0, label: Rope.ROPE _ NIL] ; DrawIcon: DrawIconProc ; NewIcon: PROC [info: IconRef] RETURNS [newFlavor: IconFlavor] ; NewIconFromFile: PROC [file: Rope.ROPE, n: CARDINAL] RETURNS [newFlavor: IconFlavor]; IconFileFormat: TYPE = MACHINE DEPENDENT RECORD [ bits: ARRAY [0..iconH*iconW/16) OF UNSPECIFIED _ ALL[0], label: BOOL _ FALSE, invertLabel: BOOL _ FALSE, filler: [0..16384) _ 0, -- leftovers lx, ly, lw, lh: INTEGER _ 0, empty: ARRAY [0..251) OF UNSPECIFIED _ ALL[0] -- leftovers ]; END. ŽIcons.mesa; Written by S. McGregor Edited by McGregor on August 4, 1983 1:11 pm Last Edited by: Maxwell, December 17, 1982 9:57 am Draw an icon in a context Create a new icon type Create a new icon type from the n'th icon read from the file Icon File Format (for wizards/hackers). Icons must be packed into the file at two pages per icon, corresponding to a logical record type as follows: Κv– "cedar" style˜JšΟc"™"Jš,™,Jšœ2™2J™šΟk ˜ Jšœžœ ˜Jšœžœžœ˜J˜—Jšœžœž˜ J˜Jšœžœ˜Jšœžœ˜J˜šœ žœžœž œ˜;J˜ J˜J˜J˜J˜Jšœ4˜FJšœ!˜2J˜J˜—Jšœ žœžœ ˜š œ žœžœž œžœ˜*Jšœžœžœž œ-˜]Jšœžœžœ '˜DJšœ žœžœ'˜HJšœ  ˜)Jšœžœ )˜LJšœžœ˜7J˜J˜—šΟn œžœžœ5žœ˜ZJšœ žœžœ˜J˜—˜Jš™J˜—šŸœžœžœ˜?Jš™J˜—š Ÿœžœ žœžœžœ˜UJš<™