DIRECTORY Imager USING [black, Color, MaskBox, SetColor], Rules USING [Rule], ViewerClasses USING [PaintProc, SetProc, ViewerClass, ViewerClassRec, ViewerRec], ViewerOps USING [CreateViewer, DestroyViewer, PaintViewer, RegisterViewerClass]; RulesImpl: CEDAR PROGRAM IMPORTS Imager, ViewerOps EXPORTS Rules SHARES ViewerOps = BEGIN OPEN ViewerClasses, Rules; Create: PUBLIC PROC [info: ViewerRec, color: Imager.Color _ NIL, paint: BOOL _ TRUE] RETURNS [rule: Rule] = { IF info.parent=NIL THEN RETURN; info.data _ color; info.border _ FALSE; -- we did promise uniform color RETURN[ViewerOps.CreateViewer[flavor: $Rule, info: info, paint: paint]]; }; Destroy: PUBLIC PROC [rule: Rule] = {ViewerOps.DestroyViewer[rule]}; SetColor: PUBLIC PROC [rule: Rule, color: Imager.Color, paint: BOOL _ TRUE] = { rule.class.set[rule, color, paint]; }; RulePaint: PaintProc = { WITH self.data SELECT FROM color: Imager.Color => Imager.SetColor[context, color]; ENDCASE => Imager.SetColor[context, Imager.black]; Imager.MaskBox[context, [0, 0, self.cw, self.ch]]; }; RuleSet: SetProc = { WITH data SELECT FROM color: Imager.Color => self.data _ color; ENDCASE; IF finalise THEN ViewerOps.PaintViewer[self, client --, FALSE ??? --]; }; ruleClass: ViewerClasses.ViewerClass _ NEW[ViewerClasses.ViewerClassRec _ [ paint: RulePaint, set: RuleSet ]]; ViewerOps.RegisterViewerClass[$Rule, ruleClass]; -- plug in to Viewers END. ΪRulesImpl.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Edited by McGregor on June 2, 1982 1:55 pm Last Edited by: Maxwell, January 3, 1983 12:28 pm Doug Wyatt, March 29, 1985 5:20:01 pm PST Κ– "Mesa" style˜codešœ™Kšœ Οmœ1™˜QKšœ žœA˜P—K˜KšΠbl œžœž˜Kšžœ˜Kšžœ˜ Kšžœ ˜Kšœžœžœ˜"K˜š Οnœžœžœ)žœ žœžœ˜TKšžœ˜Kšžœ žœžœžœ˜Kšœ˜KšœžœΟc˜4KšžœB˜HKšœ˜K˜—Kš œžœžœ0˜DK˜š  œžœžœ*žœžœ˜OKšœ#˜#Kšœ˜K˜—š  œ˜šžœ žœž˜Kšœ7˜7Kšžœ+˜2—Kšœ2˜2Kšœ˜K˜—š œ ˜šžœžœž˜Kšœ)˜)Kšžœ˜—Kšžœ žœ$‘œ˜FKšœ˜K˜—šœ'žœ!˜KK˜K˜ K˜K˜—Kšœ1‘˜FK˜Kšžœ˜—…—ˆ~