DIRECTORY BiScrollers USING [BiScroller], Rope USING [ROPE], SilKernel USING [SilData, SilUIData], TIPUser USING [TIPTable], ViewerClasses USING [ModifyProc, NotifyProc, Viewer] ; SilUserInput: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; SilData: TYPE = SilKernel.SilData; SilUIData: TYPE = SilKernel.SilUIData; CaretSet: TYPE = {mark, origin}; Relation: TYPE = {absolute, relative}; SelectMode: TYPE = {add, change, remove, relative, reduce, delete}; ObjectAttributes: TYPE = {color, font, face}; Face: TYPE = {italic, nonItalic, bold, nonBold}; OperationMode: TYPE = {copy, moveStretch, moveNoStretch, delete}; Details: TYPE = {boxWidth, gridSize}; MacroMode: TYPE = {expand, check, define, clear}; CompMode: TYPE = {tics, magnification, oneLevel, yInc, frames}; InputCharMode: TYPE = {NotInputingRope, InputingRope, waitingFor1CharArg, waitingForConfirmation}; UIType: TYPE = {CenterOnMark, ChangeSelected, Compliment, Destroy, DrawBox, DrawRope, EraseArea, HardCopy, InputFile, KillPicture, ManipulateMacro, MarkAsEdited, MergeArea, OperateOnSelected, SelectForAttrib, SelectWithPos, SetCaret, SetCursor, SetDefaultAttribs, SetDetails, ShowMacros, StoreFile, SwapFonts, TrackMouse, Undelete, UserChar}; UInput: TYPE = LIST OF UInputRec; UInputRec: TYPE = RECORD [ SELECT in: UIType FROM CenterOnMark => [], ChangeSelected => [char: CHAR _ 'a], Compliment => [mode: CompMode], DrawBox => [markRel: Relation _ relative, originRel: Relation _ relative, x: INTEGER _ 0, y: INTEGER _ 0, background: BOOL _ FALSE], DrawRope => [rope: ROPE, rel: Relation _ absolute], EraseArea => [xMin, yMin, xMax, yMax: INTEGER], HardCopy => [char: CHAR _ 'a], InputFile => [mode: Relation _ absolute], KillPicture => [], ManipulateMacro => [mode: MacroMode, char: CHAR _ 'a], MarkAsEdited => [], MergeArea => [xMin, yMin, xMax, yMax: INTEGER], OperateOnSelected => [op: OperationMode, rel: Relation _ relative, x: INTEGER _ 0, y: INTEGER _ 0], SelectForAttrib => [mode: SelectMode, char: CHAR _ 'a], SelectWithPos => [x: INTEGER, y: INTEGER, mode: SelectMode _ change], SetCaret => [caret: CaretSet, x: INTEGER _ 0, y: INTEGER _ 0, mode: Relation], SetCursor => [caret: CaretSet _ mark], SetDefaultAttribs => [char: CHAR _ 'a], SetDetails => [detail: Details, char: CHAR _ 'a], ShowMacros => [char: CHAR _ 'a], StoreFile => [clip: BOOL _ TRUE, large: BOOL _ FALSE], SwapFonts => [], TrackMouse => [x: INTEGER, y: INTEGER], Undelete => [], UserChar => [c: CHAR _ 'a] ENDCASE ]; defaultGridSpacing: NAT = 4; InitTipTable: PROC [tipTable: TIPUser.TIPTable]; InitUserInput: PROC [data: SilData, viewer: ViewerClasses.Viewer]; DestroyUserInput: PROC [uiData: SilUIData]; SilNotify: ViewerClasses.NotifyProc; SilModifyInputFocus: ViewerClasses.ModifyProc; GetInputFocus: PROC[uiData: SilUIData]; HasInputFocus: PROC[] RETURNS [hasIt: BOOL]; Enque: PROC [UI: UInputRec, uiData: SilUIData]; Deque: PROC [uiData: SilUIData] RETURNS [UI: UInputRec]; InputAvailable: PROC [uiData: SilUIData] RETURNS [yes: BOOL]; AwaitUserInput: PROC [uiData: SilUIData]; SetCaretChange: PROC [uiData: SilUIData]; CaretHasChanged: PROC [uiData: SilUIData]; ShouldChangeCaret: PROC [uiData: SilUIData] RETURNS [changeIt: BOOL]; ChangeGridInterval: PROC [uiData: SilUIData, gridSpacing: NAT]; MagnifyGrid: PROC [uiData: SilUIData, xOffset, yOffset: REAL, magnification: NAT]; NotInputingRope: PROC [uiData: SilUIData]; InputingRope: PROC [uiData: SilUIData]; GetBiScroller: PROC [uiData: SilUIData] RETURNS [bs: BiScrollers.BiScroller]; END. ξSilUserInput.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Tracy Larrabee, March 29, 1984 11:29:40 am PST Last Edited by: Pier, August 15, 1985 4:51:16 pm PDT This module defines types and external procedures needed for User Input retreival and inventory: things that handle input from Viewers (including placement of the input focus), deal with TIPTables, query and append to the Sil UserAction queue, and grid the cursor. The way that user input works: Actions by the user will cause one or more User Input Records (UInputRec - defined below) to be placed on the User Input Queue (UInput - defined below). The display module (actually the PaintProc) will take the records off, whenever it has an opportunity to do so, and process them. Following, we have types that are needed to produce a user input record which may be placed on the user input queue and will contain all information needed to process any particular user input. Grid spacing is handled by the input module. Set the tip table so it can be referenced later on. This routine had better be called before any Sil windows are created. Initialize all the state needed to process user input. This routine must be called once for every Sil window. Perform necessary actions for the destruction of this user input. A cleanup procedure analogous to Init User Input. [self: Viewer, input: LIST OF REF ANY] The notify proc which the viewers package will call. This process will be placing user input records on the user input queue. While using SilNotify we will need to acquire the input focus (we will not receive control characters if we don't have the input focus - we will only receive mouse clicks). These three routines will handle input focus management. [self: Viewer, change: ModifyAction] Call me when the user input focus changes. Make sure that we have the input Focus. Do we have the input Focus? Enque the user input so that it can be processed sequentially with all the other user inputs. Does a notify on gotInput. Deque a user input so that it can be processed. Returns NIL if there was no input. True if there is user input available, else false. Wait until somebody typed (or moused) something. The fact that a caret needs to be updated in the Sil window associated with this user input module is an event which is very similar to a user input event - so, it is handled here. Set the information which will tell the display process to blink the caret. Make uiData reflect the fact that the caret has been blinked. True if the caret should be blinked. The gridding of the cursor is handled here, and the display module must be able to tell this module that it should change its grid interval, or that the display has gone into magnify mode. (For more info on magnify mode, see the users explanation of Sil or the display implementation module.) Change the cursor grid spacing. Make the cursor gridding reflect the current magnification. xOffset and yOffset fit in the equation: Client coords = Sil Coords * (mag, -mag) + offset. There are certain characters which are treated differently if a string is being input than at other times (like control-w - means back up a word in string input, and set the line width otherwise), so the input module must know whether or not it is accepting a string in order to enque the right input records. Tell the userinput module that Sil is no longer in Rope Editing Mode. Tell the userinput module that Sil is now in Rope Editing Mode. Return the BiScroller associated with this particular Sil model Κ₯˜™Icodešœ Οmœ1™<—J™.J™4J™J™‰J™J™»J™šΟk ˜ Jšœ žœ˜Jšœžœžœ˜Jšœ žœ˜%Jšœžœ˜Jšœžœ"˜5Jšœ˜—J˜šΟn œžœž œžœ˜(J˜Jšžœžœžœ˜Jšœ žœ˜"šœ žœ˜&J™—J™ΑJšœ žœ˜ Jšœ žœ˜&Jšœ žœ3˜CJšœžœ˜-Jšœžœ&˜0Jšœžœ.˜AJšœ žœ˜%Jšœ žœ"˜1Jšœ žœ1˜?šœžœO˜bJ˜—šœžœΚ˜ΦJ˜—Jšœžœžœžœ ˜!šœ žœžœ˜šžœ ž˜Jšœ˜Jšœžœ˜%Jšœ!˜!Jš œWžœ žœžœžœ˜Jšœžœ˜5Jšœ(žœ˜1Jšœžœ˜ Jšœ,˜,Jšœ˜Jšœ+žœ˜6Jšœ˜Jšœ(žœ˜1JšœFžœžœ˜jJšœ-žœ˜8Jšœžœžœ˜FJšœ$žœ žœ˜QJšœ)˜)Jšœžœ˜'Jšœ)žœ˜4Jšœžœ˜"Jš œžœžœ žœžœ˜9Jšœ˜Jšœžœžœ˜)Jšœ˜Jšœžœ˜Jšž˜Jšœ˜——˜J™,—Jšœžœ˜J˜šŸ œžœ˜0J™yJ˜—šŸ œžœ/˜BJ™nJ™—šŸœžœ˜+J™tJ™—šŸ œ˜$JšΟi₯™₯J™J™ζJ˜—šŸœ˜.Jšœ%™%J™*J˜—šŸ œžœ˜'J™'J™—šŸ œžœžœ žœ˜,J™J™—šŸœžœ$˜/J™]J™J™—šŸœžœžœ˜8J™RJ™—šŸœžœžœžœ˜=J™2J™—šŸœžœ˜)J™0J™J™΄J˜—šŸœžœ˜)J™KJ™—šŸœžœ˜*J™=J˜—šŸœžœžœ žœ˜E™$J™—J™₯J˜—šŸœžœ"žœ˜?J™J˜—šŸ œžœ'žœžœ˜RJ™˜J™J™΅J˜—šŸœžœ˜*J™EJ˜—šŸ œžœ˜'J™?J˜—šŸ œžœžœ˜MJ™?J™——Jšžœ˜—…— •