TypeSelect.pas 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. {
  2. File: HIToolbox/TypeSelect.h
  3. Contains: TypeSelect Utilties
  4. Version: HIToolbox-219.4.81~2
  5. Copyright: © 2000-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 TypeSelect;
  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,Events;
  92. {$ALIGN MAC68K}
  93. type
  94. TSCode = SInt16;
  95. const
  96. tsPreviousSelectMode = -1;
  97. tsNormalSelectMode = 0;
  98. tsNextSelectMode = 1;
  99. type
  100. TypeSelectRecordPtr = ^TypeSelectRecord;
  101. TypeSelectRecord = record
  102. tsrLastKeyTime: UInt32;
  103. tsrScript: ScriptCode;
  104. tsrKeyStrokes: Str63;
  105. end;
  106. type
  107. IndexToStringProcPtr = function( item: SInt16; var itemsScript: ScriptCode; var itemsStringPtr: StringPtr; yourDataPtr: UnivPtr ): Boolean;
  108. IndexToStringUPP = IndexToStringProcPtr;
  109. {
  110. * TypeSelectClear() *** DEPRECATED ***
  111. *
  112. * Deprecated:
  113. * use CFStringUppercase instead.
  114. *
  115. * Discussion:
  116. * This function is no longer recommended. Please use
  117. * CFStringUppercase instead.
  118. *
  119. * Mac OS X threading:
  120. * Not thread safe
  121. *
  122. * Availability:
  123. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  124. * CarbonLib: in CarbonLib 1.0 and later
  125. * Non-Carbon CFM: not available
  126. }
  127. procedure TypeSelectClear( var tsr: TypeSelectRecord ); external name '_TypeSelectClear';
  128. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  129. {
  130. Long ago the implementation of TypeSelectNewKey had a bug that
  131. required the high word of D0 to be zero or the function did not work.
  132. Although fixed now, we are continuing to clear the high word
  133. just in case someone tries to run on an older system.
  134. }
  135. {
  136. * TypeSelectNewKey() *** DEPRECATED ***
  137. *
  138. * Deprecated:
  139. * use UCTypeSelect instead.
  140. *
  141. * Discussion:
  142. * This function is no longer recommended. Please use UCTypeSelect
  143. * instead.
  144. *
  145. * Mac OS X threading:
  146. * Not thread safe
  147. *
  148. * Availability:
  149. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  150. * CarbonLib: in CarbonLib 1.0 and later
  151. * Non-Carbon CFM: not available
  152. }
  153. function TypeSelectNewKey( const (*var*) theEvent: EventRecord; var tsr: TypeSelectRecord ): Boolean; external name '_TypeSelectNewKey';
  154. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  155. {
  156. * TypeSelectFindItem() *** DEPRECATED ***
  157. *
  158. * Deprecated:
  159. * use UCTypeSelect instead.
  160. *
  161. * Discussion:
  162. * This function is no longer recommended. Please use UCTypeSelect
  163. * instead.
  164. *
  165. * Mac OS X threading:
  166. * Not thread safe
  167. *
  168. * Availability:
  169. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  170. * CarbonLib: in CarbonLib 1.0 and later
  171. * Non-Carbon CFM: not available
  172. }
  173. function TypeSelectFindItem( const (*var*) tsr: TypeSelectRecord; listSize: SInt16; selectMode: TSCode; getStringProc: IndexToStringUPP; yourDataPtr: UnivPtr ): SInt16; external name '_TypeSelectFindItem';
  174. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  175. {
  176. * TypeSelectCompare() *** DEPRECATED ***
  177. *
  178. * Deprecated:
  179. * use CFStringUppercase instead.
  180. *
  181. * Discussion:
  182. * This function is no longer recommended. Please use
  183. * CFStringUppercase instead.
  184. *
  185. * Mac OS X threading:
  186. * Not thread safe
  187. *
  188. * Availability:
  189. * Mac OS X: in version 10.0 and later in Carbon.framework but deprecated in 10.4
  190. * CarbonLib: in CarbonLib 1.0 and later
  191. * Non-Carbon CFM: not available
  192. }
  193. function TypeSelectCompare( const (*var*) tsr: TypeSelectRecord; testStringScript: ScriptCode; testStringPtr: StringPtr ): SInt16; external name '_TypeSelectCompare';
  194. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  195. {
  196. * NewIndexToStringUPP()
  197. *
  198. * Availability:
  199. * Mac OS X: in version 10.0 and later in Carbon.framework
  200. * CarbonLib: in CarbonLib 1.0 and later
  201. * Non-Carbon CFM: available as macro/inline
  202. }
  203. function NewIndexToStringUPP( userRoutine: IndexToStringProcPtr ): IndexToStringUPP; external name '_NewIndexToStringUPP';
  204. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  205. {
  206. * DisposeIndexToStringUPP()
  207. *
  208. * Availability:
  209. * Mac OS X: in version 10.0 and later in Carbon.framework
  210. * CarbonLib: in CarbonLib 1.0 and later
  211. * Non-Carbon CFM: available as macro/inline
  212. }
  213. procedure DisposeIndexToStringUPP( userUPP: IndexToStringUPP ); external name '_DisposeIndexToStringUPP';
  214. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  215. {
  216. * InvokeIndexToStringUPP()
  217. *
  218. * Availability:
  219. * Mac OS X: in version 10.0 and later in Carbon.framework
  220. * CarbonLib: in CarbonLib 1.0 and later
  221. * Non-Carbon CFM: available as macro/inline
  222. }
  223. function InvokeIndexToStringUPP( item: SInt16; var itemsScript: ScriptCode; var itemsStringPtr: StringPtr; yourDataPtr: UnivPtr; userUPP: IndexToStringUPP ): Boolean; external name '_InvokeIndexToStringUPP';
  224. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  225. end.