TSMTE.pas 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. {
  2. File: HIToolbox/TSMTE.h
  3. Contains: Text Services Managerfor TextEdit Interfaces. All Textedit functions as well all functions in
  4. Version: HIToolbox-219.4.81~2
  5. Copyright: © 1991-2005 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://www.freepascal.org/bugs.html
  9. }
  10. { Pascal Translation Updated: Peter N Lewis, <[email protected]>, August 2005 }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit TSMTE;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,TextEdit,Dialogs,AppleEvents,TextServices;
  92. {****************************************************************************************************************
  93. All Textedit functions as well all functions in this file are deprecated for Mac OS 10.4. The Multilingual Text
  94. Engine (MLTE) API is recommended instead. MLTE support for inline input is built-in so there is no need for an
  95. API parallel to TSMTE on Mac OS X. Please see MacTextEditor.h file for a description of the MLTE API.
  96. *****************************************************************************************************************}
  97. {$ALIGN MAC68K}
  98. { signature, interface types}
  99. const
  100. kTSMTESignature = $746D5445 (* 'tmTE' *);
  101. kTSMTEInterfaceType = kTSMTEDocumentInterfaceType;
  102. {
  103. In Carbon, since DialogRef is opaque, the TSMDialogRecord is removed.
  104. Only one kind of TSMTE dialog remains, with extended data managed by TSMTE.
  105. Use kTSMTESignature for the dialog refCon, and use the accessors below,
  106. i.e. GetTSMTEDialogTSMTERecHandle, to get at the old TSMDialogRecord info.
  107. }
  108. { update flag for TSMTERec}
  109. const
  110. kTSMTEAutoScroll = 1;
  111. { callback procedure definitions}
  112. type
  113. TSMTEPreUpdateProcPtr = procedure( textH: TEHandle; refCon: SInt32 );
  114. TSMTEPostUpdateProcPtr = procedure( textH: TEHandle; fixLen: SInt32; inputAreaStart: SInt32; inputAreaEnd: SInt32; pinStart: SInt32; pinEnd: SInt32; refCon: SInt32 );
  115. TSMTEPreUpdateUPP = TSMTEPreUpdateProcPtr;
  116. TSMTEPostUpdateUPP = TSMTEPostUpdateProcPtr;
  117. { data types}
  118. type
  119. TSMTERec = record
  120. textH: TEHandle;
  121. preUpdateProc: TSMTEPreUpdateUPP;
  122. postUpdateProc: TSMTEPostUpdateUPP;
  123. updateFlag: SInt32;
  124. refCon: SInt32;
  125. end;
  126. TSMTERecPtr = ^TSMTERec;
  127. TSMTERecHandle = ^TSMTERecPtr;
  128. {
  129. * NewTSMTEPreUpdateUPP()
  130. *
  131. * Availability:
  132. * Mac OS X: in version 10.0 and later in Carbon.framework
  133. * CarbonLib: in CarbonLib 1.0 and later
  134. * Non-Carbon CFM: available as macro/inline
  135. }
  136. function NewTSMTEPreUpdateUPP( userRoutine: TSMTEPreUpdateProcPtr ): TSMTEPreUpdateUPP; external name '_NewTSMTEPreUpdateUPP';
  137. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  138. {
  139. * NewTSMTEPostUpdateUPP()
  140. *
  141. * Availability:
  142. * Mac OS X: in version 10.0 and later in Carbon.framework
  143. * CarbonLib: in CarbonLib 1.0 and later
  144. * Non-Carbon CFM: available as macro/inline
  145. }
  146. function NewTSMTEPostUpdateUPP( userRoutine: TSMTEPostUpdateProcPtr ): TSMTEPostUpdateUPP; external name '_NewTSMTEPostUpdateUPP';
  147. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  148. {
  149. * DisposeTSMTEPreUpdateUPP()
  150. *
  151. * Availability:
  152. * Mac OS X: in version 10.0 and later in Carbon.framework
  153. * CarbonLib: in CarbonLib 1.0 and later
  154. * Non-Carbon CFM: available as macro/inline
  155. }
  156. procedure DisposeTSMTEPreUpdateUPP( userUPP: TSMTEPreUpdateUPP ); external name '_DisposeTSMTEPreUpdateUPP';
  157. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  158. {
  159. * DisposeTSMTEPostUpdateUPP()
  160. *
  161. * Availability:
  162. * Mac OS X: in version 10.0 and later in Carbon.framework
  163. * CarbonLib: in CarbonLib 1.0 and later
  164. * Non-Carbon CFM: available as macro/inline
  165. }
  166. procedure DisposeTSMTEPostUpdateUPP( userUPP: TSMTEPostUpdateUPP ); external name '_DisposeTSMTEPostUpdateUPP';
  167. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  168. {
  169. * InvokeTSMTEPreUpdateUPP()
  170. *
  171. * Availability:
  172. * Mac OS X: in version 10.0 and later in Carbon.framework
  173. * CarbonLib: in CarbonLib 1.0 and later
  174. * Non-Carbon CFM: available as macro/inline
  175. }
  176. procedure InvokeTSMTEPreUpdateUPP( textH: TEHandle; refCon: SInt32; userUPP: TSMTEPreUpdateUPP ); external name '_InvokeTSMTEPreUpdateUPP';
  177. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  178. {
  179. * InvokeTSMTEPostUpdateUPP()
  180. *
  181. * Availability:
  182. * Mac OS X: in version 10.0 and later in Carbon.framework
  183. * CarbonLib: in CarbonLib 1.0 and later
  184. * Non-Carbon CFM: available as macro/inline
  185. }
  186. procedure InvokeTSMTEPostUpdateUPP( textH: TEHandle; fixLen: SInt32; inputAreaStart: SInt32; inputAreaEnd: SInt32; pinStart: SInt32; pinEnd: SInt32; refCon: SInt32; userUPP: TSMTEPostUpdateUPP ); external name '_InvokeTSMTEPostUpdateUPP';
  187. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  188. {
  189. * IsTSMTEDialog() *** DEPRECATED ***
  190. *
  191. * Mac OS X threading:
  192. * Not thread safe
  193. *
  194. * Availability:
  195. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  196. * CarbonLib: in CarbonLib 1.0.2 and later
  197. * Non-Carbon CFM: in CarbonAccessors.o 1.0.2 and later
  198. }
  199. function IsTSMTEDialog( dialog: DialogRef ): Boolean; external name '_IsTSMTEDialog';
  200. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  201. { Getters }
  202. {
  203. * GetTSMTEDialogDocumentID() *** DEPRECATED ***
  204. *
  205. * Mac OS X threading:
  206. * Not thread safe
  207. *
  208. * Availability:
  209. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  210. * CarbonLib: in CarbonLib 1.0.2 and later
  211. * Non-Carbon CFM: in CarbonAccessors.o 1.0.2 and later
  212. }
  213. function GetTSMTEDialogDocumentID( dialog: DialogRef ): TSMDocumentID; external name '_GetTSMTEDialogDocumentID';
  214. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  215. {
  216. * GetTSMTEDialogTSMTERecHandle() *** DEPRECATED ***
  217. *
  218. * Mac OS X threading:
  219. * Not thread safe
  220. *
  221. * Availability:
  222. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  223. * CarbonLib: in CarbonLib 1.0.2 and later
  224. * Non-Carbon CFM: in CarbonAccessors.o 1.0.2 and later
  225. }
  226. function GetTSMTEDialogTSMTERecHandle( dialog: DialogRef ): TSMTERecHandle; external name '_GetTSMTEDialogTSMTERecHandle';
  227. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  228. { Setters }
  229. {
  230. * SetTSMTEDialogDocumentID() *** DEPRECATED ***
  231. *
  232. * Mac OS X threading:
  233. * Not thread safe
  234. *
  235. * Availability:
  236. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  237. * CarbonLib: in CarbonLib 1.0.2 and later
  238. * Non-Carbon CFM: in CarbonAccessors.o 1.0.2 and later
  239. }
  240. procedure SetTSMTEDialogDocumentID( dialog: DialogRef; documentID: TSMDocumentID ); external name '_SetTSMTEDialogDocumentID';
  241. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  242. {
  243. * SetTSMTEDialogTSMTERecHandle() *** DEPRECATED ***
  244. *
  245. * Mac OS X threading:
  246. * Not thread safe
  247. *
  248. * Availability:
  249. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  250. * CarbonLib: in CarbonLib 1.0.2 and later
  251. * Non-Carbon CFM: in CarbonAccessors.o 1.0.2 and later
  252. }
  253. procedure SetTSMTEDialogTSMTERecHandle( dialog: DialogRef; tsmteRecHandle_: TSMTERecHandle ); external name '_SetTSMTEDialogTSMTERecHandle';
  254. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  255. end.