TextEdit.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:55k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       TextEdit.h
  3.  
  4.      Contains:   TextEdit Interfaces.
  5.  
  6.      Version:    Technology: System 8.5
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1985-2001 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __TEXTEDIT__
  18. #define __TEXTEDIT__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #ifndef __QUICKDRAW__
  23. #include "Quickdraw.h"
  24. #endif
  25. #ifndef __MIXEDMODE__
  26. #include "MixedMode.h"
  27. #endif
  28. #if PRAGMA_ONCE
  29. #pragma once
  30. #endif
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. #if PRAGMA_IMPORT
  35. #pragma import on
  36. #endif
  37. #if PRAGMA_STRUCT_ALIGN
  38.     #pragma options align=mac68k
  39. #elif PRAGMA_STRUCT_PACKPUSH
  40.     #pragma pack(push, 2)
  41. #elif PRAGMA_STRUCT_PACK
  42.     #pragma pack(2)
  43. #endif
  44. typedef struct TERec                    TERec;
  45. typedef TERec *                         TEPtr;
  46. typedef TEPtr *                         TEHandle;
  47. typedef CALLBACK_API( void , HighHookProcPtr )(const Rect *r, TEPtr pTE);
  48. typedef CALLBACK_API( Boolean , EOLHookProcPtr )(char theChar, TEPtr pTE, TEHandle hTE);
  49. typedef CALLBACK_API( void , CaretHookProcPtr )(const Rect *r, TEPtr pTE);
  50. typedef CALLBACK_API( unsigned short , WidthHookProcPtr )(unsigned short textLen, unsigned short textOffset, void *textBufferPtr, TEPtr pTE, TEHandle hTE);
  51. typedef CALLBACK_API( unsigned short , TextWidthHookProcPtr )(unsigned short textLen, unsigned short textOffset, void *textBufferPtr, TEPtr pTE, TEHandle hTE);
  52. typedef CALLBACK_API( unsigned short , NWidthHookProcPtr )(unsigned short styleRunLen, unsigned short styleRunOffset, short slop, short direction, void *textBufferPtr, short *lineStart, TEPtr pTE, TEHandle hTE);
  53. typedef CALLBACK_API( void , DrawHookProcPtr )(unsigned short textOffset, unsigned short drawLen, void *textBufferPtr, TEPtr pTE, TEHandle hTE);
  54. typedef CALLBACK_API( Boolean , HitTestHookProcPtr )(unsigned short styleRunLen, unsigned short styleRunOffset, unsigned short slop, void *textBufferPtr, TEPtr pTE, TEHandle hTE, unsigned short *pixelWidth, unsigned short *charOffset, Boolean *pixelInChar);
  55. typedef CALLBACK_API( void , TEFindWordProcPtr )(unsigned short currentPos, short caller, TEPtr pTE, TEHandle hTE, unsigned short *wordStart, unsigned short *wordEnd);
  56. typedef CALLBACK_API( void , TERecalcProcPtr )(TEPtr pTE, unsigned short changeLength, unsigned short *lineStart, unsigned short *firstChar, unsigned short *lastChar);
  57. typedef CALLBACK_API( void , TEDoTextProcPtr )(TEPtr pTE, unsigned short firstChar, unsigned short lastChar, short selector, GrafPtr *currentGrafPort, short *charPosition);
  58. typedef CALLBACK_API( Boolean , TEClickLoopProcPtr )(TEPtr pTE);
  59. /*
  60.     WARNING: TEClickLoopProcPtr uses register based parameters under classic 68k
  61.              and cannot be written in a high-level language without 
  62.              the help of mixed mode or assembly glue.
  63. */
  64. typedef CALLBACK_API( Boolean , WordBreakProcPtr )(Ptr text, short charPos);
  65. /*
  66.     WARNING: WordBreakProcPtr uses register based parameters under classic 68k
  67.              and cannot be written in a high-level language without 
  68.              the help of mixed mode or assembly glue.
  69. */
  70. /* 
  71.     Important note about TEClickLoopProcPtr and WordBreakProcPtr
  72.     At one point these were defined as returning the function result in the 
  73.     condition code Z-bit.  This was correct, in that it was what the 68K
  74.     implementation of TextEdit actually tested.  But, MixedMode had a different 
  75.     idea of what returning a boolean in the Z-bit meant.  MixedMode was setting
  76.     the Z-bit the complement of what was wanted.  
  77.     
  78.     Therefore, these ProcPtrs have been changed (back) to return the result in
  79.     register D0.  It turns out that for register based routines, 
  80.     MixedMode sets the Z-bit of the 68K emulator based on the contents 
  81.     of the return result register.  Thus we can get the Z-bit set correctly.  
  82.     
  83.     But, when TextEdit is recoded in PowerPC, if it calls a 68K ClickLoop
  84.     or WordBreak routine, register D0 had better have the result (in addition
  85.     to the Z-bit). Therefore all 68K apps should make sure their ClickLoop or
  86.     WordBreak routines set register D0 at the end.
  87. */
  88. /* 
  89.     There is no function to get/set the low-mem for FindWordHook at 0x07F8.
  90.     This is because it is not a low-mem ProcPtr. That address is the entry
  91.     in the OS TrapTable for trap 0xA0FE.  You can use Get/SetTrapAddress to 
  92.     acccess it. 
  93. */
  94. /*
  95.     The following ProcPtrs cannot be written in or called from a high-level 
  96.     language without the help of mixed mode or assembly glue because they 
  97.     use the following parameter-passing conventions:
  98.     typedef pascal void (*HighHookProcPtr)(const Rect *r, TEPtr pTE);
  99.     typedef pascal void (*CaretHookProcPtr)(const Rect *r, TEPtr pTE);
  100.         In:
  101.             =>  r                       on stack
  102.             =>  pTE                     A3.L
  103.         Out:
  104.             none
  105.     typedef pascal Boolean (*EOLHookProcPtr)(char theChar, TEPtr pTE, TEHandle hTE);
  106.         In:
  107.             =>  theChar                 D0.B
  108.             =>  pTE                     A3.L
  109.             =>  hTE                     A4.L
  110.         Out:
  111.             <=  Boolean                 Z bit of the CCR
  112.     typedef pascal unsigned short (*WidthHookProcPtr)(unsigned short textLen,
  113.      unsigned short textOffset, void *textBufferPtr, TEPtr pTE, TEHandle hTE);
  114.     typedef pascal unsigned short (*TextWidthHookProcPtr)(unsigned short textLen,
  115.      unsigned short textOffset, void *textBufferPtr, TEPtr pTE, TEHandle hTE);
  116.         In:
  117.             =>  textLen                 D0.W
  118.             =>  textOffset              D1.W
  119.             =>  textBufferPtr           A0.L
  120.             =>  pTE                     A3.L
  121.             =>  hTE                     A4.L
  122.         Out:
  123.             <=  unsigned short          D1.W
  124.     typedef pascal unsigned short (*NWidthHookProcPtr)(unsigned short styleRunLen,
  125.      unsigned short styleRunOffset, short slop, short direction, void *textBufferPtr, 
  126.      short *lineStart, TEPtr pTE, TEHandle hTE);
  127.         In:
  128.             =>  styleRunLen             D0.W
  129.             =>  styleRunOffset          D1.W
  130.             =>  slop                    D2.W (low)
  131.             =>  direction               D2.W (high)
  132.             =>  textBufferPtr           A0.L
  133.             =>  lineStart               A2.L
  134.             =>  pTE                     A3.L
  135.             =>  hTE                     A4.L
  136.         Out:
  137.             <=  unsigned short          D1.W
  138.     typedef pascal void (*DrawHookProcPtr)(unsigned short textOffset, unsigned short drawLen,
  139.      void *textBufferPtr, TEPtr pTE, TEHandle hTE);
  140.         In:
  141.             =>  textOffset              D0.W
  142.             =>  drawLen                 D1.W
  143.             =>  textBufferPtr           A0.L
  144.             =>  pTE                     A3.L
  145.             =>  hTE                     A4.L
  146.         Out:
  147.             none
  148.     typedef pascal Boolean (*HitTestHookProcPtr)(unsigned short styleRunLen,
  149.      unsigned short styleRunOffset, unsigned short slop, void *textBufferPtr,
  150.      TEPtr pTE, TEHandle hTE, unsigned short *pixelWidth, unsigned short *charOffset, 
  151.      Boolean *pixelInChar);
  152.         In:
  153.             =>  styleRunLen             D0.W
  154.             =>  styleRunOffset          D1.W
  155.             =>  slop                    D2.W
  156.             =>  textBufferPtr           A0.L
  157.             =>  pTE                     A3.L
  158.             =>  hTE                     A4.L
  159.         Out:
  160.             <=  pixelWidth              D0.W (low)
  161.             <=  Boolean                 D0.W (high)
  162.             <=  charOffset              D1.W
  163.             <=  pixelInChar             D2.W
  164.     typedef pascal void (*TEFindWordProcPtr)(unsigned short currentPos, short caller, 
  165.      TEPtr pTE, TEHandle hTE, unsigned short *wordStart, unsigned short *wordEnd);
  166.         In:
  167.             =>  currentPos              D0.W
  168.             =>  caller                  D2.W
  169.             =>  pTE                     A3.L
  170.             =>  hTE                     A4.L
  171.         Out:
  172.             <=  wordStart               D0.W
  173.             <=  wordEnd                 D1.W
  174.     typedef pascal void (*TERecalcProcPtr)(TEPtr pTE, unsigned short changeLength,
  175.      unsigned short *lineStart, unsigned short *firstChar, unsigned short *lastChar);
  176.         In:
  177.             =>  pTE                     A3.L
  178.             =>  changeLength            D7.W
  179.         Out:
  180.             <=  lineStart               D2.W
  181.             <=  firstChar               D3.W
  182.             <=  lastChar                D4.W
  183.     typedef pascal void (*TEDoTextProcPtr)(TEPtr pTE, unsigned short firstChar, unsigned short lastChar,
  184.                         short selector, GrafPtr *currentGrafPort, short *charPosition);
  185.         In:
  186.             =>  pTE                     A3.L
  187.             =>  firstChar               D3.W
  188.             =>  lastChar                D4.W
  189.             =>  selector                D7.W
  190.         Out:
  191.             <=  currentGrafPort         A0.L
  192.             <=  charPosition            D0.W
  193.             
  194. */
  195. typedef STACK_UPP_TYPE(HighHookProcPtr)                         HighHookUPP;
  196. typedef STACK_UPP_TYPE(EOLHookProcPtr)                          EOLHookUPP;
  197. typedef STACK_UPP_TYPE(CaretHookProcPtr)                        CaretHookUPP;
  198. typedef STACK_UPP_TYPE(WidthHookProcPtr)                        WidthHookUPP;
  199. typedef STACK_UPP_TYPE(TextWidthHookProcPtr)                    TextWidthHookUPP;
  200. typedef STACK_UPP_TYPE(NWidthHookProcPtr)                       NWidthHookUPP;
  201. typedef STACK_UPP_TYPE(DrawHookProcPtr)                         DrawHookUPP;
  202. typedef STACK_UPP_TYPE(HitTestHookProcPtr)                      HitTestHookUPP;
  203. typedef STACK_UPP_TYPE(TEFindWordProcPtr)                       TEFindWordUPP;
  204. typedef STACK_UPP_TYPE(TERecalcProcPtr)                         TERecalcUPP;
  205. typedef STACK_UPP_TYPE(TEDoTextProcPtr)                         TEDoTextUPP;
  206. typedef REGISTER_UPP_TYPE(TEClickLoopProcPtr)                   TEClickLoopUPP;
  207. typedef REGISTER_UPP_TYPE(WordBreakProcPtr)                     WordBreakUPP;
  208. struct TERec {
  209.     Rect                            destRect;
  210.     Rect                            viewRect;
  211.     Rect                            selRect;
  212.     short                           lineHeight;
  213.     short                           fontAscent;
  214.     Point                           selPoint;
  215.     short                           selStart;
  216.     short                           selEnd;
  217.     short                           active;
  218.     WordBreakUPP                    wordBreak;                  /* NOTE: This field is ignored on non-Roman systems and on Carbon (see IM-Text 2-60) */
  219.     TEClickLoopUPP                  clickLoop;
  220.     long                            clickTime;
  221.     short                           clickLoc;
  222.     long                            caretTime;
  223.     short                           caretState;
  224.     short                           just;
  225.     short                           teLength;
  226.     Handle                          hText;
  227.     long                            hDispatchRec;               /* added to replace recalBack & recalLines.  it's a handle anyway */
  228.     short                           clikStuff;
  229.     short                           crOnly;
  230.     short                           txFont;
  231.     StyleField                      txFace;                     /*StyleField occupies 16-bits, but only first 8-bits are used*/
  232.     UInt8                           txFlags;                    /* QuickTime uses second 8 bits of StyleField for txFlags */
  233.     short                           txMode;
  234.     short                           txSize;
  235.     GrafPtr                         inPort;
  236.     HighHookUPP                     highHook;
  237.     CaretHookUPP                    caretHook;
  238.     short                           nLines;
  239.     short                           lineStarts[16001];
  240. };
  241. enum {
  242.                                                                 /* Justification (word alignment) styles */
  243.     teJustLeft                  = 0,
  244.     teJustCenter                = 1,
  245.     teJustRight                 = -1,
  246.     teForceLeft                 = -2,                           /* new names for the Justification (word alignment) styles */
  247.     teFlushDefault              = 0,                            /*flush according to the line direction */
  248.     teCenter                    = 1,                            /*center justify (word alignment) */
  249.     teFlushRight                = -1,                           /*flush right for all scripts */
  250.     teFlushLeft                 = -2                            /*flush left for all scripts */
  251. };
  252. enum {
  253.                                                                 /* Set/Replace style modes */
  254.     fontBit                     = 0,                            /*set font*/
  255.     faceBit                     = 1,                            /*set face*/
  256.     sizeBit                     = 2,                            /*set size*/
  257.     clrBit                      = 3,                            /*set color*/
  258.     addSizeBit                  = 4,                            /*add size mode*/
  259.     toggleBit                   = 5                             /*set faces in toggle mode*/
  260. };
  261. enum {
  262.                                                                 /* TESetStyle/TEContinuousStyle modes */
  263.     doFont                      = 1,                            /* set font (family) number*/
  264.     doFace                      = 2,                            /*set character style*/
  265.     doSize                      = 4,                            /*set type size*/
  266.     doColor                     = 8,                            /*set color*/
  267.     doAll                       = 15,                           /*set all attributes*/
  268.     addSize                     = 16,                           /*adjust type size*/
  269.     doToggle                    = 32                            /*toggle mode for TESetStyle*/
  270. };
  271. enum {
  272.                                                                 /* offsets into TEDispatchRec */
  273.     EOLHook                     = 0,                            /*[UniversalProcPtr] TEEOLHook*/
  274.     DRAWHook                    = 4,                            /*[UniversalProcPtr] TEWidthHook*/
  275.     WIDTHHook                   = 8,                            /*[UniversalProcPtr] TEDrawHook*/
  276.     HITTESTHook                 = 12,                           /*[UniversalProcPtr] TEHitTestHook*/
  277.     nWIDTHHook                  = 24,                           /*[UniversalProcPtr] nTEWidthHook*/
  278.     TextWidthHook               = 28                            /*[UniversalProcPtr] TETextWidthHook*/
  279. };
  280. enum {
  281.                                                                 /* selectors for TECustomHook */
  282.     intEOLHook                  = 0,                            /*TEIntHook value*/
  283.     intDrawHook                 = 1,                            /*TEIntHook value*/
  284.     intWidthHook                = 2,                            /*TEIntHook value*/
  285.     intHitTestHook              = 3,                            /*TEIntHook value*/
  286.     intNWidthHook               = 6,                            /*TEIntHook value for new version of WidthHook*/
  287.     intTextWidthHook            = 7,                            /*TEIntHook value for new TextWidthHook*/
  288.     intInlineInputTSMTEPreUpdateHook = 8,                       /*TEIntHook value for TSMTEPreUpdateProcPtr callback*/
  289.     intInlineInputTSMTEPostUpdateHook = 9                       /*TEIntHook value for TSMTEPostUpdateProcPtr callback*/
  290. };
  291. enum {
  292.                                                                 /* feature or bit definitions for TEFeatureFlag */
  293.     teFAutoScroll               = 0,                            /*00000001b*/
  294.     teFTextBuffering            = 1,                            /*00000010b*/
  295.     teFOutlineHilite            = 2,                            /*00000100b*/
  296.     teFInlineInput              = 3,                            /*00001000b */
  297.     teFUseWhiteBackground       = 4,                            /*00010000b */
  298.     teFUseInlineInput           = 5,                            /*00100000b */
  299.     teFInlineInputAutoScroll    = 6                             /*01000000b */
  300. };
  301. enum {
  302.                                                                 /* action for the new "bit (un)set" interface, TEFeatureFlag */
  303.     teBitClear                  = 0,
  304.     teBitSet                    = 1,                            /*set the selector bit*/
  305.     teBitTest                   = -1                            /*no change; just return the current setting*/
  306. };
  307. enum {
  308.                                                                 /*constants for identifying the routine that called FindWord */
  309.     teWordSelect                = 4,                            /*clickExpand to select word*/
  310.     teWordDrag                  = 8,                            /*clickExpand to drag new word*/
  311.     teFromFind                  = 12,                           /*FindLine called it ($0C)*/
  312.     teFromRecal                 = 16                            /*RecalLines called it ($10)      obsolete */
  313. };
  314. enum {
  315.                                                                 /*constants for identifying TEDoText selectors */
  316.     teFind                      = 0,                            /*TEDoText called for searching*/
  317.     teHighlight                 = 1,                            /*TEDoText called for highlighting*/
  318.     teDraw                      = -1,                           /*TEDoText called for drawing text*/
  319.     teCaret                     = -2                            /*TEDoText called for drawing the caret*/
  320. };
  321. typedef char                            Chars[32001];
  322. typedef char *                          CharsPtr;
  323. typedef CharsPtr *                      CharsHandle;
  324. struct StyleRun {
  325.     short                           startChar;                  /*starting character position*/
  326.     short                           styleIndex;                 /*index in style table*/
  327. };
  328. typedef struct StyleRun                 StyleRun;
  329. struct STElement {
  330.     short                           stCount;                    /*number of runs in this style*/
  331.     short                           stHeight;                   /*line height*/
  332.     short                           stAscent;                   /*font ascent*/
  333.     short                           stFont;                     /*font (family) number*/
  334.     StyleField                      stFace;                     /*StyleField occupies 16-bits, but only first 8-bits are used*/
  335.     UInt8                           txFlags;                    /* QuickTime uses second 8 bits of StyleField for txFlags */
  336.     short                           stSize;                     /*size in points*/
  337.     RGBColor                        stColor;                    /*absolute (RGB) color*/
  338. };
  339. typedef struct STElement                STElement;
  340. typedef STElement                       TEStyleTable[1777];
  341. typedef STElement *                     STPtr;
  342. typedef STPtr *                         STHandle;
  343. struct LHElement {
  344.     short                           lhHeight;                   /*maximum height in line*/
  345.     short                           lhAscent;                   /*maximum ascent in line*/
  346. };
  347. typedef struct LHElement                LHElement;
  348. typedef LHElement                       LHTable[8001];
  349. typedef LHElement *                     LHPtr;
  350. typedef LHPtr *                         LHHandle;
  351. struct ScrpSTElement {
  352.     long                            scrpStartChar;              /*starting character position*/
  353.     short                           scrpHeight;
  354.     short                           scrpAscent;
  355.     short                           scrpFont;
  356.     StyleField                      scrpFace;                   /*StyleField occupies 16-bits, but only first 8-bits are used*/
  357.     UInt8                           txFlags;                    /* QuickTime uses second 8 bits of StyleField for txFlags */
  358.     short                           scrpSize;
  359.     RGBColor                        scrpColor;
  360. };
  361. typedef struct ScrpSTElement            ScrpSTElement;
  362. /* ARRAY [0..1600] OF ScrpSTElement */
  363. typedef ScrpSTElement                   ScrpSTTable[1601];
  364. struct StScrpRec {
  365.     short                           scrpNStyles;                /*number of styles in scrap*/
  366.     ScrpSTTable                     scrpStyleTab;               /*table of styles for scrap*/
  367. };
  368. typedef struct StScrpRec                StScrpRec;
  369. typedef StScrpRec *                     StScrpPtr;
  370. typedef StScrpPtr *                     StScrpHandle;
  371. struct NullStRec {
  372.     long                            teReserved;                 /*reserved for future expansion*/
  373.     StScrpHandle                    nullScrap;                  /*handle to scrap style table*/
  374. };
  375. typedef struct NullStRec                NullStRec;
  376. typedef NullStRec *                     NullStPtr;
  377. typedef NullStPtr *                     NullStHandle;
  378. struct TEStyleRec {
  379.     short                           nRuns;                      /*number of style runs*/
  380.     short                           nStyles;                    /*size of style table*/
  381.     STHandle                        styleTab;                   /*handle to style table*/
  382.     LHHandle                        lhTab;                      /*handle to line-height table*/
  383.     long                            teRefCon;                   /*reserved for application use*/
  384.     NullStHandle                    nullStyle;                  /*Handle to style set at null selection*/
  385.     StyleRun                        runs[8001];                 /*ARRAY [0..8000] OF StyleRun*/
  386. };
  387. typedef struct TEStyleRec               TEStyleRec;
  388. typedef TEStyleRec *                    TEStylePtr;
  389. typedef TEStylePtr *                    TEStyleHandle;
  390. struct TextStyle {
  391.     short                           tsFont;                     /*font (family) number*/
  392.     StyleField                      tsFace;                     /*StyleField occupies 16-bits, but only first 8-bits are used*/
  393.     UInt8                           txFlags;                    /*QuickTime uses second 8 bits of StyleField for txFlags*/
  394.     short                           tsSize;                     /*size in point*/
  395.     RGBColor                        tsColor;                    /*absolute (RGB) color*/
  396. };
  397. typedef struct TextStyle                TextStyle;
  398. typedef TextStyle *                     TextStylePtr;
  399. typedef TextStylePtr *                  TextStyleHandle;
  400. typedef short                           TEIntHook;
  401. #if OPAQUE_UPP_TYPES
  402.     EXTERN_API(HighHookUPP)
  403.     NewHighHookUPP                 (HighHookProcPtr         userRoutine);
  404.     EXTERN_API(EOLHookUPP)
  405.     NewEOLHookUPP                  (EOLHookProcPtr          userRoutine);
  406.     EXTERN_API(CaretHookUPP)
  407.     NewCaretHookUPP                (CaretHookProcPtr        userRoutine);
  408.     EXTERN_API(WidthHookUPP)
  409.     NewWidthHookUPP                (WidthHookProcPtr        userRoutine);
  410.     EXTERN_API(TextWidthHookUPP)
  411.     NewTextWidthHookUPP            (TextWidthHookProcPtr    userRoutine);
  412.     EXTERN_API(NWidthHookUPP)
  413.     NewNWidthHookUPP               (NWidthHookProcPtr       userRoutine);
  414.     EXTERN_API(DrawHookUPP)
  415.     NewDrawHookUPP                 (DrawHookProcPtr         userRoutine);
  416.     EXTERN_API(HitTestHookUPP)
  417.     NewHitTestHookUPP              (HitTestHookProcPtr      userRoutine);
  418.     EXTERN_API(TEFindWordUPP)
  419.     NewTEFindWordUPP               (TEFindWordProcPtr       userRoutine);
  420.     EXTERN_API(TERecalcUPP)
  421.     NewTERecalcUPP                 (TERecalcProcPtr         userRoutine);
  422.     EXTERN_API(TEDoTextUPP)
  423.     NewTEDoTextUPP                 (TEDoTextProcPtr         userRoutine);
  424.     EXTERN_API(TEClickLoopUPP)
  425.     NewTEClickLoopUPP              (TEClickLoopProcPtr      userRoutine);
  426. #if CALL_NOT_IN_CARBON
  427.     EXTERN_API(WordBreakUPP)
  428.     NewWordBreakUPP                (WordBreakProcPtr        userRoutine);
  429. #endif  /* CALL_NOT_IN_CARBON */
  430.     EXTERN_API(void)
  431.     DisposeHighHookUPP             (HighHookUPP             userUPP);
  432.     EXTERN_API(void)
  433.     DisposeEOLHookUPP              (EOLHookUPP              userUPP);
  434.     EXTERN_API(void)
  435.     DisposeCaretHookUPP            (CaretHookUPP            userUPP);
  436.     EXTERN_API(void)
  437.     DisposeWidthHookUPP            (WidthHookUPP            userUPP);
  438.     EXTERN_API(void)
  439.     DisposeTextWidthHookUPP        (TextWidthHookUPP        userUPP);
  440.     EXTERN_API(void)
  441.     DisposeNWidthHookUPP           (NWidthHookUPP           userUPP);
  442.     EXTERN_API(void)
  443.     DisposeDrawHookUPP             (DrawHookUPP             userUPP);
  444.     EXTERN_API(void)
  445.     DisposeHitTestHookUPP          (HitTestHookUPP          userUPP);
  446.     EXTERN_API(void)
  447.     DisposeTEFindWordUPP           (TEFindWordUPP           userUPP);
  448.     EXTERN_API(void)
  449.     DisposeTERecalcUPP             (TERecalcUPP             userUPP);
  450.     EXTERN_API(void)
  451.     DisposeTEDoTextUPP             (TEDoTextUPP             userUPP);
  452.     EXTERN_API(void)
  453.     DisposeTEClickLoopUPP          (TEClickLoopUPP          userUPP);
  454. #if CALL_NOT_IN_CARBON
  455.     EXTERN_API(void)
  456.     DisposeWordBreakUPP            (WordBreakUPP            userUPP);
  457. #endif  /* CALL_NOT_IN_CARBON */
  458.     EXTERN_API(void)
  459.     InvokeHighHookUPP              (const Rect *            r,
  460.                                     TEPtr                   pTE,
  461.                                     HighHookUPP             userUPP);
  462.     EXTERN_API(Boolean)
  463.     InvokeEOLHookUPP               (char                    theChar,
  464.                                     TEPtr                   pTE,
  465.                                     TEHandle                hTE,
  466.                                     EOLHookUPP              userUPP);
  467.     EXTERN_API(void)
  468.     InvokeCaretHookUPP             (const Rect *            r,
  469.                                     TEPtr                   pTE,
  470.                                     CaretHookUPP            userUPP);
  471.     EXTERN_API(unsigned short)
  472.     InvokeWidthHookUPP             (unsigned short          textLen,
  473.                                     unsigned short          textOffset,
  474.                                     void *                  textBufferPtr,
  475.                                     TEPtr                   pTE,
  476.                                     TEHandle                hTE,
  477.                                     WidthHookUPP            userUPP);
  478.     EXTERN_API(unsigned short)
  479.     InvokeTextWidthHookUPP         (unsigned short          textLen,
  480.                                     unsigned short          textOffset,
  481.                                     void *                  textBufferPtr,
  482.                                     TEPtr                   pTE,
  483.                                     TEHandle                hTE,
  484.                                     TextWidthHookUPP        userUPP);
  485.     EXTERN_API(unsigned short)
  486.     InvokeNWidthHookUPP            (unsigned short          styleRunLen,
  487.                                     unsigned short          styleRunOffset,
  488.                                     short                   slop,
  489.                                     short                   direction,
  490.                                     void *                  textBufferPtr,
  491.                                     short *                 lineStart,
  492.                                     TEPtr                   pTE,
  493.                                     TEHandle                hTE,
  494.                                     NWidthHookUPP           userUPP);
  495.     EXTERN_API(void)
  496.     InvokeDrawHookUPP              (unsigned short          textOffset,
  497.                                     unsigned short          drawLen,
  498.                                     void *                  textBufferPtr,
  499.                                     TEPtr                   pTE,
  500.                                     TEHandle                hTE,
  501.                                     DrawHookUPP             userUPP);
  502.     EXTERN_API(Boolean)
  503.     InvokeHitTestHookUPP           (unsigned short          styleRunLen,
  504.                                     unsigned short          styleRunOffset,
  505.                                     unsigned short          slop,
  506.                                     void *                  textBufferPtr,
  507.                                     TEPtr                   pTE,
  508.                                     TEHandle                hTE,
  509.                                     unsigned short *        pixelWidth,
  510.                                     unsigned short *        charOffset,
  511.                                     Boolean *               pixelInChar,
  512.                                     HitTestHookUPP          userUPP);
  513.     EXTERN_API(void)
  514.     InvokeTEFindWordUPP            (unsigned short          currentPos,
  515.                                     short                   caller,
  516.                                     TEPtr                   pTE,
  517.                                     TEHandle                hTE,
  518.                                     unsigned short *        wordStart,
  519.                                     unsigned short *        wordEnd,
  520.                                     TEFindWordUPP           userUPP);
  521.     EXTERN_API(void)
  522.     InvokeTERecalcUPP              (TEPtr                   pTE,
  523.                                     unsigned short          changeLength,
  524.                                     unsigned short *        lineStart,
  525.                                     unsigned short *        firstChar,
  526.                                     unsigned short *        lastChar,
  527.                                     TERecalcUPP             userUPP);
  528.     EXTERN_API(void)
  529.     InvokeTEDoTextUPP              (TEPtr                   pTE,
  530.                                     unsigned short          firstChar,
  531.                                     unsigned short          lastChar,
  532.                                     short                   selector,
  533.                                     GrafPtr *               currentGrafPort,
  534.                                     short *                 charPosition,
  535.                                     TEDoTextUPP             userUPP);
  536.     EXTERN_API(Boolean)
  537.     InvokeTEClickLoopUPP           (TEPtr                   pTE,
  538.                                     TEClickLoopUPP          userUPP);
  539. #if CALL_NOT_IN_CARBON
  540.     EXTERN_API(Boolean)
  541.     InvokeWordBreakUPP             (Ptr                     text,
  542.                                     short                   charPos,
  543.                                     WordBreakUPP            userUPP);
  544. #endif  /* CALL_NOT_IN_CARBON */
  545. #else
  546.     enum { uppHighHookProcInfo = 0x0000000F };                      /* SPECIAL_CASE_PROCINFO(0) */
  547.     enum { uppEOLHookProcInfo = 0x0000001F };                       /* SPECIAL_CASE_PROCINFO(1) */
  548.     enum { uppCaretHookProcInfo = 0x0000000F };                     /* SPECIAL_CASE_PROCINFO(0) */
  549.     enum { uppWidthHookProcInfo = 0x0000002F };                     /* SPECIAL_CASE_PROCINFO(2) */
  550.     enum { uppTextWidthHookProcInfo = 0x0000002F };                 /* SPECIAL_CASE_PROCINFO(2) */
  551.     enum { uppNWidthHookProcInfo = 0x0000003F };                    /* SPECIAL_CASE_PROCINFO(3) */
  552.     enum { uppDrawHookProcInfo = 0x0000004F };                      /* SPECIAL_CASE_PROCINFO(4) */
  553.     enum { uppHitTestHookProcInfo = 0x0000005F };                   /* SPECIAL_CASE_PROCINFO(5) */
  554.     enum { uppTEFindWordProcInfo = 0x0000006F };                    /* SPECIAL_CASE_PROCINFO(6) */
  555.     enum { uppTERecalcProcInfo = 0x0000009F };                      /* SPECIAL_CASE_PROCINFO(9) */
  556.     enum { uppTEDoTextProcInfo = 0x000000AF };                      /* SPECIAL_CASE_PROCINFO(10) */
  557.     enum { uppTEClickLoopProcInfo = 0x0000F812 };                   /* register 1_byte:D0 Func(4_bytes:A3) */
  558.     enum { uppWordBreakProcInfo = 0x00029812 };                     /* register 1_byte:D0 Func(4_bytes:A0, 2_bytes:D0) */
  559.     #define NewHighHookUPP(userRoutine)                             (HighHookUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppHighHookProcInfo, GetCurrentArchitecture())
  560.     #define NewEOLHookUPP(userRoutine)                              (EOLHookUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppEOLHookProcInfo, GetCurrentArchitecture())
  561.     #define NewCaretHookUPP(userRoutine)                            (CaretHookUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCaretHookProcInfo, GetCurrentArchitecture())
  562.     #define NewWidthHookUPP(userRoutine)                            (WidthHookUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppWidthHookProcInfo, GetCurrentArchitecture())
  563.     #define NewTextWidthHookUPP(userRoutine)                        (TextWidthHookUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTextWidthHookProcInfo, GetCurrentArchitecture())
  564.     #define NewNWidthHookUPP(userRoutine)                           (NWidthHookUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppNWidthHookProcInfo, GetCurrentArchitecture())
  565.     #define NewDrawHookUPP(userRoutine)                             (DrawHookUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDrawHookProcInfo, GetCurrentArchitecture())
  566.     #define NewHitTestHookUPP(userRoutine)                          (HitTestHookUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppHitTestHookProcInfo, GetCurrentArchitecture())
  567.     #define NewTEFindWordUPP(userRoutine)                           (TEFindWordUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTEFindWordProcInfo, GetCurrentArchitecture())
  568.     #define NewTERecalcUPP(userRoutine)                             (TERecalcUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTERecalcProcInfo, GetCurrentArchitecture())
  569.     #define NewTEDoTextUPP(userRoutine)                             (TEDoTextUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTEDoTextProcInfo, GetCurrentArchitecture())
  570.     #define NewTEClickLoopUPP(userRoutine)                          (TEClickLoopUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTEClickLoopProcInfo, GetCurrentArchitecture())
  571.     #define NewWordBreakUPP(userRoutine)                            (WordBreakUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppWordBreakProcInfo, GetCurrentArchitecture())
  572.     #define DisposeHighHookUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  573.     #define DisposeEOLHookUPP(userUPP)                              DisposeRoutineDescriptor(userUPP)
  574.     #define DisposeCaretHookUPP(userUPP)                            DisposeRoutineDescriptor(userUPP)
  575.     #define DisposeWidthHookUPP(userUPP)                            DisposeRoutineDescriptor(userUPP)
  576.     #define DisposeTextWidthHookUPP(userUPP)                        DisposeRoutineDescriptor(userUPP)
  577.     #define DisposeNWidthHookUPP(userUPP)                           DisposeRoutineDescriptor(userUPP)
  578.     #define DisposeDrawHookUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  579.     #define DisposeHitTestHookUPP(userUPP)                          DisposeRoutineDescriptor(userUPP)
  580.     #define DisposeTEFindWordUPP(userUPP)                           DisposeRoutineDescriptor(userUPP)
  581.     #define DisposeTERecalcUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  582.     #define DisposeTEDoTextUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  583.     #define DisposeTEClickLoopUPP(userUPP)                          DisposeRoutineDescriptor(userUPP)
  584.     #define DisposeWordBreakUPP(userUPP)                            DisposeRoutineDescriptor(userUPP)
  585.     #define InvokeHighHookUPP(r, pTE, userUPP)                      CALL_TWO_PARAMETER_UPP((userUPP), uppHighHookProcInfo, (r), (pTE))
  586.     #define InvokeEOLHookUPP(theChar, pTE, hTE, userUPP)            (Boolean)CALL_THREE_PARAMETER_UPP((userUPP), uppEOLHookProcInfo, (theChar), (pTE), (hTE))
  587.     #define InvokeCaretHookUPP(r, pTE, userUPP)                     CALL_TWO_PARAMETER_UPP((userUPP), uppCaretHookProcInfo, (r), (pTE))
  588.     #define InvokeWidthHookUPP(textLen, textOffset, textBufferPtr, pTE, hTE, userUPP)  (unsigned short)CALL_FIVE_PARAMETER_UPP((userUPP), uppWidthHookProcInfo, (textLen), (textOffset), (textBufferPtr), (pTE), (hTE))
  589.     #define InvokeTextWidthHookUPP(textLen, textOffset, textBufferPtr, pTE, hTE, userUPP)  (unsigned short)CALL_FIVE_PARAMETER_UPP((userUPP), uppTextWidthHookProcInfo, (textLen), (textOffset), (textBufferPtr), (pTE), (hTE))
  590.     #define InvokeNWidthHookUPP(styleRunLen, styleRunOffset, slop, direction, textBufferPtr, lineStart, pTE, hTE, userUPP)  (unsigned short)CALL_EIGHT_PARAMETER_UPP((userUPP), uppNWidthHookProcInfo, (styleRunLen), (styleRunOffset), (slop), (direction), (textBufferPtr), (lineStart), (pTE), (hTE))
  591.     #define InvokeDrawHookUPP(textOffset, drawLen, textBufferPtr, pTE, hTE, userUPP)  CALL_FIVE_PARAMETER_UPP((userUPP), uppDrawHookProcInfo, (textOffset), (drawLen), (textBufferPtr), (pTE), (hTE))
  592.     #define InvokeHitTestHookUPP(styleRunLen, styleRunOffset, slop, textBufferPtr, pTE, hTE, pixelWidth, charOffset, pixelInChar, userUPP)  (Boolean)CALL_NINE_PARAMETER_UPP((userUPP), uppHitTestHookProcInfo, (styleRunLen), (styleRunOffset), (slop), (textBufferPtr), (pTE), (hTE), (pixelWidth), (charOffset), (pixelInChar))
  593.     #define InvokeTEFindWordUPP(currentPos, caller, pTE, hTE, wordStart, wordEnd, userUPP)  CALL_SIX_PARAMETER_UPP((userUPP), uppTEFindWordProcInfo, (currentPos), (caller), (pTE), (hTE), (wordStart), (wordEnd))
  594.     #define InvokeTERecalcUPP(pTE, changeLength, lineStart, firstChar, lastChar, userUPP)  CALL_FIVE_PARAMETER_UPP((userUPP), uppTERecalcProcInfo, (pTE), (changeLength), (lineStart), (firstChar), (lastChar))
  595.     #define InvokeTEDoTextUPP(pTE, firstChar, lastChar, selector, currentGrafPort, charPosition, userUPP)  CALL_SIX_PARAMETER_UPP((userUPP), uppTEDoTextProcInfo, (pTE), (firstChar), (lastChar), (selector), (currentGrafPort), (charPosition))
  596.     #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  597.     /* InvokeTEClickLoopUPP can't be called from classic 68k without glue code */
  598.     #else
  599.         #define InvokeTEClickLoopUPP(pTE, userUPP)                      (Boolean)CALL_ONE_PARAMETER_UPP((userUPP), uppTEClickLoopProcInfo, (pTE))
  600.     #endif
  601.     #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  602.     #pragma parameter __D0 InvokeWordBreakUPP(__A0, __D0, __A1)
  603.     Boolean InvokeWordBreakUPP(Ptr text, short charPos, WordBreakUPP userUPP) = 0x4E91;
  604.     #else
  605.         #define InvokeWordBreakUPP(text, charPos, userUPP)              (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppWordBreakProcInfo, (text), (charPos))
  606.     #endif
  607. #endif
  608. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  609. #define NewHighHookProc(userRoutine)                            NewHighHookUPP(userRoutine)
  610. #define NewEOLHookProc(userRoutine)                             NewEOLHookUPP(userRoutine)
  611. #define NewCaretHookProc(userRoutine)                           NewCaretHookUPP(userRoutine)
  612. #define NewWidthHookProc(userRoutine)                           NewWidthHookUPP(userRoutine)
  613. #define NewTextWidthHookProc(userRoutine)                       NewTextWidthHookUPP(userRoutine)
  614. #define NewNWidthHookProc(userRoutine)                          NewNWidthHookUPP(userRoutine)
  615. #define NewDrawHookProc(userRoutine)                            NewDrawHookUPP(userRoutine)
  616. #define NewHitTestHookProc(userRoutine)                         NewHitTestHookUPP(userRoutine)
  617. #define NewTEFindWordProc(userRoutine)                          NewTEFindWordUPP(userRoutine)
  618. #define NewTERecalcProc(userRoutine)                            NewTERecalcUPP(userRoutine)
  619. #define NewTEDoTextProc(userRoutine)                            NewTEDoTextUPP(userRoutine)
  620. #define NewTEClickLoopProc(userRoutine)                         NewTEClickLoopUPP(userRoutine)
  621. #define NewWordBreakProc(userRoutine)                           NewWordBreakUPP(userRoutine)
  622. #define CallHighHookProc(userRoutine, r, pTE)                   InvokeHighHookUPP(r, pTE, userRoutine)
  623. #define CallEOLHookProc(userRoutine, theChar, pTE, hTE)         InvokeEOLHookUPP(theChar, pTE, hTE, userRoutine)
  624. #define CallCaretHookProc(userRoutine, r, pTE)                  InvokeCaretHookUPP(r, pTE, userRoutine)
  625. #define CallWidthHookProc(userRoutine, textLen, textOffset, textBufferPtr, pTE, hTE) InvokeWidthHookUPP(textLen, textOffset, textBufferPtr, pTE, hTE, userRoutine)
  626. #define CallTextWidthHookProc(userRoutine, textLen, textOffset, textBufferPtr, pTE, hTE) InvokeTextWidthHookUPP(textLen, textOffset, textBufferPtr, pTE, hTE, userRoutine)
  627. #define CallNWidthHookProc(userRoutine, styleRunLen, styleRunOffset, slop, direction, textBufferPtr, lineStart, pTE, hTE) InvokeNWidthHookUPP(styleRunLen, styleRunOffset, slop, direction, textBufferPtr, lineStart, pTE, hTE, userRoutine)
  628. #define CallDrawHookProc(userRoutine, textOffset, drawLen, textBufferPtr, pTE, hTE) InvokeDrawHookUPP(textOffset, drawLen, textBufferPtr, pTE, hTE, userRoutine)
  629. #define CallHitTestHookProc(userRoutine, styleRunLen, styleRunOffset, slop, textBufferPtr, pTE, hTE, pixelWidth, charOffset, pixelInChar) InvokeHitTestHookUPP(styleRunLen, styleRunOffset, slop, textBufferPtr, pTE, hTE, pixelWidth, charOffset, pixelInChar, userRoutine)
  630. #define CallTEFindWordProc(userRoutine, currentPos, caller, pTE, hTE, wordStart, wordEnd) InvokeTEFindWordUPP(currentPos, caller, pTE, hTE, wordStart, wordEnd, userRoutine)
  631. #define CallTERecalcProc(userRoutine, pTE, changeLength, lineStart, firstChar, lastChar) InvokeTERecalcUPP(pTE, changeLength, lineStart, firstChar, lastChar, userRoutine)
  632. #define CallTEDoTextProc(userRoutine, pTE, firstChar, lastChar, selector, currentGrafPort, charPosition) InvokeTEDoTextUPP(pTE, firstChar, lastChar, selector, currentGrafPort, charPosition, userRoutine)
  633. #define CallTEClickLoopProc(userRoutine, pTE)                   InvokeTEClickLoopUPP(pTE, userRoutine)
  634. #define CallWordBreakProc(userRoutine, text, charPos)           InvokeWordBreakUPP(text, charPos, userRoutine)
  635. enum {
  636.                                                                 /* feature bit 4 for TEFeatureFlag no longer in use */
  637.     teFUseTextServices          = 4                             /*00010000b */
  638. };
  639. #if OLDROUTINENAMES
  640. /* action for the old C "bit (un)set" interface, TEFeatureFlag */
  641. #define TEBitClear  teBitClear
  642. #define TEBitSet    teBitSet
  643. #define TEBitTest   teBitTest
  644. #define teFAutoScr  teFAutoScroll
  645. #define toglBit     toggleBit
  646. #endif  /* OLDROUTINENAMES */
  647. EXTERN_API( Handle )
  648. TEScrapHandle                   (void)                                                      TWOWORDINLINE(0x2EB8, 0x0AB4);
  649. EXTERN_API( long )
  650. TEGetScrapLength                (void);
  651. #if TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  652. #define TEGetScrapLength() ((long) * (unsigned short *) 0x0AB0)
  653. #endif
  654. #if CALL_NOT_IN_CARBON
  655. EXTERN_API( void )
  656. TEInit                          (void)                                                      ONEWORDINLINE(0xA9CC);
  657. #endif  /* CALL_NOT_IN_CARBON */
  658. EXTERN_API( TEHandle )
  659. TENew                           (const Rect *           destRect,
  660.                                  const Rect *           viewRect)                           ONEWORDINLINE(0xA9D2);
  661. EXTERN_API( void )
  662. TEDispose                       (TEHandle               hTE)                                ONEWORDINLINE(0xA9CD);
  663. EXTERN_API( void )
  664. TESetText                       (const void *           text,
  665.                                  long                   length,
  666.                                  TEHandle               hTE)                                ONEWORDINLINE(0xA9CF);
  667. EXTERN_API( CharsHandle )
  668. TEGetText                       (TEHandle               hTE)                                ONEWORDINLINE(0xA9CB);
  669. EXTERN_API( void )
  670. TEIdle                          (TEHandle               hTE)                                ONEWORDINLINE(0xA9DA);
  671. EXTERN_API( void )
  672. TESetSelect                     (long                   selStart,
  673.                                  long                   selEnd,
  674.                                  TEHandle               hTE)                                ONEWORDINLINE(0xA9D1);
  675. EXTERN_API( void )
  676. TEActivate                      (TEHandle               hTE)                                ONEWORDINLINE(0xA9D8);
  677. EXTERN_API( void )
  678. TEDeactivate                    (TEHandle               hTE)                                ONEWORDINLINE(0xA9D9);
  679. EXTERN_API( void )
  680. TEKey                           (CharParameter          key,
  681.                                  TEHandle               hTE)                                ONEWORDINLINE(0xA9DC);
  682. EXTERN_API( void )
  683. TECut                           (TEHandle               hTE)                                ONEWORDINLINE(0xA9D6);
  684. EXTERN_API( void )
  685. TECopy                          (TEHandle               hTE)                                ONEWORDINLINE(0xA9D5);
  686. EXTERN_API( void )
  687. TEPaste                         (TEHandle               hTE)                                ONEWORDINLINE(0xA9DB);
  688. EXTERN_API( void )
  689. TEDelete                        (TEHandle               hTE)                                ONEWORDINLINE(0xA9D7);
  690. EXTERN_API( void )
  691. TEInsert                        (const void *           text,
  692.                                  long                   length,
  693.                                  TEHandle               hTE)                                ONEWORDINLINE(0xA9DE);
  694. EXTERN_API( void )
  695. TESetAlignment                  (short                  just,
  696.                                  TEHandle               hTE)                                ONEWORDINLINE(0xA9DF);
  697. EXTERN_API( void )
  698. TEUpdate                        (const Rect *           rUpdate,
  699.                                  TEHandle               hTE)                                ONEWORDINLINE(0xA9D3);
  700. EXTERN_API( void )
  701. TETextBox                       (const void *           text,
  702.                                  long                   length,
  703.                                  const Rect *           box,
  704.                                  short                  just)                               ONEWORDINLINE(0xA9CE);
  705. EXTERN_API( void )
  706. TEScroll                        (short                  dh,
  707.                                  short                  dv,
  708.                                  TEHandle               hTE)                                ONEWORDINLINE(0xA9DD);
  709. EXTERN_API( void )
  710. TESelView                       (TEHandle               hTE)                                ONEWORDINLINE(0xA811);
  711. EXTERN_API( void )
  712. TEPinScroll                     (short                  dh,
  713.                                  short                  dv,
  714.                                  TEHandle               hTE)                                ONEWORDINLINE(0xA812);
  715. EXTERN_API( void )
  716. TEAutoView                      (Boolean                fAuto,
  717.                                  TEHandle               hTE)                                ONEWORDINLINE(0xA813);
  718. EXTERN_API( void )
  719. TECalText                       (TEHandle               hTE)                                ONEWORDINLINE(0xA9D0);
  720. EXTERN_API( short )
  721. TEGetOffset                     (Point                  pt,
  722.                                  TEHandle               hTE)                                ONEWORDINLINE(0xA83C);
  723. EXTERN_API( Point )
  724. TEGetPoint                      (short                  offset,
  725.                                  TEHandle               hTE)                                THREEWORDINLINE(0x3F3C, 0x0008, 0xA83D);
  726. EXTERN_API( void )
  727. TEClick                         (Point                  pt,
  728.                                  Boolean                fExtend,
  729.                                  TEHandle               h)                                  ONEWORDINLINE(0xA9D4);
  730. EXTERN_API( TEHandle )
  731. TEStyleNew                      (const Rect *           destRect,
  732.                                  const Rect *           viewRect)                           ONEWORDINLINE(0xA83E);
  733. EXTERN_API( void )
  734. TESetStyleHandle                (TEStyleHandle          theHandle,
  735.                                  TEHandle               hTE)                                THREEWORDINLINE(0x3F3C, 0x0005, 0xA83D);
  736. EXTERN_API( TEStyleHandle )
  737. TEGetStyleHandle                (TEHandle               hTE)                                THREEWORDINLINE(0x3F3C, 0x0004, 0xA83D);
  738. EXTERN_API( void )
  739. TEGetStyle                      (short                  offset,
  740.                                  TextStyle *            theStyle,
  741.                                  short *                lineHeight,
  742.                                  short *                fontAscent,
  743.                                  TEHandle               hTE)                                THREEWORDINLINE(0x3F3C, 0x0003, 0xA83D);
  744. EXTERN_API( void )
  745. TEStylePaste                    (TEHandle               hTE)                                THREEWORDINLINE(0x3F3C, 0x0000, 0xA83D);
  746. EXTERN_API( void )
  747. TESetStyle                      (short                  mode,
  748.                                  const TextStyle *      newStyle,
  749.                                  Boolean                fRedraw,
  750.                                  TEHandle               hTE)                                THREEWORDINLINE(0x3F3C, 0x0001, 0xA83D);
  751. EXTERN_API( void )
  752. TEReplaceStyle                  (short                  mode,
  753.                                  const TextStyle *      oldStyle,
  754.                                  const TextStyle *      newStyle,
  755.                                  Boolean                fRedraw,
  756.                                  TEHandle               hTE)                                THREEWORDINLINE(0x3F3C, 0x0002, 0xA83D);
  757. EXTERN_API( StScrpHandle )
  758. TEGetStyleScrapHandle           (TEHandle               hTE)                                THREEWORDINLINE(0x3F3C, 0x0006, 0xA83D);
  759. EXTERN_API( void )
  760. TEStyleInsert                   (const void *           text,
  761.                                  long                   length,
  762.                                  StScrpHandle           hST,
  763.                                  TEHandle               hTE)                                THREEWORDINLINE(0x3F3C, 0x0007, 0xA83D);
  764. EXTERN_API( long )
  765. TEGetHeight                     (long                   endLine,
  766.                                  long                   startLine,
  767.                                  TEHandle               hTE)                                THREEWORDINLINE(0x3F3C, 0x0009, 0xA83D);
  768. EXTERN_API( Boolean )
  769. TEContinuousStyle               (short *                mode,
  770.                                  TextStyle *            aStyle,
  771.                                  TEHandle               hTE)                                THREEWORDINLINE(0x3F3C, 0x000A, 0xA83D);
  772. EXTERN_API( void )
  773. TEUseStyleScrap                 (long                   rangeStart,
  774.                                  long                   rangeEnd,
  775.                                  StScrpHandle           newStyles,
  776.                                  Boolean                fRedraw,
  777.                                  TEHandle               hTE)                                THREEWORDINLINE(0x3F3C, 0x000B, 0xA83D);
  778. EXTERN_API( void )
  779. TECustomHook                    (TEIntHook              which,
  780.                                  UniversalProcPtr *     addr,
  781.                                  TEHandle               hTE)                                THREEWORDINLINE(0x3F3C, 0x000C, 0xA83D);
  782. EXTERN_API( long )
  783. TENumStyles                     (long                   rangeStart,
  784.                                  long                   rangeEnd,
  785.                                  TEHandle               hTE)                                THREEWORDINLINE(0x3F3C, 0x000D, 0xA83D);
  786. EXTERN_API( short )
  787. TEFeatureFlag                   (short                  feature,
  788.                                  short                  action,
  789.                                  TEHandle               hTE)                                THREEWORDINLINE(0x3F3C, 0x000E, 0xA83D);
  790. EXTERN_API( OSErr )
  791. TEGetHiliteRgn                  (RgnHandle              region,
  792.                                  TEHandle               hTE)                                THREEWORDINLINE(0x3F3C, 0x000F, 0xA83D);
  793. EXTERN_API( void )
  794. TESetScrapLength                (long                   length);
  795. EXTERN_API( OSErr )
  796. TEFromScrap                     (void);
  797. EXTERN_API( OSErr )
  798. TEToScrap                       (void);
  799. EXTERN_API( void )
  800. TESetClickLoop                  (TEClickLoopUPP         clikProc,
  801.                                  TEHandle               hTE);
  802. #if CALL_NOT_IN_CARBON
  803. #if CALL_NOT_IN_CARBON
  804. EXTERN_API( void )
  805. TESetWordBreak                  (WordBreakUPP           wBrkProc,
  806.                                  TEHandle               hTE);
  807. #endif  /* CALL_NOT_IN_CARBON */
  808. #endif  /* CALL_NOT_IN_CARBON */
  809. EXTERN_API( TEDoTextUPP )
  810. TEGetDoTextHook                 (void);
  811. EXTERN_API( void )
  812. TESetDoTextHook                 (TEDoTextUPP            value);
  813. EXTERN_API( TERecalcUPP )
  814. TEGetRecalcHook                 (void);
  815. EXTERN_API( void )
  816. TESetRecalcHook                 (TERecalcUPP            value);
  817. EXTERN_API( TEFindWordUPP )
  818. TEGetFindWordHook               (void);
  819. EXTERN_API( void )
  820. TESetFindWordHook               (TEFindWordUPP          value);
  821. EXTERN_API( Handle )
  822. TEGetScrapHandle                (void);
  823. EXTERN_API( void )
  824. TESetScrapHandle                (Handle                 value);
  825. #if CALL_NOT_IN_CARBON
  826. EXTERN_API_C( void )
  827. teclick                         (Point *                pt,
  828.                                  Boolean                fExtend,
  829.                                  TEHandle               h);
  830. #endif  /* CALL_NOT_IN_CARBON */
  831. #if OLDROUTINENAMES
  832. #define TESetJust(just, hTE) TESetAlignment(just, hTE)
  833. #define TextBox(text, length, box, just) TETextBox(text, length, box, just)
  834. #define TEStylNew(destRect, viewRect) TEStyleNew(destRect, viewRect)
  835. #define SetStylHandle(theHandle, hTE) TESetStyleHandle(theHandle, hTE)
  836. #define SetStyleHandle(theHandle, hTE) TESetStyleHandle (theHandle, hTE)
  837. #define GetStylHandle(hTE) TEGetStyleHandle(hTE)
  838. #define GetStyleHandle(hTE) TEGetStyleHandle(hTE)
  839. #define TEStylPaste(hTE) TEStylePaste(hTE)
  840. #define GetStylScrap(hTE) TEGetStyleScrapHandle(hTE)
  841. #define GetStyleScrap(hTE) TEGetStyleScrapHandle(hTE)
  842. #define SetStylScrap(rangeStart, rangeEnd, newStyles, redraw, hTE) TEUseStyleScrap(rangeStart, rangeEnd, newStyles, redraw, hTE)
  843. #define SetStyleScrap(rangeStart, rangeEnd, newStyles, redraw, hTE)  TEUseStyleScrap(rangeStart, rangeEnd, newStyles, redraw, hTE)
  844. #define TEStylInsert(text, length, hST, hTE) TEStyleInsert(text, length, hST, hTE)
  845. #define TESetScrapLen(length) TESetScrapLength(length)
  846. #define TEGetScrapLen() TEGetScrapLength()
  847. #define SetClikLoop(clikProc, hTE) TESetClickLoop(clikProc, hTE)
  848. #define SetWordBreak(wBrkProc, hTE) TESetWordBreak(wBrkProc, hTE)
  849. #endif  /* OLDROUTINENAMES */
  850. #if PRAGMA_STRUCT_ALIGN
  851.     #pragma options align=reset
  852. #elif PRAGMA_STRUCT_PACKPUSH
  853.     #pragma pack(pop)
  854. #elif PRAGMA_STRUCT_PACK
  855.     #pragma pack()
  856. #endif
  857. #ifdef PRAGMA_IMPORT_OFF
  858. #pragma import off
  859. #elif PRAGMA_IMPORT
  860. #pragma import reset
  861. #endif
  862. #ifdef __cplusplus
  863. }
  864. #endif
  865. #endif /* __TEXTEDIT__ */