XTkTIP.mesa
Copyright Ó 1988, 1989, 1990, 1991, 1992 by Xerox Corporation. All rights reserved.
Christian Jacobi, November 29, 1988 2:51:48 pm PST
Christian Jacobi, February 24, 1992 12:27 pm PST
DIRECTORY
ScreenCoordsTypes USING [TIPScreenCoords, TIPScreenCoordsRec],
TIPTypes USING [TIPTable],
Xl USING [EventProcType, TQ, Point],
XTk USING [Widget],
Rope USING [ROPE];
XTkTIP: CEDAR DEFINITIONS ~ BEGIN
Encapsulated tip stuff
Encapsulation of portable tip table implementation so it can exports standard functionality hidden with a different name. This enables hiding the conflicting names in a private config... (necessary for DCedar development).
TIPTable: TYPE ~ TIPTypes.TIPTable;
TIPScreenCoords: TYPE ~ ScreenCoordsTypes.TIPScreenCoords;
TIPScreenCoordsRec: TYPE ~ ScreenCoordsTypes.TIPScreenCoordsRec;
InstantiateNewTIPTable: PROC [file: Rope.ROPE] RETURNS [table: TIPTable];
TIP tables are user-editable and normally live in the FS file system. Clients may instantiate new tables with this routine. An error in reading in a new table can produce the continuable InvalidTable signal.
InvalidTable: READONLY SIGNAL [errorMsg: Rope.ROPE];
TIPPredicate: TYPE ~ PROC RETURNS [BOOL];
RegisterTIPPredicate: PROC [key: ATOM, p: TIPPredicate];
A user-defined predicate may be included in the enables list of a TIPTable via this association mechanism.
Binding TIP and X11
Bind: PROC [widget: XTk.Widget, tipTable: TIPTable ¬ NIL, eventProc: Xl.EventProcType ¬ NIL, eventData: REF ¬ NIL, inputTQ: Xl.TQ ¬ NIL, tipTQ: Xl.TQ ¬ NIL, dispatch: BOOL ¬ FALSE, yup: BOOL ¬ FALSE, pseudoHeight: INT ¬ -1, scrollPos: Xl.Point ¬ [0, 0]];
Setup widget to respond to tip table actions.
Must not be called more then once per widget.
inputTQ: ThreadQueue used for getting X server events; NIL means make a new thread.
eventProc: proc to be called with tip events; none if NIL.
eventData: data handed to eventProc.
tipTQ: NIL means call eventProc on internal process; a ThreadQueue means enqueue eventProc.
dispatch: tip events should be dispatched to all match'es of widget. (Otherwise eventProc is the only procedure called to report tip events).
yup: Direction of y axis. There is somedispute whether this is an acronym or not.
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.
AdditionalKeySource: PROC [widget: XTk.Widget, from: XTk.Widget];
Adds events handler onto from to make keyboard events appear on widget.
This is specially useful because some window manager confuse input focus conventions and leaves the focus on the root.
ChangeTipTable: PROC [widget: XTk.Widget, tipTable: TIPTable];
called anytime
ChangePseudoHeight: PROC [widget: XTk.Widget, pseudoHeight: INT ¬ -1];
called anytime
ChangeScrollPos: PROC [widget: XTk.Widget, scrollPos: Xl.Point ¬ [0, 0]];
called anytime
END.