XTkTIPSource.mesa
Copyright Ó 1988, 1989, 1991, 1992 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, November 29, 1988 2:51:48 pm PST
Christian Jacobi, February 25, 1992 5:05 pm PST
Willie-s, October 1, 1991 12:55 pm PDT
DIRECTORY
KeyMappingTypes USING [Mapping],
Xl USING [Event, Point, TimeStamp, TQ],
XTk USING [Widget],
UserInput USING [Handle];
XTkTIPSource: CEDAR DEFINITIONS ~ BEGIN
TipSourceHandle: TYPE = REF TipSourceHandleRep;
TipSourceHandleRep: TYPE;
BindTipSource: PROC [widget: XTk.Widget, uioHandle: UserInput.Handle ¬ NIL, inputTQ: Xl.TQ ¬ NIL, yup: BOOL ¬ FALSE, pseudoHeight: INT ¬ -1, scrollPos: Xl.Point ¬ [0, 0], surfaceUnitsPerPixel: NAT ¬ 1, setAbsoluteTime: BOOL ¬ TRUE] RETURNS [handle: TipSourceHandle];
Set up widget to listen to events
Error if called more then once
yup: y coordinate grows up
scrollPos: Poisition in window for origin of mouse positions
pseudoHeight: If the y coordinates grow upwards we need to know the height of the real thing instead of the widget height
setAbsoluteTime: Sets the absolute time before allowing input events.
GetTipSourceHandle: PROC [widget: XTk.Widget] RETURNS [handle: TipSourceHandle];
Returns TipSourceHandle if available; NIL if BindTipSource was not called
ReplaceUIOHandle: PROC [handle: TipSourceHandle, uioHandle: UserInput.Handle, setAbsoluteTime: BOOL ¬ TRUE];
setAbsoluteTime: Sets the absolute time before allowing any input events.
AdditionalKeySource: PROC [handle: TipSourceHandle, w: XTk.Widget];
Adds events handler onto w to make keyboard events appear on handle.
This is specially useful because some window manager confuse input focus conventions and leaves the focus on the root.
ChangeSurfaceUnitsPerPixel: PROC [handle: TipSourceHandle, surfaceUnitsPerPixel: NAT ¬ 1];
ChangePseudoHeight: PROC [handle: TipSourceHandle, pseudoHeight: INT ¬ -1];
ChangeScrollPos: PROC [handle: TipSourceHandle, scrollPos: Xl.Point ¬ [0, 0]];
GetServerTime: PROC [handle: TipSourceHandle] RETURNS [timeStamp: Xl.TimeStamp];
Returns server generated TimeStamp from event producing front of UserInput.Handle
Successfull most of the time
Returns Xl.currentTime if tip-sink is so slow that the actual server time falls out of buffer
Undefined after ReplaceUIOHandle until actual input in UserInput.Handle happens
CurrentMapping: PROC [handle: TipSourceHandle] RETURNS [mapping: KeyMappingTypes.Mapping];
Returns current mapping; NIL if widget not realized.
AllUp: PROC [widget: XTk.Widget, event: Xl.Event ¬ NIL];
Asserts that all keys are up; useful to un-confuse.
END.