CDDirectoryExtras.mesa (a Chipndale module)
Copyright © 1984 by Xerox Corporation. All rights reserved.
by Christian Jacobi November 16, 1984 11:38:49 am PST
last edited Christian Jacobi November 19, 1984 9:54:01 am PST
DIRECTORY
CD USING [Design, DesignPosition, ObPtr, ObjectProcs];
CDDirectoryExtras: CEDAR DEFINITIONS =
BEGIN
-- client usage
ReplaceObject:
PROC [design:
CD.Design,
old: CD.ObPtr,
new: CD.ObPtr,
off: CD.DesignPosition←[0, 0]
];
--all over in the design replace old by new
--may be delayed
RepositionObject:
PROC [design:
CD.Design,
ob: CD.ObPtr,
oldSize: CD.DesignPosition,
baseOff: CD.DesignPosition←[0, 0]
];
--all over in the design tries to reposition ob;
--may be delayed
-- implementors usage
DoReplaceDirectChild: ReplaceDChildsProc;
ReplaceRec:
TYPE =
RECORD [
old: CD.ObPtr,
oldSize: CD.DesignPosition, -- never changed
new: CD.ObPtr,
newSize: CD.DesignPosition, -- will be computed once before calling client procedures
off: CD.DesignPosition
];
ReplaceList: TYPE = LIST OF REF ReplaceRec;
ReplaceDChildsProc:
TYPE =
PROC [
me: CD.ObPtr,
design: CD.Design,
replace: LIST OF REF ReplaceRec
] RETURNS [changed: BOOL←FALSE];
InstallReplaceDChildProc:
PROC [
type: REF CD.ObjectProcs, rdcp: ReplaceDChildsProc];
ReplaceDirectChildForDummyCells:
PRIVATE
PROC [cellOb:
CD.ObPtr, replace: ReplaceList]
RETURNS [needReposition: BOOL];
--useful for implementing CDCellsImpl;
--is like a real ReplaceDChildsProc, but does not start a recursive repositioning
RepositionCell:
PRIVATE
PROC [cellOb:
CD.ObPtr, design:
CD.Design]
RETURNS [didReposition: BOOLEAN];
--useful for implementing CDCellsImpl, CDXImpl
END.