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

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       TSMTE.h
  3.  
  4.      Contains:   Text Services Managerfor TextEdit Interfaces.
  5.  
  6.      Version:    Technology: System 7.5
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1991-2001 Apple Technology, 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 __TSMTE__
  18. #define __TSMTE__
  19. #ifndef __TEXTEDIT__
  20. #include "TextEdit.h"
  21. #endif
  22. #ifndef __DIALOGS__
  23. #include "Dialogs.h"
  24. #endif
  25. #ifndef __APPLEEVENTS__
  26. #include "AppleEvents.h"
  27. #endif
  28. #ifndef __TEXTSERVICES__
  29. #include "TextServices.h"
  30. #endif
  31. #if PRAGMA_ONCE
  32. #pragma once
  33. #endif
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. #if PRAGMA_IMPORT
  38. #pragma import on
  39. #endif
  40. #if PRAGMA_STRUCT_ALIGN
  41.     #pragma options align=mac68k
  42. #elif PRAGMA_STRUCT_PACKPUSH
  43.     #pragma pack(push, 2)
  44. #elif PRAGMA_STRUCT_PACK
  45.     #pragma pack(2)
  46. #endif
  47. /* signature, interface types*/
  48. enum {
  49.     kTSMTESignature             = FOUR_CHAR_CODE('tmTE'),
  50.     kTSMTEInterfaceType         = FOUR_CHAR_CODE('tmTE'),
  51.     kTSMTEDialog                = FOUR_CHAR_CODE('tmDI')
  52. };
  53. /* update flag for TSMTERec*/
  54. enum {
  55.     kTSMTEAutoScroll            = 1
  56. };
  57. /* callback procedure definitions*/
  58. typedef CALLBACK_API( void , TSMTEPreUpdateProcPtr )(TEHandle textH, long refCon);
  59. typedef CALLBACK_API( void , TSMTEPostUpdateProcPtr )(TEHandle textH, long fixLen, long inputAreaStart, long inputAreaEnd, long pinStart, long pinEnd, long refCon);
  60. typedef STACK_UPP_TYPE(TSMTEPreUpdateProcPtr)                   TSMTEPreUpdateUPP;
  61. typedef STACK_UPP_TYPE(TSMTEPostUpdateProcPtr)                  TSMTEPostUpdateUPP;
  62. /* data types*/
  63. struct TSMTERec {
  64.     TEHandle                        textH;
  65.     TSMTEPreUpdateUPP               preUpdateProc;
  66.     TSMTEPostUpdateUPP              postUpdateProc;
  67.     long                            updateFlag;
  68.     long                            refCon;
  69. };
  70. typedef struct TSMTERec                 TSMTERec;
  71. typedef TSMTERec *                      TSMTERecPtr;
  72. typedef TSMTERecPtr *                   TSMTERecHandle;
  73. #if !OPAQUE_TOOLBOX_STRUCTS
  74. struct TSMDialogRecord {
  75.     DialogRecord                    fDialog;
  76.     TSMDocumentID                   fDocID;
  77.     TSMTERecHandle                  fTSMTERecH;
  78.     long                            fTSMTERsvd[3];              /* reserved*/
  79. };
  80. typedef struct TSMDialogRecord          TSMDialogRecord;
  81. typedef TSMDialogRecord *               TSMDialogPtr;
  82. typedef TSMDialogPtr                    TSMDialogPeek;
  83. #endif  /* !OPAQUE_TOOLBOX_STRUCTS */
  84. #if OPAQUE_UPP_TYPES
  85.     EXTERN_API(TSMTEPreUpdateUPP)
  86.     NewTSMTEPreUpdateUPP           (TSMTEPreUpdateProcPtr   userRoutine);
  87.     EXTERN_API(TSMTEPostUpdateUPP)
  88.     NewTSMTEPostUpdateUPP          (TSMTEPostUpdateProcPtr  userRoutine);
  89.     EXTERN_API(void)
  90.     DisposeTSMTEPreUpdateUPP       (TSMTEPreUpdateUPP       userUPP);
  91.     EXTERN_API(void)
  92.     DisposeTSMTEPostUpdateUPP      (TSMTEPostUpdateUPP      userUPP);
  93.     EXTERN_API(void)
  94.     InvokeTSMTEPreUpdateUPP        (TEHandle                textH,
  95.                                     long                    refCon,
  96.                                     TSMTEPreUpdateUPP       userUPP);
  97.     EXTERN_API(void)
  98.     InvokeTSMTEPostUpdateUPP       (TEHandle                textH,
  99.                                     long                    fixLen,
  100.                                     long                    inputAreaStart,
  101.                                     long                    inputAreaEnd,
  102.                                     long                    pinStart,
  103.                                     long                    pinEnd,
  104.                                     long                    refCon,
  105.                                     TSMTEPostUpdateUPP      userUPP);
  106. #else
  107.     enum { uppTSMTEPreUpdateProcInfo = 0x000003C0 };                /* pascal no_return_value Func(4_bytes, 4_bytes) */
  108.     enum { uppTSMTEPostUpdateProcInfo = 0x000FFFC0 };               /* pascal no_return_value Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  109.     #define NewTSMTEPreUpdateUPP(userRoutine)                       (TSMTEPreUpdateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTSMTEPreUpdateProcInfo, GetCurrentArchitecture())
  110.     #define NewTSMTEPostUpdateUPP(userRoutine)                      (TSMTEPostUpdateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTSMTEPostUpdateProcInfo, GetCurrentArchitecture())
  111.     #define DisposeTSMTEPreUpdateUPP(userUPP)                       DisposeRoutineDescriptor(userUPP)
  112.     #define DisposeTSMTEPostUpdateUPP(userUPP)                      DisposeRoutineDescriptor(userUPP)
  113.     #define InvokeTSMTEPreUpdateUPP(textH, refCon, userUPP)         CALL_TWO_PARAMETER_UPP((userUPP), uppTSMTEPreUpdateProcInfo, (textH), (refCon))
  114.     #define InvokeTSMTEPostUpdateUPP(textH, fixLen, inputAreaStart, inputAreaEnd, pinStart, pinEnd, refCon, userUPP)  CALL_SEVEN_PARAMETER_UPP((userUPP), uppTSMTEPostUpdateProcInfo, (textH), (fixLen), (inputAreaStart), (inputAreaEnd), (pinStart), (pinEnd), (refCon))
  115. #endif
  116. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  117. #define NewTSMTEPreUpdateProc(userRoutine)                      NewTSMTEPreUpdateUPP(userRoutine)
  118. #define NewTSMTEPostUpdateProc(userRoutine)                     NewTSMTEPostUpdateUPP(userRoutine)
  119. #define CallTSMTEPreUpdateProc(userRoutine, textH, refCon)      InvokeTSMTEPreUpdateUPP(textH, refCon, userRoutine)
  120. #define CallTSMTEPostUpdateProc(userRoutine, textH, fixLen, inputAreaStart, inputAreaEnd, pinStart, pinEnd, refCon) InvokeTSMTEPostUpdateUPP(textH, fixLen, inputAreaStart, inputAreaEnd, pinStart, pinEnd, refCon, userRoutine)
  121. #if ACCESSOR_CALLS_ARE_FUNCTIONS
  122. EXTERN_API( Boolean )
  123. IsTSMTEDialog                   (DialogPtr              dialog);
  124. /* Getters */
  125. EXTERN_API( TSMDocumentID )
  126. GetTSMTEDialogDocumentID        (DialogPtr              dialog);
  127. EXTERN_API( TSMTERecHandle )
  128. GetTSMTEDialogTSMTERecHandle    (DialogPtr              dialog);
  129. /* Setters */
  130. EXTERN_API( void )
  131. SetTSMTEDialogDocumentID        (DialogPtr              dialog,
  132.                                  TSMDocumentID          documentID);
  133. EXTERN_API( void )
  134. SetTSMTEDialogTSMTERecHandle    (DialogPtr              dialog,
  135.                                  TSMTERecHandle         tsmteRecHandle);
  136. #endif  /* ACCESSOR_CALLS_ARE_FUNCTIONS */
  137. #if PRAGMA_STRUCT_ALIGN
  138.     #pragma options align=reset
  139. #elif PRAGMA_STRUCT_PACKPUSH
  140.     #pragma pack(pop)
  141. #elif PRAGMA_STRUCT_PACK
  142.     #pragma pack()
  143. #endif
  144. #ifdef PRAGMA_IMPORT_OFF
  145. #pragma import off
  146. #elif PRAGMA_IMPORT
  147. #pragma import reset
  148. #endif
  149. #ifdef __cplusplus
  150. }
  151. #endif
  152. #endif /* __TSMTE__ */