XTkGestureInput.mesa
Copyright Ó 1992, 1993 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, October 28, 1992 2:43:24 pm PST
Christian Jacobi, September 17, 1993 10:27 am PDT
A simple mechanism to input strokes which might serve as input for gestures.
This package pins stroke input capability onto otherwise arbitrary widgets.
DIRECTORY
Xl USING [Event, GContext, Point, ScreenDepth, TQ],
XTk USING [Widget];
XTkGestureInput: CEDAR DEFINITIONS ~ BEGIN
Regular client interface
GestureReportProc: TYPE = PROC [w: XTk.Widget, stroke: LIST OF Xl.Point, e: Xl.Event, d1, d2: REF];
Procedure type used to report a collected stroke.
d1, d2: client data. Two fields because this helps our favorite client.
SetReport: PROC [w: XTk.Widget, report: GestureReportProc, d1, d2: REF ¬ NIL, tq: Xl.TQ ¬ NIL];
Registers a report procedure which is called when a stroke is finished
report: procedure called.
d1, d2: passed through.
tq: used if specified. For NIL, a reasonable value is made up, or, reused.
SetPainting: PROC [w: XTk.Widget, addFlush: BOOL ¬ TRUE, gc: Xl.GContext ¬ NIL];
Enables painting of the stroke input.
addFlush: Flushes immediately after painting of partial strokes to reduce latency.
gc: Use this to draw segments. If NIL is used, a resonable gc is made up.
Engine Room procedures
TrustedSharedGC: PROC [screenDepth: Xl.ScreenDepth] RETURNS [Xl.GContext];
Returns the gc which would be used if NIL were specified in SetPainting.
Caller must promise to never modify it.
END.