Highlight.mesa
A standard interface for ephemeral feedback. There is no default implementation.
Maureen Stone October 30, 1984 6:59:34 pm PST
DIRECTORY
Cubic USING [Bezier],
Vector USING [Vec],
Imager USING [Context],
Rope USING [ROPE];
Highlight: CEDAR DEFINITIONS = {
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: Vector.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.ROPENIL,
lastBezier: Cubic.Bezier ← [[-1,-1],[-1,-1],[-1,-1],[-1,-1]],
lastPt: Vector.Vec ← [0,0],
clientData: REF
];
ShowPt: PROC[ctx: Context, pt: Vector.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.
}.