DIRECTORY Xl, XTk; XTkBlinker: CEDAR DEFINITIONS ~ BEGIN BlinkerClass: TYPE = REF BlinkerClassRep; BlinkerClassRep: TYPE = RECORD [ createProc: CreateOverlayProc, installProc: InstallProc ¬ NIL, classData: REF ¬ NIL, onTime: CARD, --units are considered private offTime: CARD ]; CreateOverlayProc: TYPE = PROC [blinkerClass: BlinkerClass, parent: XTk.Widget, attributes: Xl.Attributes, pos: Xl.Point] RETURNS [w: Xl.Window, geometry: Xl.Geometry, ref: REF READONLY ANY ¬ NIL]; InstallProc: TYPE = PROC [w: XTk.Widget, key: REF, blinkerClass: BlinkerClass]; NewBlinkerClass: PROC [createProc: CreateOverlayProc, installProc: InstallProc ¬ NIL, classData: REF ¬ NIL, onMsec: NAT ¬ 400, offMsec: NAT ¬ 400] RETURNS [BlinkerClass]; InstallBlinker: PROC [w: XTk.Widget, key: REF, blinkerClass: BlinkerClass, persistent: BOOL ¬ FALSE]; BlinkerSetPos: PROC [w: XTk.Widget, key: REF, pos: Xl.Point]; BlinkerOn: PROC [w: XTk.Widget, key: REF, count: CARD ¬ LAST[CARD]]; BlinkerOff: PROC [w: XTk.Widget, key: REF]; ChangeBlinkerSpeed: PROC [w: XTk.Widget, key: REF, onMsec: NAT ¬ 400, offMsec: NAT ¬ 400]; END. tXTkBlinker.mesa Copyright Σ 1992 by Xerox Corporation. All rights reserved. Christian Jacobi, April 24, 1992 6:12 pm PDT Christian Jacobi, April 25, 1992 11:40 am PDT A means to implement blinking features, e.g. for implementing carets. This package allows to implement blinking features by creating a window and periodically mapping and unmapping the window. While blinking speed is specified in milliseconds, it is rounded to very coarse units. Changes (including on/off) may appear immediately, or, may be delayed until next blinking phase. Request to BlinkerClass to create an (overlay) window for a particular widget at position pos. Called when the window is needed (e.g. at bind-sceen time, or, when blinker is turned on) attributes is a proposal for how to set window attributes pos is client requested position of logical hot-spot. (The created window should have the position pos+geometry.pos) Must return: w: window which will be periodically mapped and unmapped geometry: geometry to be used in case of pos=[0, 0] ref: For the benefit of clients, package will hold on to ref for as long as w is used Notification to class that a blinker has been installed for a particular widget Widget need not yet be screen-bound Represents application supporting a blinking overlay on widgets A widget may have multiple blinkers. Enables blinker behaviour for a particular widget Note: "key" is used as property key on w to denote this blinker Initial position is [0, 0] and initial state is "Off" Persistent means that the widgets remembers when blinking is turned on even over widget migration Sets position for blinker. Noop if no blinker is installed. Turns blinker on (makes it blinking). Noop if no blinker is installed. Turns blinker off (makes it invisible). Noop if no blinker is installed. Eventually changes speed of the blinking. Times are very roughly rounded. Κ&–(cedarcode) style•NewlineDelimiter ˜code™Kšœ Οeœ1™