home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Apps / DevTools / eText5 / Source / eText.subproj / eText.NeXTHack.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-20  |  3.8 KB  |  260 lines

  1. {\rtf0\ansi{\fonttbl\f0\fmodern Courier;\f1\ftech Symbol;\f2\fmodern Ohlfs;}
  2. \margl40
  3. \margr40
  4. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 //—————————————————————————————————————————————————————————————————————————————\
  5. //
  6. \i     
  7. \b FILENAME
  8. \b0 :    
  9. \b\i0 eText.NeXTHack.h \
  10.  
  11. \b0 //
  12. \i     
  13. \b SUMMARY
  14. \b0 :    
  15. \b\i0 Interface for various private Text methods
  16. \b0 \
  17. //    
  18. \b\i CATEGORY
  19. \b0 :
  20. \i0     
  21. \b NeXTHack
  22. \b0 , 
  23. \b Mole
  24. \b0 , 
  25. \b ClipView(undocumented)
  26. \b0 \
  27. //    
  28. \b\i PROTOCOLS
  29. \b0 :
  30. \i0     
  31. \b None
  32. \b0 \
  33. //    
  34. \b\i INTERFACE
  35. \b0 :
  36. \i0     
  37. \b None
  38. \b0 \
  39. //    
  40. \b\i AUTHOR
  41. \b0 :        
  42. \b\i0 Rohit Khare
  43. \b0 \
  44. //    
  45. \b\i COPYRIGHT
  46. \b0 :    
  47. \f1\i0 ½
  48. \f0\b 1993,94 California Institure of Technology, eText Project\
  49.  
  50. \b0 //—————————————————————————————————————————————————————————————————————————————\
  51. //    
  52. \b\i Description
  53. \b0\i0 \
  54. //        Text was written by a truly misguided genius. That was in 0.9. The\
  55. //    code that's been added since 1991, though, seems to require the assistance\
  56. //    of illegal substance. Someone at NeXT should give me a call about Text\
  57. //    for Mecca. 818/792-9114, anytime. 
  58. \b\i Really
  59. \b0\i0 .\
  60. //—————————————————————————————————————————————————————————————————————————————\
  61. //    
  62. \b\i History
  63. \b0\i0 \
  64. //    11/21/94:    
  65. \b Added runForPosition:.
  66. \b0 \
  67. //    10/17/94:    
  68. \b Cleaned up for eText5.
  69. \b0 \
  70. //    08/05/94:    
  71. \b Completely Rearchitected for 5.0. RK
  72. \b0 \
  73. //—————————————————————————————————————————————————————————————————————————————\
  74. //    
  75. \b Imported Interfaces
  76. \b0 \
  77. //\
  78.     #import "
  79. \b eText.Class.h
  80. \b0 "\
  81. \
  82. #define 
  83. \b NXRTFDPboardType
  84. \b0  NXUniqueString("
  85. \b NeXT RTFD pasteboard type
  86. \b0 ")\
  87. //—————————————————————————————————————————————————————————————————————————————\
  88. //    
  89. \b Text Stream Hacks    
  90. \b0\i Courtesy of Mike Dixon's XText Package
  91. \i0 \
  92. //\
  93. extern char 
  94. \b getPrevious
  95. \b0 (
  96. \b NXStream
  97. \b0  *s);\
  98. /* 
  99. \i NXBGetc - a text stream macro to get the previous character
  100. \i0 . */\
  101.  
  102. \b #define
  103. \b0  
  104. \b NXBGetc
  105. \b0 (s) \\\
  106.     (((s)->buf_base == (s)->buf_ptr) ? 
  107. \b getPrevious
  108. \b0 (s) : \\\
  109.                                        *(--((s)->buf_ptr)) )\
  110. /*  
  111. \i line is from an NXSelPt; returns the length of the line.\
  112.     too bad this requires grunging in Text's data structures
  113. \i0  */\
  114.  
  115. \b #define
  116. \b0  
  117. \b LINE_LENGTH
  118. \b0 (
  119. \b line
  120. \b0 ) \\\
  121.     (self->
  122. \b theBreaks
  123. \b0 ->
  124. \b breaks
  125. \b0 [(line)/sizeof(
  126. \b NXLineDesc
  127. \b0 )] & 
  128. \b 0x3fff
  129. \b0 )\
  130. \
  131.  
  132. \i @interface Text(NeXTHack)\
  133.  
  134. \i0 //—————————————————————————————————————————————————————————————————————————————\
  135. //    
  136. \b Proprietary
  137. \b0 \
  138. //\
  139.     - 
  140. \b addOneFile
  141. \b0 :(char *) fname 
  142. \b sender
  143. \b0 :app;\
  144.     - 
  145. \b setRTFD
  146. \b0 :(
  147. \b BOOL
  148. \b0 )b;\
  149.     - (
  150. \b BOOL
  151. \b0 ) 
  152. \b isRTFD
  153. \b0 ;\
  154.     + (
  155. \b Class
  156. \b0 ) 
  157. \b graphicCellClass
  158. \b0 ;        // 
  159. \i returns NXGraphicCell
  160. \i0 \
  161.     + 
  162. \b classForDirective
  163. \b0 :(char*)theDir;\
  164.     + (const char*) 
  165. \b directiveForClass
  166. \b0 ;\
  167.     - 
  168. \b printOneRun
  169. \b0 :a 
  170. \b end
  171. \b0 :b 
  172. \b into
  173. \b0 :c 
  174. \b fonts
  175. \b0 :d 
  176. \b colors
  177. \b0 :e 
  178. \b run
  179. \b0 :(
  180. \b NXRun
  181. \b0  *)f 
  182. \b runPos
  183. \b0 :g 
  184. \b buf
  185. \b0 :h 
  186. \b state
  187. \b0 :i;\
  188.     \
  189.  
  190. \i @end
  191. \i0 \
  192. \
  193.  
  194. \i @interface eText(Mole)\
  195.  
  196. \i0 //—————————————————————————————————————————————————————————————————————————————\
  197. //    
  198. \b Convenience
  199. \b0 \
  200. //\
  201.     - (
  202. \b NXRunArray
  203. \b0  *) 
  204. \b theRuns
  205. \b0 ;\
  206.     - (
  207. \b NXRun *
  208. \b0 ) 
  209. \b runForPosition
  210. \b0 :(int)pos;\
  211. \
  212. //—————————————————————————————————————————————————————————————————————————————\
  213. //    
  214. \b Delegation
  215. \b0 \
  216. //\
  217.     - 
  218. \b textDidGetKeys
  219. \b0 :sender 
  220. \b isEmpty
  221. \b0 :(
  222. \b BOOL
  223. \b0 )flag;\
  224.     - 
  225. \b textWillConvert
  226. \b0 :sender 
  227. \b fromFont
  228. \b0 :from 
  229. \b toFont
  230. \b0 :to;\
  231.     - 
  232. \b textDidRead
  233. \b0 :sender 
  234. \b paperSize
  235. \b0 :(
  236. \b NXSize
  237. \b0  *)paperSize;\
  238. \
  239.  
  240. \i @end
  241. \i0 \
  242. \
  243.  
  244. \i @interface ClipView(undocumented)\
  245.  
  246. \i0 //—————————————————————————————————————————————————————————————————————————————\
  247. //    
  248. \b Scrolling (XText)
  249. \b0 \
  250. //\
  251.     - 
  252. \b _scrollTo
  253. \b0 :(
  254. \b NXPoint
  255. \b0  *)origin;\
  256.  
  257. \i \
  258. @end
  259. }
  260.