This is eText.Annotation.m in view mode; [Download] [Up]
{\rtf0\ansi{\fonttbl\f0\fmodern Courier;\f1\ftech Symbol;\f2\fmodern Ohlfs;}
\margl40
\margr40
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 //ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ\
//
\i
\b FILENAME
\b0 :
\b\i0 eText.Annotation.m\
\b0 //
\i
\b SUMMARY
\b0 :
\b\i0 Implementation of interactions between eText and Annotations
\b0 \
//
\b\i CATEGORY
\b0 :
\i0
\b Annotation
\b0 \
//
\b\i PROTOCOLS
\b0 :
\i0
\b Uses <Annotation>
\b0 \
//
\b\i INTERFACE
\b0 :
\i0
\b None
\b0 \
//
\b\i AUTHOR
\b0 :
\b\i0 Rohit Khare
\b0 \
//
\b\i COPYRIGHT
\b0 :
\f1\i0 Ó
\f0\b 1993,94 California Institure of Technology, eText Project\
\b0 //ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ\
//
\b\i Implementation Comments
\b0\i0 \
// These methods are "syntactic sugar" to replace NeXT's cell terminology. \
//ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ\
//
\b\i History
\b0\i0 \
// 11/26/94:
\b Added -runForAnnotation.
\b0 \
// 10/17/94:
\b Cleaned up for eText5.
\b0 \
// 08/05/94:
\b Completely Rearchitected for 5.0. RK
\b0 \
//ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ\
//
\b Imported Interfaces
\b0 \
//\
#import "
\b eText.Annotation.h
\b0 "\
\
\i @implementation eText(Annotation)\
\i0 //ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ\
//
\b Embedding Annotations
\b0 \
//\
-
\b insertAnnotation
\b0 :theAnnotation \{\
int
\b from
\b0 = sp0.cp;\
\
if (
\b !
\b0 [self
\b isEditable
\b0 ]) return
\b nil
\b0 ;\
[self
\b undoSelChange
\b0 :"
\b Insert Annotation
\b0 "];\
[self
\b replaceSelWithAnnotation
\b0 :theAnnotation];\
[self
\b undoAffectedRange
\b0 :from
\b to
\b0 :from+1];\
[self
\b touch
\b0 ];\
return self;\
\}\
\
-
\b replaceSelWithAnnotation
\b0 :theAnnotation \{\
[self
\b replaceSelWithCell
\b0 :theAnnotation];\
return self;\
\}\
\
//ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ\
//
\b Locating Annotations
\b0 \
//\
- (
\b int
\b0 )
\b positionForAnnotation
\b0 :theAnnotation \{\
int pos,k,N;\
\b NXRun
\b0 *
\b curr
\b0 ;\
\
if (theAnnotation ==
\b nil
\b0 ) return
\b -1
\b0 ;\
pos=0;\
\b N
\b0 = theRuns->chunk.
\b used
\b0 /sizeof(
\b NXRun
\b0 );\
\b curr
\b0 = theRuns->
\b runs
\b0 ;\
for (k=0; k < N; k++) \{\
if (curr->
\b info
\b0 ==
\b theAnnotation
\b0 ) return
\b pos
\b0 ;\
\b pos
\b0
\b +=
\b0 curr->
\b chars
\b0 ;\
curr++;\
\}\
return
\b -1
\b0 ;\
\}\
\
- (
\b NXRun *
\b0 )
\b runForAnnotation
\b0 :theAnnotation \{\
int k,N;\
\b NXRun
\b0 *
\b curr
\b0 ;\
\
if (theAnnotation ==
\b nil
\b0 ) return
\b NULL
\b0 ;\
\b N
\b0 = theRuns->chunk.
\b used
\b0 /sizeof(
\b NXRun
\b0 );\
\b curr
\b0 = theRuns->
\b runs
\b0 ;\
for (k=0; k < N; k++) \{\
if (curr->
\b info
\b0 ==
\b theAnnotation
\b0 ) return
\b curr
\b0 ;\
curr++;\
\}\
return
\b NULL
\b0 ;\
\}\
\i @end
}
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.