Highlight.mesa
Copyright Ó 1985, 1992 by Xerox Corporation. All rights reserved.
Maureen Stone October 30, 1984 6:59:34 pm PST
Doug Wyatt, September 5, 1985 1:05:35 pm PDT
A standard interface for ephemeral feedback. There is no default implementation.
DIRECTORY
Cubic USING [Bezier],
Vector2 USING [VEC],
Imager USING [Context],
Rope USING [ROPE];
Highlight:
CEDAR
DEFINITIONS =
BEGIN
VEC: TYPE ~ Vector2.VEC;
A Highlight is an object used to display ephemeral feedback. Implement this interface in the context of your application.
Context: TYPE = REF Object;
Object: TYPE = RECORD[data: REF Data, procs: REF Procs];
Procs:
TYPE =
RECORD[
showPt: PROC[ctx: Context, pt: VEC], -- inverts a small area around the given point
showBezier: PROC[ctx: Context, bezier: Cubic.Bezier],
showRope: PROC[ctx: Context, rope: Rope.ROPE],
cleanUp: PROC[ctx: Context]
];
Data:
TYPE =
RECORD[
imager: Imager.Context ¬ NIL,
lastRope: Rope.ROPE ¬ NIL,
lastBezier: Cubic.Bezier ¬ [[-1,-1],[-1,-1],[-1,-1],[-1,-1]],
lastPt: VEC ¬ [0,0],
clientData: REF
];
ShowPt:
PROC[ctx: Context, pt:
VEC] =
INLINE {ctx.procs.showPt[ctx,pt]};
inverts a small area around the given point, to give some feedback about what in going on.
ShowBezier:
PROC[ctx: Context, bezier: Cubic.Bezier] =
INLINE {ctx.procs.showBezier[ctx, bezier]};
highlights a bezier cubic
ShowRope:
PROC[ctx: Context, rope: Rope.
ROPE]=
INLINE {ctx.procs.showRope[ctx,rope]};
displays a rope
CleanUp:
PROC[ctx: Context] =
INLINE {ctx.procs.cleanUp[ctx]};
clear the feedback.
END.