home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / TSMTE.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-11  |  4.9 KB  |  178 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        TSMTE.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __TSMTE__
  18. #define __TSMTE__
  19.  
  20.  
  21. #ifndef __TEXTEDIT__
  22. #include <TextEdit.h>
  23. #endif
  24. /*    #include <Quickdraw.h>                                        */
  25. /*        #include <Types.h>                                        */
  26. /*            #include <ConditionalMacros.h>                        */
  27. /*        #include <MixedMode.h>                                    */
  28. /*        #include <QuickdrawText.h>                                */
  29.  
  30. #ifndef __DIALOGS__
  31. #include <Dialogs.h>
  32. #endif
  33. /*    #include <Errors.h>                                            */
  34. /*    #include <Memory.h>                                            */
  35. /*    #include <Windows.h>                                        */
  36. /*        #include <Events.h>                                        */
  37. /*            #include <OSUtils.h>                                */
  38. /*        #include <Controls.h>                                    */
  39. /*            #include <Menus.h>                                    */
  40.  
  41. #ifndef __APPLEEVENTS__
  42. #include <AppleEvents.h>
  43. #endif
  44. /*    #include <EPPC.h>                                            */
  45. /*        #include <PPCToolbox.h>                                    */
  46. /*            #include <AppleTalk.h>                                */
  47. /*        #include <Processes.h>                                    */
  48. /*            #include <Files.h>                                    */
  49. /*    #include <Notification.h>                                    */
  50.  
  51. #ifndef __TEXTSERVICES__
  52. #include <TextServices.h>
  53. #endif
  54. /*    #include <Components.h>                                        */
  55.  
  56. #ifdef __cplusplus
  57. extern "C" {
  58. #endif
  59.  
  60. #if GENERATINGPOWERPC
  61. #pragma options align=mac68k
  62. #endif
  63.  
  64. #ifdef __CFM68K__
  65. #pragma lib_export on
  66. #endif
  67.  
  68.  
  69. enum {
  70.     kTSMTESignature                = 'tmTE',
  71.     kTSMTEInterfaceType            = kTSMTESignature,
  72.     kTSMTEDialog                = 'tmDI'
  73. };
  74.  
  75. /* Gestalt*/
  76. enum {
  77.     gestaltTSMTEAttr            = kTSMTESignature,
  78.     gestaltTSMTEPresent            = 0,
  79.     gestaltTSMTE                = 0                                /* gestaltTSMTE is old name for gestaltTSMTEPresent */
  80. };
  81.  
  82. enum {
  83.     gestaltTSMTEVersion            = 'tmTV',
  84.     gestaltTSMTE1                = 0x100
  85. };
  86.  
  87. /* update flag for TSMTERec*/
  88. enum {
  89.     kTSMTEAutoScroll            = 1
  90. };
  91.  
  92. /* callback procedure definitions*/
  93. typedef pascal void (*TSMTEPreUpdateProcPtr)(TEHandle textH, long refCon);
  94. typedef pascal void (*TSMTEPostUpdateProcPtr)(TEHandle textH, long fixLen, long inputAreaStart, long inputAreaEnd, long pinStart, long pinEnd, long refCon);
  95.  
  96. #if GENERATINGCFM
  97. typedef UniversalProcPtr TSMTEPreUpdateUPP;
  98. typedef UniversalProcPtr TSMTEPostUpdateUPP;
  99. #else
  100. typedef TSMTEPreUpdateProcPtr TSMTEPreUpdateUPP;
  101. typedef TSMTEPostUpdateProcPtr TSMTEPostUpdateUPP;
  102. #endif
  103.  
  104. struct TSMTERec {
  105.     TEHandle                        textH;
  106.     TSMTEPreUpdateUPP                preUpdateProc;
  107.     TSMTEPostUpdateUPP                postUpdateProc;
  108.     long                            updateFlag;
  109.     long                            refCon;
  110. };
  111. typedef struct TSMTERec TSMTERec, *TSMTERecPtr, **TSMTERecHandle;
  112.  
  113. struct TSMDialogRecord {
  114.     DialogRecord                    fDialog;
  115.     TSMDocumentID                    fDocID;
  116.     TSMTERecHandle                    fTSMTERecH;
  117.     long                            fTSMTERsvd[3];                /* reserved*/
  118. };
  119. typedef struct TSMDialogRecord TSMDialogRecord, *TSMDialogPeek;
  120.  
  121.  
  122. #if GENERATINGCFM
  123. #else
  124. #endif
  125.  
  126. enum {
  127.     uppTSMTEPreUpdateProcInfo = kPascalStackBased
  128.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TEHandle)))
  129.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))),
  130.     uppTSMTEPostUpdateProcInfo = kPascalStackBased
  131.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TEHandle)))
  132.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  133.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
  134.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  135.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long)))
  136.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(long)))
  137.          | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(long)))
  138. };
  139.  
  140. #if GENERATINGCFM
  141. #define NewTSMTEPreUpdateProc(userRoutine)        \
  142.         (TSMTEPreUpdateUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTSMTEPreUpdateProcInfo, GetCurrentArchitecture())
  143. #define NewTSMTEPostUpdateProc(userRoutine)        \
  144.         (TSMTEPostUpdateUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTSMTEPostUpdateProcInfo, GetCurrentArchitecture())
  145. #else
  146. #define NewTSMTEPreUpdateProc(userRoutine)        \
  147.         ((TSMTEPreUpdateUPP) (userRoutine))
  148. #define NewTSMTEPostUpdateProc(userRoutine)        \
  149.         ((TSMTEPostUpdateUPP) (userRoutine))
  150. #endif
  151.  
  152. #if GENERATINGCFM
  153. #define CallTSMTEPreUpdateProc(userRoutine, textH, refCon)        \
  154.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTSMTEPreUpdateProcInfo, (textH), (refCon))
  155. #define CallTSMTEPostUpdateProc(userRoutine, textH, fixLen, inputAreaStart, inputAreaEnd, pinStart, pinEnd, refCon)        \
  156.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTSMTEPostUpdateProcInfo, (textH), (fixLen), (inputAreaStart), (inputAreaEnd), (pinStart), (pinEnd), (refCon))
  157. #else
  158. #define CallTSMTEPreUpdateProc(userRoutine, textH, refCon)        \
  159.         (*(userRoutine))((textH), (refCon))
  160. #define CallTSMTEPostUpdateProc(userRoutine, textH, fixLen, inputAreaStart, inputAreaEnd, pinStart, pinEnd, refCon)        \
  161.         (*(userRoutine))((textH), (fixLen), (inputAreaStart), (inputAreaEnd), (pinStart), (pinEnd), (refCon))
  162. #endif
  163.  
  164.  
  165. #ifdef __CFM68K__
  166. #pragma lib_export off
  167. #endif
  168.  
  169. #if GENERATINGPOWERPC
  170. #pragma options align=reset
  171. #endif
  172.  
  173. #ifdef __cplusplus
  174. }
  175. #endif
  176.  
  177. #endif /* __TSMTE__ */
  178.