DIRECTORY CD, CDBasics, CDInterestRects, CDIO, CDProperties, TokenIO; CDInterestRectsImpl: CEDAR PROGRAM IMPORTS CDBasics, CDIO, CDProperties, TokenIO EXPORTS CDInterestRects = BEGIN AdjustInterest: PUBLIC PROC [ob: CD.Object] = BEGIN IF ob.class.inDirectory AND CDIO.VersionKey[]<8 THEN { WITH CDProperties.GetPropFromObject[from: ob, prop: interestRectProperty] SELECT FROM pp: REF CD.Rect => IF CDBasics.NonEmpty[pp^] THEN SetInterest[ob, pp^] ENDCASE => NULL; }; END; InternalReadProperty: PROC [prop: ATOM] RETURNS [val: REF] = BEGIN x1: INT = TokenIO.ReadInt[]; y1: INT = TokenIO.ReadInt[]; x2: INT = TokenIO.ReadInt[]; y2: INT = TokenIO.ReadInt[]; val _ NEW[CD.Rect_[x1, y1, x2, y2]] END; SetInterest: CDInterestRects.SetInterestProc = BEGIN WITH CDProperties.GetProp[ob.class.properties, $SetInterestProc] SELECT FROM class: REF CDInterestRects.SetInterestProc => class^[ob, r]; ENDCASE => NULL; END; InstallOldSetInterest: PUBLIC PROC [type: REF CD.ObjectClass, proc: CDInterestRects.SetInterestProc] = BEGIN CDProperties.PutProp[onto: type, prop: $SetInterestProc, val: NEW[CDInterestRects.SetInterestProc_proc]]; END; InternalReadOrigin: PROC [prop: ATOM] RETURNS [val: REF] = BEGIN x: INT = TokenIO.ReadInt[]; y: INT = TokenIO.ReadInt[]; val _ NIL END; originProperty: ATOM = $origin; interestRectProperty: ATOM = $interestRect; [] _ CDProperties.RegisterProperty[interestRectProperty]; CDProperties.InstallProcs[prop: interestRectProperty, new: CDProperties.PropertyProcsRec[ makeCopy: CDProperties.DontCopy, internalRead: InternalReadProperty, exclusive: TRUE ] ]; [] _ CDProperties.RegisterProperty[originProperty]; CDProperties.InstallProcs[prop: originProperty, new: CDProperties.PropertyProcsRec[ makeCopy: CDProperties.DontCopy, internalRead: InternalReadOrigin, exclusive: TRUE ] ]; [] _ CDProperties.RegisterProperty[$SetInterestProc]; END. 8CDInterestRectsImpl.mesa Copyright c 1984, 1985 by Xerox Corporation. All rights reserved. Created by: Jacobi, September 13, 1984 3:21:36 pm PDT Last Edited: Jacobi, September 19, 1985 0:42:50 am PDT -- InterestRect: A special rectangle associated to an object. -- It defaults to the objects innerrect. Êû˜šœ™Jšœ Ïmœ7™BJ™5J™6—J˜šÏk œ˜ Jšžœ˜Jšœ ˜ Jšœ˜Jšœ˜Jšœ ˜ Jšœ ˜ J˜—šÏbœžœžœ˜#Jšžœ&˜-Jšžœ˜—Jšž˜J˜Jšœ=™=J™(J˜šÏnœžœžœžœ ˜-Jšž˜šžœžœžœžœ˜6šžœFžœž˜Ušœžœžœ ˜Jšžœžœ˜3—Jšžœžœ˜—J˜—Jšžœ˜—š  œžœžœžœžœ˜žœ(˜iJšžœ˜—J˜š  œžœžœžœžœ˜:Jšž˜Jšœžœ˜Jšœžœ˜Jšœž˜ Jšžœ˜—J˜Jšœžœ ˜Jšœžœ˜+Jšœ9˜9šœ6˜6šœ#˜#Jšœ ˜ Jšœ#˜#Jšœ ž˜Jšœ˜—Jšœ˜—Jšœ3˜3šœ0˜0šœ#˜#Jšœ!˜!Jšœ!˜!Jšœ ž˜Jšœ˜—Jšœ˜—Jšœ5˜5Jšžœ˜J˜J˜—…—^ ‘