CDStretchyExtrasImpl.mesa (part of ChipNDale)
Copyright © 1984 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, October 22, 1984 10:04:35 am PDT
last edited by Christian Jacobi, March 25, 1986 2:41:30 pm PST
Last edited by: Christian Jacobi, October 14, 1986 5:58:28 pm PDT
DIRECTORY
CD,
CDProperties,
CDStretchyExtras;
CDStretchyExtrasImpl:
CEDAR
PROGRAM
IMPORTS CDProperties
EXPORTS CDStretchyExtras =
BEGIN
MatchProc: TYPE = CDStretchyExtras.MatchProc;
Match:
PUBLIC
PROC[me:
CD.Object, r:
CD.Rect, layer:
CD.Layer, prim:
BOOL, horz:
BOOL]
RETURNS [
BOOL ←
FALSE] = {
WITH CDProperties.GetProp[me.class.properties, furtherKey]
SELECT
FROM
mp: REF MatchProc => RETURN [ mp^[me, r, layer, prim, horz] ];
ENDCASE => NULL;
};
HasMatchProc:
PUBLIC
PROC [me:
CD.Object]
RETURNS [
BOOL] = {
RETURN [CDProperties.GetProp[me.class.properties, furtherKey]#NIL];
};
furtherKey: ATOM = $StretchyExtras;
InstallMatch:
PUBLIC
PROC [type:
CD.ObjectClass, match: MatchProc] = {
CDProperties.PutProp[type, furtherKey, NEW[MatchProc←match]];
};
[] ← CDProperties.RegisterProperty[furtherKey];
END.