PipalOverlayMutant.mesa 
Copyright Ó 1988 by Xerox Corporation. All rights reserved.
Barth, January 28, 1988 5:34:41 pm PST
Louis Monier February 2, 1988 11:30:04 am PST
Bertrand Serlet February 29, 1988 7:42:31 pm PST
DIRECTORY Pipal, PipalInt, PipalOps, PipalPaint, PipalReal;
PipalOverlayMutant: CEDAR DEFINITIONS = BEGIN
Theory
Pipal overlay mutant. Understands PipalInt.transformClass, PipalInt.translationClass, PipalInt.orientClass, and PipalReal.transformClass. All other objects are treated as primitives which may be pushed into if they have an edit method.
Class
overlayMutantClass: Pipal.Class;
OverlayMutant: TYPE = REF OverlayMutantRec;
OverlayMutantRec: TYPE = RECORD [
overlay: Pipal.Overlay,
selected: Pipal.Objects ← NIL,
undoRedo: PipalOps.UndoRedo ← []
];
Basic Operations
Create: PROC [overlay: Pipal.Overlay] RETURNS [om: OverlayMutant];
Make an mutant object.
Object Manipulation
InsertInt: PROC [om: OverlayMutant, child: Pipal.Object, position: PipalInt.Position, selectNew: BOOLTRUE] RETURNS [new: OverlayMutant];
InsertReal: PROC [om: OverlayMutant, child: Pipal.Object, position: PipalReal.Position, selectNew: BOOLTRUE] RETURNS [new: OverlayMutant];
Insert the child into the overlay at the specified position.
Delete: PROC [om: OverlayMutant] RETURNS [changedArea: PipalPaint.Area, new: OverlayMutant];
Delete the selected items, empty the selection set.
Selection
Select: PROC [om: OverlayMutant, exclusive: BOOLTRUE, remove: BOOLFALSE, style: ATOM, pos1: PipalReal.Position, pos2: PipalReal.Position] RETURNS [changedArea: PipalPaint.Area, new: OverlayMutant];
Commands:
name -> $Select
arguments -> ({$Add, $Exclusive}, {$Select, $Deselect}, {$Point, $Area, $Touch, $Close}, Position, Size)
resultType <- changedArea
name -> $SelectedOutlines
resultType <- selectionArea
Push
Push: PROC [mutant: OverlayMutant] RETURNS [mutants: Pipal.Objects, new: OverlayMutant];
Pushes into the selected instances having an Edit method.
Registers the appropriate pop watchdogs.
Open question: when are those watchdogs un-registered???
END.