CDStretchyExtrasImpl.mesa (part of Chipndale)
Copyright © 1984 by Xerox Corporation. All rights reserved.
by Christian Jacobi October 22, 1984 10:04:35 am PDT
last edited by Christian Jacobi October 22, 1984 10:04:38 am PDT
DIRECTORY
CD,
CDObjectProcs,
CDStretchyExtras;
CDStretchyExtrasImpl: CEDAR PROGRAM
IMPORTS CDObjectProcs
EXPORTS CDStretchyExtras =
BEGIN
MatchProc: TYPE = CDStretchyExtras.MatchProc;
--PROC [me: CD.ObPtr, r: CD.DesignRect, layer: CD.Layer, prim: BOOL, horz: BOOL] RETURNS [BOOL];
Match: PUBLIC PROC[me: CD.ObPtr, r: CD.DesignRect, layer: CD.Layer, prim: BOOL, horz: BOOL] RETURNS [BOOL] =
BEGIN
match: BOOLFALSE;
refP: REF = CDObjectProcs.FetchFurther[me.p, furtherKey];
IF refP#NIL THEN
WITH refP SELECT FROM
mp: REF MatchProc => match ← mp^[me, r, layer, prim, horz];
ENDCASE => NULL;
RETURN [match]
END;
HasMatchProc: PUBLIC PROC [me: CD.ObPtr] RETURNS [BOOL] =
BEGIN
RETURN [CDObjectProcs.FetchFurther[me.p, furtherKey]#NIL];
END;
furtherKey: ATOM = $StretchyExtras;
InstallMatch: PUBLIC PROC [type: REF CD.ObjectProcs, match: MatchProc] =
BEGIN
CDObjectProcs.StoreFurther[type, furtherKey, NEW[MatchProc←match]];
END;
CDObjectProcs.RegisterFurther[furtherKey];
END.