TEditOpsImpl.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Edited by Paxton on October 28, 1982 11:47 am
Doug Wyatt, September 2, 1986 5:09:14 pm PDT
DIRECTORY
Rope USING [ROPE],
TEditDocument USING [Selection],
TEditSelection USING [pSel, sSel],
TEditScrolling USING [AutoScroll],
ViewerClasses USING [Viewer],
TEditOps USING [];
TEditOpsImpl: CEDAR PROGRAM
IMPORTS TEditSelection, TEditScrolling
EXPORTS TEditOps
= BEGIN OPEN TEditOps, TEditSelection, ViewerClasses;
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:
BOOLEAN ←
TRUE]
RETURNS [data: TEditDocument.Selection] =
{RETURN [IF primary THEN pSel ELSE sSel]} ;
AutoScroll:
PUBLIC
PROC [tryToGlitch:
BOOLEAN ←
TRUE] = {
TEditScrolling.AutoScroll[tryToGlitch: tryToGlitch] }; -- scroll to selection
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.