DIRECTORY EditSpan, TextLooks, TextNode, EditNotify, UndoEvent; EditSpanSupport: CEDAR DEFINITIONS = BEGIN OPEN EditSpan; Ref: TYPE = TextNode.Ref; RefTextNode: TYPE = TextNode.RefTextNode; RefOtherNode: TYPE = TextNode.RefOtherNode; Offset: TYPE = TextNode.Offset; MaxLen: Offset = LAST[Offset]; Location: TYPE = TextNode.Location; nullLocation: Location = TextNode.nullLocation; Span: TYPE = TextNode.Span; nullSpan: Span = TextNode.nullSpan; Event: TYPE = UndoEvent.Ref; NodeItself: Offset = TextNode.NodeItself; Slice: TYPE = REF SliceArray; SliceArray: TYPE = RECORD [ next: Slice, -- for free list kind: OfSlice, -- before/after length: NAT _ 0, nodes: SEQUENCE maxLength: NAT OF Ref ]; OfSlice: TYPE = { before, after }; GetSlice: PROC [len: NAT] RETURNS [slice: Slice]; FreeSlice: PROC [slice: Slice]; SliceLength: PROC [slice: Slice] RETURNS [length: NAT] = INLINE { RETURN [slice.length] }; SliceNode: PROC [slice: Slice, index: NAT] RETURNS [Ref] = INLINE { RETURN [slice[index]] }; LastOfSlice: PROC [slice: Slice] RETURNS [Ref] = INLINE { RETURN [slice[slice.length-1]] }; Splice: PROC [before, after: Slice, beforeStart, afterStart: NAT _ 0]; ReplaceBand: PROC [before, after, top, bottom: Slice, nesting: INTEGER, event: Event]; BadBand: ERROR; DescribeBand: PROC [first, last: Ref] RETURNS [before, after, top, bottom: Slice, nesting: INTEGER, depth: NAT]; DeletePrefix: PROC [slice: Slice, depth: NAT]; DestSlices: PUBLIC PROC [dest: Ref, where: Place] RETURNS [before, after: Slice, nesting: INTEGER]; CreateDest: PROC [depth: NAT] RETURNS [dest: Location]; CopySpan: PROC [span: Span] RETURNS [result: Span]; CheckBeforeMove: PROC [dest: Location, source: Span, where: Place] RETURNS [ok: BOOLEAN]; NeededNestingChange: TYPE = { needNest, needUnNest, ok }; NeedNestingChange: PROC [before, after, top, bottom: Slice, nesting: INTEGER, depth: NAT] RETURNS [NeededNestingChange]; CompareSliceOrder: PROC [s1, s2: Slice] RETURNS [order: NodeOrder]; DoSplits: PROC [alpha, beta: Span, event: Event] RETURNS [Span, Span]; DoSplits2: PROC [dest: Location, source: Span, where: Place, nesting: INTEGER, event: Event] RETURNS [Location, Span, Place, INTEGER]; UndoSplits: PROC [alpha, beta: Span, event: Event] RETURNS [Span, Span]; UndoSplits2: PUBLIC PROC [dest: Location, source: Span, event: Event] RETURNS [Location, Span]; ReMerge: PROC [alpha, beta: Span, merge: Ref, event: Event, tail: BOOLEAN _ FALSE] RETURNS [Span, Span]; SliceOrder: PROC [alpha, beta: Span, aBefore, aBottom, bBefore, bBottom: Slice] RETURNS [overlap: BOOLEAN, head, tail: Span, startOrder, endOrder: NodeOrder]; FixWordSpans: PROC [alpha, beta: Span, event: Event] RETURNS [newAlpha, newBeta: Span]; ApplyProc: TYPE = PROC [node: RefTextNode, start, len: Offset] RETURNS [stop: BOOLEAN]; Apply: PROC [span: Span, proc: ApplyProc]; NodeSpan: PROC [span: Span] RETURNS [Span] = INLINE { RETURN [[[span.start.node,NodeItself],[span.end.node,NodeItself]]] }; NodeLoc: PROC [loc: Location] RETURNS [Location] = INLINE { RETURN [[loc.node,NodeItself]] }; BackLoc, ForwardLoc: PROC [loc: Location] RETURNS [new: Location]; END. ÆEditSpanSupport.mesa written by Bill Paxton, June 1981 last edit by Bill Paxton, 17-Feb-82 9:53:04 last edit by Russ Atkinson, July 22, 1983 9:53 am -- ***** Declarations -- ***** Operations ÊJ˜šœ™Jšœ!™!Jšœ,™,Jšœ1™1—J˜JšÏk ˜ J˜ J˜ J˜ J˜ J˜ J˜šœœ˜#Jš œ ˜—J˜Jšœœ˜Jšœ œ˜)Jšœœ˜+Jšœœ˜Jšœœ ˜Jšœ œ˜#J˜/Jšœœ˜J˜#Jšœœ˜J˜)J˜J˜JšÏc™J˜Jšœœœ ˜šœ œœ˜Jšœ ž˜Jšœž˜Jšœœ˜Jšœœ œœ˜%J˜—Jšœ œ˜"J˜Jšž™J˜JšÏnœœœœ˜1J˜JšŸ œœ˜J˜Jš Ÿ œœœ œœœ˜ZJ˜š Ÿ œœœœ œ˜CJšœ˜J˜—šŸ œœœ œ˜9Jšœ˜!J˜—JšŸœœ1œ˜FJ˜JšŸ œœ.œ˜VJ˜Jšœ œ˜J˜šŸ œœ˜%Jšœ.œ œ˜JJ˜—JšŸ œœœ˜.J˜šŸ œœœ˜1Jšœ!œ˜1J˜—JšŸ œœ œœ˜7J˜JšŸœœœ˜3J˜JšŸœœ.œœ˜YJ˜Jšœœ ˜9šŸœœ$˜;Jšœ œ œœ˜J˜—šŸœœœ˜9Jšœœ˜#J˜—Jšœ Ÿ œœœ˜BJ˜Jšœ˜J˜J˜J˜—…— Rb