(* Copyright (C) 1992 Digital Equipment Corporation *) (* All rights reserved. *) (* See the file COPYRIGHT for a full description. *) (* *) (* Last modified on Sat Jan 2 23:13:55 PST 1993 by meehan *) <* PRAGMA LL *> INTERFACE MacModel; IMPORT TextPortClass; TYPE T <: TextPortClass.Model; END MacModel. (* The Mac model is taken from Apple's {\it Human Interface Guidelines} \cite[pages 106-114]{AppleUI}. It supports a single, primary selection that corresponds to "VBT.Source". The first unmodified downclick establishes the {\it anchor point}. If the user then drags the mouse, the upclick establishes the {\it active end}; the range between the anchor point and the active end is called the selection, and it is highlighted. If the user releases the mouse without dragging, that establishes the {\it insertion point}, and there is no selection or highlighting. Shift-downclick extends (or reduces) the selection and establishes the new active end. Double-clicking selects a word; dragging after a double-click extends the selection in word-size increments. The Apple guidelines state: \begin{quote} When a Shift-arrow key combination is pressed, the active end of the selection moves and the range over which it moves becomes selected. \ldots Option-Shift-Left Arrow selects the whole word that contains the character to the left of the insertion point (just like double-clicking on a word.) In a text application, pressing Shift and either Left Arrow or Right Arrow selects a single character. Assuming that the Left Arrow key was used, the anchor point of the selection is on the right side of the selection, the active end on the left. Each subsequent Shift-Left Arrow adds another character to the left side of the selection. A Shift-Right Arrow at this point shrinks the selection. Pressing Option-Shift and either Left Arrow or Right Arrow \ldots selects the entire word containing the character to the left of the insertion point. Assuming Left Arrow was pressed, the anchor point is at the right end of the word, the active end at the left. Each subsequent Option-Shift-Left Arrow adds another word to the left end of the selection\ldots When a block of text is selected, either with a pointing device or with cursor keys, pressing either Left Arrow or Right Arrow deselects the range. If Left Arrow is pressed, the insertion point goes to the beginning of what had been the selection. If Right Arrow is pressed, the insertion point goes to the end of what had been the selection. [From page 83] When the user chooses Cut, \ldots the place where the selection used to be becomes the new selection. \ldots In text, the new selection is an insertion point [and the highlighting is removed]. Paste \ldots inserts the contents of the Clipboard [VBT.Source] into the document, replacing the current selection [i.e., selections are always replace-mode]. If there is no current selection, it's inserted at the insertion point\ldots. After a Paste, the new selection is \ldots an insertion point immediately after the pasted text. [In either case, there is no highlighting.] \end{quote} If there is a selection, then Copy (and therefore Cut) call | SELF.takeSelection(TextPort.SelectionType.Primary, ...) to acquire "VBT.Source", and the selection is copied to a local buffer (``clipboard''). No other procedure in this interface acquires "VBT.Source". MacModel selections are always in replace-mode. The Mac model supports only a few keybindings. "meta" refers to the "option" modifier. \begin{center} \begin{tabbing} option-LongKeyName \= This is just a tab-setting line. \kill control-c, meta-c \> {\bf Copy} \\ control-v, meta-v \> {\bf Paste} \\ control-x, meta-x \> {\bf Cut} \\ control-z \> {\bf Undo} \\ control-shift-z \> {\bf Redo} \end{tabbing} \end{center} *)