<> <> <> DIRECTORY Rope USING [ROPE], CD USING [Design, ObPtr, DesignPosition, ApplicationPtr]; CDCells: CEDAR DEFINITIONS = BEGIN CreateEmptyCell: PROC [] RETURNS [CD.ObPtr]; <<--Does not includes the cell into any design or celldirectory.>> <<--Does not name the cell.>> <<--Use CDDirectory.Include to include cell to a design.>> <<>> CreateCellSelected: PROC [design: CD.Design, name: Rope.ROPE_NIL] RETURNS [done: BOOL, cellOb: CD.ObPtr]; <<--name=NIL: interactive read for name.>> <<--name#NIL: hint for name; may be modified.>> <<--If done: cell is included in directory of design.>> PushInCellSelected: PROC [design: CD.Design] RETURNS [done: BOOL]; <<--message of problem if not done>> PushInCellPointed: PROC [design: CD.Design, pos: CD.DesignPosition] RETURNS [done: BOOL]; <<--message of problem if not done>> PopFromCell: PROC [design: CD.Design, m: Method_interactive, name: Rope.ROPE_NIL] RETURNS [done: BOOL]; <<--message of problem if not done>> Method: TYPE = {flush, newcell, replace, interactive}; RemoveApplication: PROC [design: CD.Design, cell: CD.ObPtr, aptr: CD.ApplicationPtr, draw: BOOL_TRUE] RETURNS [removed: CD.ApplicationPtr_NIL, repositioned: BOOL_FALSE]; <<--If necessary, modifies the boundary and translates all applications of the cell,>> <<-- and further, translates all the instances of the cell. This changes the>> <<-- parent cells, which therefore may be repositioned recursively too. >> <<--noop if cell does not contain aptr (directly).>> <<--Do not assume aptr^ to be freed for other use but use removed; >> <<-- removed=NIL: aptr has not successfully been removed>> <<-- removed#NIL: aptr is removed, removed is a copy of aptr for arbitrary re-use>> <<--If design=NIL: to handle cells which are not part of any design>> <<>> IncludeApplication: PROC [design: CD.Design, cell: CD.ObPtr, aptr: CD.ApplicationPtr, draw: BOOL_TRUE, relativeTo: CD.ApplicationPtr_NIL] RETURNS [repositioned: BOOL_FALSE]; <<--aptr^ is supposed to be referenced by aptr exclusively, and aptr^ may be changed by>> <<-- IncludeApplication.>> <<--If necessary, modifies the boundary and translates all applications of the cell,>> <<-- and further, translates all the instances of the cell. This changes the>> <<-- parent cells, which therefore may be repositioned recursively too. >> <<--relativeTo#NIL: handy but trivial hook for clients which fear that repositioning >> <<-- fools their origin: aptr is first translated by relativeTo.location: if relativeTo >> <<-- points to an application of the cell itself, repositioning changes relativeTo^ >> <<-- exactly the right amount to compensate for the repositioning. It is the clients >> <<-- responsibility that relativeTo is actual contained by cell.>> <<--If design=NIL: to handle cells which are not part of any design>> END. <<>>