File: Stretch.mesa
Copyright © 1984 by Xerox Corporation. All rights reserved.
Created by: Mayo, June 26, 1984 12:10:18 pm PDT
Last Edited by: Mayo, October 11, 1984 4:06:42 pm PDT
Stretch:
CEDAR
DEFINITIONS =
BEGIN
Direction to stretch (up means slide stuff up, even edges that lie exactly on the stretch line)
Direction: TYPE = {up, down, left, right};
Every stretchable object must register a $StretchProc proc with CDObjectProcs. It should be of this form: (a negative amount means shrink)
StretchProc:
TYPE =
PROC [obj:
CD.ObPtr, design:
CD.Design, place:
INT, dir: Direction, amount:
INT]
RETURNS [
CD.ObPtr, Rope.
ROPE];
-- obj is the object to be stretched
-- design is the design that the new object should be entered into
-- place is the coordinate to be stretched at
-- dir is the direction in which to stretch. Edges that lie exactly on 'place' are moved in this direction, as well as any edge past 'place' in direction 'dir'
-- amount is the amount of stretch in design coordinates (NOT lambda)
-- return value is either a new object or a rope telling what went wrong.
Make a new object that is just like the old except that it is stretched. Return NIL if it can't be done, along with a message.
DoStretch: PROC [obj: CD.ObPtr, design: CD.Design, place: INT, dir: Direction, amount: INT] RETURNS [CD.ObPtr, Rope.ROPE];
END.