-- TiogaOpsImpl.mesa, Edited by Paxton on October 28, 1982 11:47 am
DIRECTORY
Rope USING [ROPE],
TiogaDocument USING [Selection],
TiogaSelection USING [pSel, sSel],
TiogaScrolling USING [AutoScroll],
UndoEvent,
ViewerClasses USING [Viewer],
TiogaOps;
TiogaOpsImpl: CEDAR PROGRAM
IMPORTS TiogaSelection, TiogaScrolling
EXPORTS TiogaOps =
BEGIN OPEN TiogaOps, TiogaSelection, ViewerClasses;
------ Selections and their contents ------
GetSelContents: PUBLIC PROC RETURNS [contents: Rope.ROPE] =
{RETURN[IF pSel.viewer=NIL THEN NIL
ELSE NARROW[pSel.viewer.class.get[pSel.viewer, $SelChars]]]} ;
GetSelData: PUBLIC PROC [primary: BOOLEANTRUE]
RETURNS [data: TiogaDocument.Selection] =
{RETURN [IF primary THEN pSel ELSE sSel]} ;
------ display ------
AutoScroll: PUBLIC PROC [tryToGlitch: BOOLEANTRUE] = {
TiogaScrolling.AutoScroll[tryToGlitch: tryToGlitch] }; -- scroll to selection
------ Viewers and contents ------
GetTextContents: PUBLIC PROC [viewer: Viewer] RETURNS [contents: Rope.ROPE] =
{RETURN[NARROW[viewer.class.get[viewer]]]} ;
SetTextContents: PUBLIC PROC [viewer: Viewer, contents: Rope.ROPE] =
{viewer.class.set[viewer, contents]} ;
END.