ftp.nice.ch/pub/next/text/etext/eText5-0.93.Source.NIHS.tar.gz#/eText5/eText.subproj/eText.Class.m

This is eText.Class.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.Class.m\

\b0 //
\i 	
\b SUMMARY
\b0 :	
\b\i0 Implementation of the Class Management functions of eText:Text
\b0 \
//	
\b\i SUPERCLASS
\b0\i0 :	
\b Object:Responder:View:Text:eText
\b0 \
//	
\b\i PROTOCOLS
\b0\i0 :	
\b <Annotation>
\b0 ,
\b  <SearchableText>
\b0 \
//	
\b\i INTERFACE
\b0\i0 :	
\b None, indirectly through eTDoc.nib
\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 initialization and lifecycle methods bear the brunt of\
//	integrating all the diverse bits of code in the different categories.\
//ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ\
//	
\b\i History
\b0\i0 \
//	10/17/94:	
\b Cleaned up for eText5.
\b0 \
//	08/05/94:	
\b Completely Rearchitected for 5.0. RK
\b0 \
//	07/10/94:	
\b Rewrote HTML parsing routines; moved code out of eTDoc
\b0 \
//	06/18/94:	
\b Added writeHTML:from:length:. RK & TRZ.
\b0 \
//	05/09/94:	
\b Added positionForAnnotation
\b0 \
//	01/20/94:	
\b Revised throughout for eText4.0
\b0 \
//	09/11/93:	
\b Added Dragging support
\b0 \
//	08/19/93:	
\b Created. Based directly on 1.0 sources, edited down.
\b0 \
//	06/24/93: 	
\b Version 1.0 Created (Rohit Khare)
\b0 \
//ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ\
//	
\b Imported Interfaces
\b0 \
//\
	#import "
\b eText.Class.h
\b0 "\
\

\i @implementation eText\

\i0 //ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ\
//	
\b Class Management
\b0 \
//\
+ 
\b initialize
\b0  \{\
	// 
\i Register %v for HTML and %w for LaTeX for encoding with NXPrintf
\i0 \
	
\b NXRegisterPrintfProc
\b0 ('
\b V
\b0 ', (NXPrintfProc *)&
\b URIEncoder
\b0 ,NULL);\
	
\b NXRegisterPrintfProc
\b0 ('
\b v
\b0 ', (NXPrintfProc *)&
\b HTMLEncoder
\b0 ,NULL);\
	
\b NXRegisterPrintfProc
\b0 ('
\b w
\b0 ', (NXPrintfProc *)&
\b LaTeXEncoder
\b0 ,NULL);\
\
	// ... 
\i and set the encoding table
\i0  \
	[
\b userModel
\b0  
\b defaultValue
\b0 :"
\b WebStep
\b0 " 
\b for
\b0 :"
\b HTMLEncoding
\b0 "];\
\
	// 
\i Register %y for the PlainText encoding that uses NXToAscii()
\i0 \
	
\b NXRegisterPrintfProc
\b0 ('
\b y
\b0 ', (NXPrintfProc *)&
\b ASCIIEncoder
\b0 ,NULL);\
	return self;\
\}\
\
- 
\b awakeFromNib
\b0 \{\
	
\b NXCoord
\b0  left,right,top,bottom;\
	NXAtom	
\b supportedTypes
\b0 [13] = \{	NXFilenamePboardType,\
									NXFileContentsPboardType, \
									NXSoundPboardType,\
									NXPostScriptPboardType, \
									NXTIFFPboardType,\
									N3DRIBPboardType, \
									NXColorPboardType,\
									NXFontPboardType,\
									NXRulerPboardType,\
									NXRTFPboardType,\
									NXAsciiPboardType,\
									NXTabularTextPboardType,\
									NULL\};\
	[self 
\b setMonoFont
\b0 :
\b NO
\b0 ];\
	[self 
\b setRetainedWhileDrawing
\b0 :
\b YES
\b0 ];\
	[self 
\b setGraphicsImportEnabled
\b0 :
\b NO
\b0 ];\
	[self 
\b registerForDraggedTypes
\b0 :
\b supportedTypes
\b0  count:12];\
	[self 
\b setDelegate
\b0 :
\b self
\b0 ];\
\
 	[self 
\b getMarginLeft
\b0 :&left 
\b right
\b0 :&right 
\b top
\b0 :&top 
\b bottom
\b0 :&bottom];\
	[self 
\b setMarginLeft
\b0 :((
\b left
\b0  < 72.0) ? 72.0 : 
\b left
\b0 ) right:
\b 4
\b0  top:
\b 4
\b0  bottom:
\b 4
\b0 ];\
\
	
\b oldTextFilter
\b0  = [self 
\b textFilter
\b0 ];\
 	[self 
\b setTextFilter
\b0 :&
\b undoFilterFunc
\b0 ];\
	\
	[self 
\b setInitialAction
\b0 :[[
\b XTDispatchAction
\b0  alloc] 
\b initBase
\b0 :"" 
\b estream
\b0 :
\b nil
\b0 ]];\
	return self;\
\}\
\
- 
\b initFrame
\b0 :(const NXRect *)
\b frameRect\

\b0 	   
\b text
\b0 :(const STR)
\b theText
\b0 \
  
\b alignment
\b0 :(int)
\b mode
\b0  \{\
	[
\b super
\b0  initFrame:frameRect text:theText alignment:mode];\
	
\b etDoc
\b0  = 
\b nil
\b0 ;\
	
\b undoManager
\b0  = 
\b nil
\b0 ;\
	
\b nextAction
\b0  = 
\b nil
\b0 ;\
	
\b strictRTF
\b0  = 
\b NO
\b0 ;\
	
\b initialAction
\b0  = 
\b nil
\b0 ;\
	
\b errorStream
\b0  = [ErrorStream 
\b default
\b0 ];\
	
\b posHint
\b0  = 
\b -1
\b0 ;\
	
\b xHintPos
\b0  = 
\b -1
\b0 ;\
	return self;\
\}\
\
- 
\b free
\b0  \{\
	
\b etDoc
\b0  = 
\b nil
\b0 ;\
	
\b undoManager
\b0  = 
\b nil
\b0 ;\
	[self 
\b setText
\b0 :""];		// 
\i Nukes all remaining annotations
\i0 \
	return self = [
\b super
\b0  free];\
\}\
\

\i @end
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.