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, May 29, 1985 10:28:00 am PDT
CDStretchyExtrasImpl:
CEDAR
PROGRAM
IMPORTS CDObjectProcs
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 = CDObjectProcs.FetchFurther[me.class, 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 [CDObjectProcs.FetchFurther[me.class, furtherKey]#NIL];
END;
furtherKey: ATOM = $StretchyExtras;
InstallMatch:
PUBLIC
PROC [type:
REF
CD.ObjectClass, match: MatchProc] =
BEGIN
CDObjectProcs.StoreFurther[type, furtherKey, NEW[MatchProc←match]];
END;
CDObjectProcs.RegisterFurther[furtherKey];
END.