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, September 19, 1985 8:41:52 pm PDT
DIRECTORY
CD,
CDProperties,
CDStretchyExtras;
CDStretchyExtrasImpl: CEDAR PROGRAM
IMPORTS CDProperties
EXPORTS CDStretchyExtras =
BEGIN
MatchProc: TYPE = CDStretchyExtras.MatchProc;
--PROC [me: CD.Object, r: CD.Rect, layer: CD.Layer, prim: BOOL, horz: BOOL] RETURNS [BOOL];
Match: PUBLIC PROC[me: CD.Object, r: CD.Rect, layer: CD.Layer, prim: BOOL, horz: BOOL] RETURNS [BOOL] =
BEGIN
match: BOOLFALSE;
refP: REF = CDProperties.GetProp[me.class.properties, 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.Object] RETURNS [BOOL] =
BEGIN
RETURN [CDProperties.GetProp[me.class.properties, furtherKey]#NIL];
END;
furtherKey: ATOM = $StretchyExtras;
InstallMatch: PUBLIC PROC [type: REF CD.ObjectClass, match: MatchProc] =
BEGIN
CDProperties.PutProp[type, furtherKey, NEW[MatchProc←match]];
END;
[] ← CDProperties.RegisterProperty[furtherKey];
END.