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, March 25, 1986 2:41:30 pm PST
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: BOOL ← FALSE;
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:
CD.ObjectClass, match: MatchProc] =
BEGIN
CDProperties.PutProp[type, furtherKey, NEW[MatchProc←match]];
END;
[] ← CDProperties.RegisterProperty[furtherKey];
END.