TextServices.pas 80 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068
  1. {
  2. File: HIToolbox/TextServices.h
  3. Contains: Text Services Manager Interfaces.
  4. Version: HIToolbox-437~1
  5. Copyright: © 1991-2008 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. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  12. {
  13. Modified for use with Free Pascal
  14. Version 308
  15. Please report any bugs to <[email protected]>
  16. }
  17. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  18. {$mode macpas}
  19. {$packenum 1}
  20. {$macro on}
  21. {$inline on}
  22. {$calling mwpascal}
  23. unit TextServices;
  24. interface
  25. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  26. {$setc GAP_INTERFACES_VERSION := $0308}
  27. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  28. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  29. {$endc}
  30. {$ifc defined CPUPOWERPC and defined CPUI386}
  31. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  32. {$endc}
  33. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  34. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  35. {$endc}
  36. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  37. {$setc __ppc__ := 1}
  38. {$elsec}
  39. {$setc __ppc__ := 0}
  40. {$endc}
  41. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  42. {$setc __ppc64__ := 1}
  43. {$elsec}
  44. {$setc __ppc64__ := 0}
  45. {$endc}
  46. {$ifc not defined __i386__ and defined CPUI386}
  47. {$setc __i386__ := 1}
  48. {$elsec}
  49. {$setc __i386__ := 0}
  50. {$endc}
  51. {$ifc not defined __x86_64__ and defined CPUX86_64}
  52. {$setc __x86_64__ := 1}
  53. {$elsec}
  54. {$setc __x86_64__ := 0}
  55. {$endc}
  56. {$ifc not defined __arm__ and defined CPUARM}
  57. {$setc __arm__ := 1}
  58. {$elsec}
  59. {$setc __arm__ := 0}
  60. {$endc}
  61. {$ifc defined cpu64}
  62. {$setc __LP64__ := 1}
  63. {$elsec}
  64. {$setc __LP64__ := 0}
  65. {$endc}
  66. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  67. {$error Conflicting definitions for __ppc__ and __i386__}
  68. {$endc}
  69. {$ifc defined __ppc__ and __ppc__}
  70. {$setc TARGET_CPU_PPC := TRUE}
  71. {$setc TARGET_CPU_PPC64 := FALSE}
  72. {$setc TARGET_CPU_X86 := FALSE}
  73. {$setc TARGET_CPU_X86_64 := FALSE}
  74. {$setc TARGET_CPU_ARM := FALSE}
  75. {$setc TARGET_OS_MAC := TRUE}
  76. {$setc TARGET_OS_IPHONE := FALSE}
  77. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  78. {$elifc defined __ppc64__ and __ppc64__}
  79. {$setc TARGET_CPU_PPC := FALSE}
  80. {$setc TARGET_CPU_PPC64 := TRUE}
  81. {$setc TARGET_CPU_X86 := FALSE}
  82. {$setc TARGET_CPU_X86_64 := FALSE}
  83. {$setc TARGET_CPU_ARM := FALSE}
  84. {$setc TARGET_OS_MAC := TRUE}
  85. {$setc TARGET_OS_IPHONE := FALSE}
  86. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  87. {$elifc defined __i386__ and __i386__}
  88. {$setc TARGET_CPU_PPC := FALSE}
  89. {$setc TARGET_CPU_PPC64 := FALSE}
  90. {$setc TARGET_CPU_X86 := TRUE}
  91. {$setc TARGET_CPU_X86_64 := FALSE}
  92. {$setc TARGET_CPU_ARM := FALSE}
  93. {$ifc defined(iphonesim)}
  94. {$setc TARGET_OS_MAC := FALSE}
  95. {$setc TARGET_OS_IPHONE := TRUE}
  96. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  97. {$elsec}
  98. {$setc TARGET_OS_MAC := TRUE}
  99. {$setc TARGET_OS_IPHONE := FALSE}
  100. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  101. {$endc}
  102. {$elifc defined __x86_64__ and __x86_64__}
  103. {$setc TARGET_CPU_PPC := FALSE}
  104. {$setc TARGET_CPU_PPC64 := FALSE}
  105. {$setc TARGET_CPU_X86 := FALSE}
  106. {$setc TARGET_CPU_X86_64 := TRUE}
  107. {$setc TARGET_CPU_ARM := FALSE}
  108. {$setc TARGET_OS_MAC := TRUE}
  109. {$setc TARGET_OS_IPHONE := FALSE}
  110. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  111. {$elifc defined __arm__ and __arm__}
  112. {$setc TARGET_CPU_PPC := FALSE}
  113. {$setc TARGET_CPU_PPC64 := FALSE}
  114. {$setc TARGET_CPU_X86 := FALSE}
  115. {$setc TARGET_CPU_X86_64 := FALSE}
  116. {$setc TARGET_CPU_ARM := TRUE}
  117. { will require compiler define when/if other Apple devices with ARM cpus ship }
  118. {$setc TARGET_OS_MAC := FALSE}
  119. {$setc TARGET_OS_IPHONE := TRUE}
  120. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  121. {$elsec}
  122. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
  123. {$endc}
  124. {$ifc defined __LP64__ and __LP64__ }
  125. {$setc TARGET_CPU_64 := TRUE}
  126. {$elsec}
  127. {$setc TARGET_CPU_64 := FALSE}
  128. {$endc}
  129. {$ifc defined FPC_BIG_ENDIAN}
  130. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  131. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  132. {$elifc defined FPC_LITTLE_ENDIAN}
  133. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  134. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  135. {$elsec}
  136. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  137. {$endc}
  138. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  139. {$setc CALL_NOT_IN_CARBON := FALSE}
  140. {$setc OLDROUTINENAMES := FALSE}
  141. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  142. {$setc OPAQUE_UPP_TYPES := TRUE}
  143. {$setc OTCARBONAPPLICATION := TRUE}
  144. {$setc OTKERNEL := FALSE}
  145. {$setc PM_USE_SESSION_APIS := TRUE}
  146. {$setc TARGET_API_MAC_CARBON := TRUE}
  147. {$setc TARGET_API_MAC_OS8 := FALSE}
  148. {$setc TARGET_API_MAC_OSX := TRUE}
  149. {$setc TARGET_CARBON := TRUE}
  150. {$setc TARGET_CPU_68K := FALSE}
  151. {$setc TARGET_CPU_MIPS := FALSE}
  152. {$setc TARGET_CPU_SPARC := FALSE}
  153. {$setc TARGET_OS_UNIX := FALSE}
  154. {$setc TARGET_OS_WIN32 := FALSE}
  155. {$setc TARGET_RT_MAC_68881 := FALSE}
  156. {$setc TARGET_RT_MAC_CFM := FALSE}
  157. {$setc TARGET_RT_MAC_MACHO := TRUE}
  158. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  159. {$setc TYPE_BOOL := FALSE}
  160. {$setc TYPE_EXTENDED := FALSE}
  161. {$setc TYPE_LONGLONG := TRUE}
  162. uses MacTypes,QuickdrawTypes,ConditionalMacros,CFBase,CarbonEventsCore,ATSTypes,CFArray,CFDictionary,Events,Menus,AEDataModel,AERegistry,AEInteraction,Components,CarbonEvents;
  163. {$endc} {not MACOSALLINCLUDE}
  164. {$ifc TARGET_OS_MAC}
  165. {$ALIGN MAC68K}
  166. const
  167. kTextService = FourCharCode('tsvc'); { component type for the component description }
  168. {
  169. * Summary:
  170. * TSM Version Gestalt values
  171. *
  172. * Discussion:
  173. * Gestalt values for gestaltTSMgrVersion selector (Gestalt.h)
  174. }
  175. const
  176. kTSMVersion = $0150; { Version 1.5 of the Text Services Manager }
  177. kTSM15Version = kTSMVersion;
  178. kTSM20Version = $0200; { Version 2.0 as of Mac OS X 10.0 }
  179. kTSM22Version = $0220; { Version 2.2 as of Mac OS X 10.3 }
  180. kTSM23Version = $0230; { Version 2.3 as of Mac OS X 10.4 }
  181. kTSM24Version = $0240; { Version 2.4 as of Mac OS X 10.5 }
  182. { Interface types for NewTSMDocument}
  183. type
  184. InterfaceTypeList = array[0..$7F000000 div SizeOf(OSType)-1] of OSType;
  185. InterfaceTypeListPtr = ^InterfaceTypeList;
  186. type
  187. TSMDocumentInterfaceType = OSType;
  188. {
  189. * Summary:
  190. * InterfaceTypeList - array of OSTypes passed to NewTSMDocument to
  191. * specify capabilities of the new TSMDocument.
  192. *
  193. * Discussion:
  194. * TSM's Interface types, as of 10.3, are also stored as TSMDocument
  195. * properties, so once a TSMDocument is created, you can easily find
  196. * out what were its InterfaceTypes at document creation.
  197. }
  198. const
  199. {
  200. * This is the traditional TSMDocument type. It does not support
  201. * Unicode. TSM will convert all Unicode produced by input methods to
  202. * the Mac encoding represented by the current keyboard script (or
  203. * the Mac encoding specified by the input method producing text.)
  204. * Full Unicode input sources may not be selectable when this
  205. * TSMDocument is active.
  206. }
  207. kTextServiceDocumentInterfaceType = kTextService; { TSM Document type for traditional (non-Unicode) NewTSMDocument }
  208. {
  209. * TSMTE document type. This requests automatic management of inline
  210. * input sessions by TextEdit (the text engine.) See Technote TE27 -
  211. * Inline Input for TextEdit with TSMTE. This property (like
  212. * TextEdit) is not supported on 64-bit.
  213. }
  214. kTSMTEDocumentInterfaceType = FourCharCode('tmTE'); { TSM Document type for TSMTE document (see kTSMTEInterfaceType - TSMTE.h) }
  215. {
  216. * Unicode-savvy TSMDocument. TSM will pass thru all Unicode text
  217. * unchanged. When this TSMDocument is active, the full range of
  218. * input sources is available to the user, such as Unicode keyboard
  219. * layouts.
  220. }
  221. kUnicodeDocumentInterfaceType = FourCharCode('udoc'); { TSM Document type for Unicode-savvy application }
  222. { Older names, to be deprecated}
  223. kUnicodeDocument = kUnicodeDocumentInterfaceType; { TSM Document type for Unicode-savvy application }
  224. {
  225. TextServiceClass constants supported by TSM
  226. Same as component subtype for the component description
  227. }
  228. type
  229. TextServiceClass = OSType;
  230. {
  231. * Summary:
  232. * TextService classes
  233. *
  234. * Discussion:
  235. * Text Service classes fall into three categories or behaviors.
  236. *
  237. * (1) KeyboardInputMethodClass text services are exclusive of one
  238. * another in terms of being the default for a given Mac script
  239. * code, and at most one of these - regardless of script - can be
  240. * currently selected.
  241. * (2) Only zero or one InkInputMethodClass text services can be
  242. * selected; this is independent of what other input sources are
  243. * selected.
  244. * (3) Zero or more input methods of other classes can be selected,
  245. * regardless of what other input sources are selected (they are
  246. * additive in nature, regardless of the current keyboard script).
  247. }
  248. const
  249. {
  250. * Text service class for keyboard input methods. Behavior is
  251. * exclusive. Input Methods in this class are normally associated
  252. * with a Mac ScriptCode or Unicode, although they can be associated
  253. * with several scripts by adopting the Input Mode protocol. Keyboard
  254. * input methods are always visible in the System UI.
  255. }
  256. kKeyboardInputMethodClass = FourCharCode('inpm');
  257. {
  258. * Text service class for Ink (Handwriting) input methods. At most
  259. * one of these can be enabled and active regardless of script. Text
  260. * Services in the Ink class do not belong to any given script in the
  261. * sense that those of the Keyboard class do. Once selected, this
  262. * kind of text service will remain active regardless of the current
  263. * keyboard script. Although text services in this class are keyboard
  264. * script agnostic, like input methods of the keyboard class they can
  265. * still profess to produce only those Unicodes that are encoded in
  266. * the mac encoding specified in their component description record
  267. * or their implementation of the GetScriptLanguageSupport component
  268. * call.
  269. *
  270. * Mac OS X only provides System UI for enabling Apple's Ink input
  271. * method, not for other Ink input methods.
  272. }
  273. kInkInputMethodClass = FourCharCode('ink ');
  274. {
  275. * Text service class for Character Palette input methods. Behavior
  276. * is Additive. Text Services in the character palette class do not
  277. * belong to any given script in the same sense that do those of the
  278. * Keyboard class. Once selected, this kind of text service will
  279. * remain active regardless of the current keyboard script. Although
  280. * text services in this class are keyboard script agnostic, like
  281. * input methods of the keyboard class they can still profess to
  282. * produce only those Unicodes that are encoded in the mac encoding
  283. * specified in their component description record or their
  284. * implementation of the GetScriptLanguageSupport component call.
  285. *
  286. *
  287. * Unlike input methods in the keyboard class, multiple such text
  288. * services can be activated in parallel, and unlike input methods in
  289. * the Ink class, Mac OS X provides System UI to allow the user to
  290. * both enable and select multiple such input methods. Use the
  291. * kComponentBundleInvisibleInSystemUIKey plist key to make Character
  292. * Palette input methods invisible to the System UI.
  293. *
  294. * (Dictionary Service input methods are visible in the system UI by
  295. * default. Use the kComponentBundleInvisibleInSystemUIKey plist key
  296. * to make them invisible if a developer-provided UI is to be used
  297. * instead.)
  298. }
  299. kCharacterPaletteInputMethodClass = FourCharCode('cplt');
  300. {
  301. * Text Service class for Speech input methods. Behavior is
  302. * Additive.
  303. *
  304. * Similar to Character palette class. System UI for these has not
  305. * yet been determined.
  306. }
  307. kSpeechInputMethodClass = FourCharCode('voic');
  308. {
  309. * Text Service class for Optical Character Recognition input
  310. * methods. Behavior is Additive.
  311. *
  312. * Similar to Character palette class. System UI for these has not
  313. * yet been determined.
  314. }
  315. kOCRInputMethodClass = FourCharCode('ocr ');
  316. { New opaque definitions for types }
  317. type
  318. TSMDocumentID = ^SInt32; { an opaque type }
  319. { TSMDocumentID Properties}
  320. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
  321. { TSMDocumentID Properties }
  322. { With the following property APIs, you can attach any piece of data you'd like to a }
  323. { TSMDocument.}
  324. { to attach the data to the menu itself, and not to any specific menu item. }
  325. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
  326. type
  327. TSMDocumentPropertyTag = OSType;
  328. {
  329. * Summary:
  330. * TSMDocument Property Tags
  331. *
  332. * Discussion:
  333. * With the following property APIs, you can attach any piece of
  334. * data you'd like to a TSMDocument. The property tags pre-defined
  335. * below by TSM fall in several categories. Read-only properties:
  336. * these property tags are actually the interface type used to
  337. * create a TSMDocument, such as kUnicodeDocumentInterfaceType.
  338. * These properties are all property value-independent... see below.
  339. * Value-independent properties: these property tags are value
  340. * independent. Only the fact that the tag is or is not a property
  341. * of a TSMDocument is important. These are used where the
  342. * existence of the property is sufficient... Read-only TSMDocment
  343. * properties are examples of value independent properties.
  344. * SupportGlyphInfo is another. Pass a non-NULL actualSize parameter
  345. * and a NULL propertyBuffer to check if the property exists (i.e.
  346. * to obtain the size.) Value-dependent properties: these are
  347. * properties for which the value is meaningful. Examples of this
  348. * are the Refcon ProtocolVersion properties. NOTE:
  349. * Value-independent properties can read by other clients, in
  350. * particular input methods. For example, input methods may want to
  351. * query the current TSMDocument to see if supports unrestricted
  352. * Unicode input, or if it supports the GlyphInfo protocol.
  353. }
  354. const
  355. { Property values for value-independent property tags (i.e. only the existence of}
  356. { the property is meaningful). To remove these properties, use TSMRemoveDocumentProperty.}
  357. { To test these properties, it is sufficient to obtain the property's size, i.e. buffer = NULL}
  358. { and test for error.}
  359. { Read-only (value-independent) properties}
  360. { Identical to Interface types passed to NewTSMDocument}
  361. {
  362. * Property is read-only, value-independent. The value is identical
  363. * to the TextServiceDocument interface type, but is not needed.
  364. * Simply test for existence of the property. Property available in
  365. * TSM 2.2 and later
  366. }
  367. kTSMDocumentTextServicePropertyTag = kTextServiceDocumentInterfaceType;
  368. {
  369. * Property is read-only, value-independent. The value is identical
  370. * to the UnicodeDocument interface type, but is not needed. Simply
  371. * test for existence of the property. Property available in TSM 2.2
  372. * and later
  373. }
  374. kTSMDocumentUnicodePropertyTag = kUnicodeDocumentInterfaceType;
  375. {
  376. * Property is read-only, value-independent. The value is identical
  377. * to the TSMTEDocument interface type, but is not needed. Simply
  378. * test for existence of the property. Property available in TSM 2.2
  379. * and later
  380. }
  381. kTSMDocumentTSMTEPropertyTag = kTSMTEDocumentInterfaceType; { }
  382. { Settable value-independent properties}
  383. {
  384. * Property is value-independent. The existence of this property in
  385. * a TSMDocument indicates that the event handlers associated with
  386. * the TSMDocument are aware of TSM's GlyhInfo data structure. This
  387. * structure allows the input source producing text to apply Glyph
  388. * IDs, CIDs, or Fonts to subranges of text produced. This is useful
  389. * for characters in Unicode private use area, such as Windings. For
  390. * more information, see the Glyph Access protocol described in
  391. * TechNote TN20TT. By convention, this value can be a UInt32 with a
  392. * value of 0, but this is really arbitrary. Simply test for
  393. * existence of the property. Property available in TSM 1.5 from
  394. * MacOSX 10.2 and later
  395. }
  396. kTSMDocumentSupportGlyphInfoPropertyTag = FourCharCode('dpgi'); { property value is arbitrary}
  397. {
  398. * Property is value-independent. The presence of this property tag
  399. * indicates that the TSMDocument should use TSM's floating input
  400. * window to handle input from input methods. This form of input
  401. * does not support Unicode input by default, unless the
  402. * UnicodeInputWindow property is set. By convention, this value can
  403. * be a UInt32 with a value of 0, but this is really arbitrary.
  404. * Simply test for existence of the property. Property available in
  405. * TSM 2.2 and later
  406. }
  407. kTSMDocumentUseFloatingWindowPropertyTag = FourCharCode('uswm'); { use bottom-line input (floating TSM) window for text input}
  408. {
  409. * Property is value-independent. The presence of this property tag
  410. * indicates that although the TSMDocument has been told to use TSM's
  411. * floating input window to handle input from input methods, the
  412. * floating window is to support Unicode input. This is useful when
  413. * non input-related activity is to produce Unicode, such as keyboard
  414. * navigation . By convention, this value can be a UInt32 with a
  415. * value of 0, but this is really arbitrary. Simply test for
  416. * existence of the property. Property available in TSM 2.2 and later
  417. }
  418. kTSMDocumentUnicodeInputWindowPropertyTag = FourCharCode('dpub'); { Unicode support in bottom line input window}
  419. {
  420. * Property is value-independent. The presence of this property tag
  421. * indicates that the event handlers associated with this TSMDocument
  422. * support TSM's DocumentAccess event suite (see CarbonEvents.h) This
  423. * property also indicates that the handler for TSM's
  424. * kEventTextInputUpdateActiveInputArea event supports the
  425. * 'replaceRange' parameter and that the handler is a Carbon event
  426. * handler, not an AppleEvent handler. By convention, this value can
  427. * be a UInt32 with a value of 0, but this is really arbitrary.
  428. * Simply test for existence of the property. Property available in
  429. * TSM 2.2 and later
  430. }
  431. kTSMDocumentSupportDocumentAccessPropertyTag = FourCharCode('dapy'); { support TSM Document Access protocol}
  432. { Older names, to be deprecated}
  433. kTSMDocumentPropertySupportGlyphInfo = kTSMDocumentSupportGlyphInfoPropertyTag;
  434. kTSMDocumentPropertyUnicodeInputWindow = kTSMDocumentUnicodeInputWindowPropertyTag; { }
  435. { Settable value-dependent properties}
  436. { Property values for the following property tags are meaningful}
  437. {
  438. * Property is value-dependent. The property value initially
  439. * contains the Refcon value passed to NewTSMDocument. This property
  440. * is useful for changing the refcon on-the-fly after the TSMDocument
  441. * has been created. Property available in TSM 2.2 and later
  442. }
  443. kTSMDocumentRefconPropertyTag = FourCharCode('refc'); { refcon passed to NewTSMDocument (SRefCon)}
  444. {
  445. * Property is value-dependent. The property value indicates which
  446. * input mode should be used by the current keyboard-class input
  447. * method. It is useful for temporarily restricting text input to a
  448. * subset of characters normally produced by an input method in a
  449. * given script, such as Katakana for Japanese input. See details in
  450. * TextServiceProperty API below. Also note that this property tag
  451. * and value are passed unchanged to the TextServiceProperty API, so
  452. * it also serves as a TextServicePropertyTag. See
  453. * kTextServiceInputModePropertyTag for discussion on the values
  454. * associated with this property. Usage Note: Property value is a
  455. * CFStringRef. With TSMGetDocumentProperty, the behavior is that of
  456. * a Copy function, and TSMSetDocumentProperty retain the CFString...
  457. * in either case the caller is responsible for releasing its
  458. * reference. Property available in TSM 2.2 and later
  459. }
  460. kTSMDocumentInputModePropertyTag = FourCharCode('imim'); { Input mode property for input methods (CFStringRef - see Input Modes below)}
  461. {
  462. * Property is value-dependent. The property value indicates the
  463. * level of the window that will host inline input sessions for a
  464. * given TSMDocument. Input Methods will query this property to
  465. * determine the level above which its "candidate" (floating)
  466. * window(s) should be positioned, typically by adding its window to
  467. * a window group (see Carbon's WindowGroup API) and incrementing the
  468. * level for the group. If no level is available, the input method
  469. * is expected to use the default behavior, i.e. let the Window
  470. * Manager manage the level for floating windows. Window levels are
  471. * typed as CGWindowLevel. NSWindow levels are accessed through
  472. * NSWindow's (int)level method. Property available in TSM 2.3 and
  473. * later
  474. }
  475. kTSMDocumentWindowLevelPropertyTag = FourCharCode('twlp'); { document window level (CGWindowLevel)}
  476. {
  477. * Property is value-dependent. The property value is a
  478. * TISInputSourceRef specifying a keyboard input source that should
  479. * override whatever the System considers to be the current input
  480. * source at the time the TSMDocument is activated (i.e. when the
  481. * text field gains focus). If the TSMDocument is already active
  482. * when this property is set, the specified input source is selected.
  483. * Usage Note: Property value is a TISInputSourceRef. With
  484. * TSMGetDocumentProperty, the behavior is that of a Copy function,
  485. * and TSMSetDocumentProperty retain the CFString... in either case
  486. * the caller is responsible for releasing its reference. Property
  487. * available in TSM 2.4 (Mac OS X 10.5) and later
  488. }
  489. kTSMDocumentInputSourceOverridePropertyTag = FourCharCode('inis'); { Set an override (Initial) Input source}
  490. {
  491. * Property is value-dependent. The property value is a CFArrayRef
  492. * containing an array of keyboard input sources (TISInputSourceRef)
  493. * available to the user. This is used to restrict keyboard input to
  494. * the specified set of input sources. The array should be a subset
  495. * of those keyboard input sources available to the user according to
  496. * the System, i.e. the enabled input sources in the International
  497. * Preferences pane or the Text Input menu. Since this input source
  498. * may need to be recomputed when input sources are enabled or
  499. * disabled either by the user or programmatically, this value should
  500. * be recomputed when the
  501. * kTISNotifyEnabledKeyboardInputSourcesChanged notification is
  502. * received or before a call to ActivateTSMDocument. If the set of
  503. * enabled input sources specified consists of only one input source,
  504. * it will be automatically selected. Usage Note: Property value is
  505. * a CFArrayRef. With TSMGetDocumentProperty, the behavior is that of
  506. * a Copy function, and TSMSetDocumentProperty retain the CFString...
  507. * in either case the caller is responsible for releasing its
  508. * reference. Property available in TSM 2.4 (Mac OS X 10.5) and later
  509. }
  510. kTSMDocumentEnabledInputSourcesPropertyTag = FourCharCode('enis'); { Restrict input to this set of enabled Input sources}
  511. {
  512. * TSMSetDocumentProperty()
  513. *
  514. * Summary:
  515. * Set a TSMDocument property
  516. *
  517. * Discussion:
  518. * With the following property APIs, you can attach any piece of
  519. * data you'd like to a TSMDocument. Other uses include setting a
  520. * (value-independent) property for input methods to query in order
  521. * to determine an application's compliance with various TSM
  522. * protocols. NOTE: Property values are currently typed as SInt32,
  523. * but should really be a void* since a variety of data types are
  524. * used in practice. Note that the semantics for refcounted objects
  525. * is ambiguous, so retain/release model is discussed for each
  526. * TSM-defined property individually. (See notes for
  527. * TSMDocumentPropertyTag) Error Codes (MacErrors.h):
  528. * tsmComponentPropertyUnsupportedErr tsmInputModeChangeFailedErr
  529. *
  530. * Mac OS X threading:
  531. * Not thread safe
  532. *
  533. * Availability:
  534. * Mac OS X: in version 10.2 and later in Carbon.framework
  535. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  536. * Non-Carbon CFM: not available
  537. }
  538. function TSMSetDocumentProperty( docID: TSMDocumentID; propertyTag: TSMDocumentPropertyTag; propertySize: UInt32; propertyData: UnivPtr ): OSStatus; external name '_TSMSetDocumentProperty';
  539. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  540. {
  541. * TSMGetDocumentProperty()
  542. *
  543. * Summary:
  544. * Get a TSMDocument property
  545. *
  546. * Discussion:
  547. * With the following property APIs, you can attach any piece of
  548. * data you'd like to a TSMDocument. Other uses include setting a
  549. * (value-independent) property for input methods to query in order
  550. * to determine an application's compliance with various TSM
  551. * protocols. NOTE: Property values are currently typed as SInt32,
  552. * but should really be a void* since a variety of data types are
  553. * used in practice. Note that the semantics for refcounted objects
  554. * is ambiguous, so retain/release model is discussed for each
  555. * TSM-defined property individually. (See notes for
  556. * TSMDocumentPropertyTag) Error Codes (MacErrors.h)
  557. * tsmDocPropertyNotFoundErr tsmDocPropertyBufferTooSmallErr
  558. * tsmComponentPropertyNotFoundErr tsmComponentPropertyUnsupportedErr
  559. *
  560. * Mac OS X threading:
  561. * Not thread safe
  562. *
  563. * Availability:
  564. * Mac OS X: in version 10.2 and later in Carbon.framework
  565. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  566. * Non-Carbon CFM: not available
  567. }
  568. function TSMGetDocumentProperty( docID: TSMDocumentID; propertyTag: TSMDocumentPropertyTag; bufferSize: UInt32; var actualSize: UInt32; propertyBuffer: UnivPtr { can be NULL } ): OSStatus; external name '_TSMGetDocumentProperty';
  569. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  570. {
  571. * TSMRemoveDocumentProperty()
  572. *
  573. * Mac OS X threading:
  574. * Not thread safe
  575. *
  576. * Availability:
  577. * Mac OS X: in version 10.2 and later in Carbon.framework
  578. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  579. * Non-Carbon CFM: not available
  580. }
  581. function TSMRemoveDocumentProperty( docID: TSMDocumentID; propertyTag: TSMDocumentPropertyTag ): OSStatus; external name '_TSMRemoveDocumentProperty';
  582. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  583. { Language and Script constants}
  584. const
  585. kUnknownLanguage = $FFFF;
  586. kUnknownScript = $FFFF;
  587. kNeutralScript = $FFFF;
  588. const
  589. { Component Flags in ComponentDescription }
  590. bTakeActiveEvent = 15; { bit set if the component takes active event }
  591. bHandleAERecording = 16; { bit set if the component takes care of recording Apple Events <new in vers2.0> }
  592. bScriptMask = $00007F00; { bit 8 - 14 }
  593. bLanguageMask = $000000FF; { bit 0 - 7 }
  594. bScriptLanguageMask = bScriptMask + bLanguageMask; { bit 0 - 14 }
  595. const
  596. { Low level routines which are dispatched directly to the Component Manager }
  597. kCMGetScriptLangSupport = $0001; { Component Manager call selector 1 }
  598. kCMInitiateTextService = $0002; { Component Manager call selector 2 }
  599. kCMTerminateTextService = $0003; { Component Manager call selector 3 }
  600. kCMActivateTextService = $0004; { Component Manager call selector 4 }
  601. kCMDeactivateTextService = $0005; { Component Manager call selector 5 }
  602. kCMTextServiceEvent = $0006; { Component Manager call selector 6 }
  603. kCMTextServiceEventRef = kCMTextServiceEvent;
  604. kCMGetTextServiceMenu = $0007; { Component Manager call selector 7 }
  605. kCMTextServiceMenuSelect = $0008; { Component Manager call selector 8 }
  606. kCMFixTextService = $0009; { Component Manager call selector 9 }
  607. kCMSetTextServiceCursor = $000A; { Component Manager call selector 10 }
  608. kCMHidePaletteWindows = $000B; { Component Manager call selector 11 }
  609. kCMGetTextServiceProperty = $000C; { Component Manager call selector 12 }
  610. kCMSetTextServiceProperty = $000D; { Component Manager call selector 13 }
  611. kCMUCTextServiceEvent = $000E; { Component Manager call selector 14 }
  612. kCMCopyTextServiceInputModeList = $000F; { Component Manager call selector 15 }
  613. kCMInputModePaletteItemHit = $0010; { Component Manager call selector 16 }
  614. kCMGetInputModePaletteMenu = $0011; { Component Manager call selector 17 }
  615. { extract Script/Language code from Component flag ... }
  616. // #define mGetScriptCode(cdRec) ((ScriptCode) ((cdRec.componentFlags & bScriptMask) >> 8))
  617. // #define mGetLanguageCode(cdRec) ((LangCode) cdRec.componentFlags & bLanguageMask)
  618. { Text Service Info List }
  619. type
  620. TextServiceInfo = record
  621. fComponent: Component;
  622. fItemName: Str255;
  623. end;
  624. TextServiceInfoPtr = ^TextServiceInfo;
  625. type
  626. TextServiceList = record
  627. fTextServiceCount: SInt16; { number of entries in the 'fServices' array }
  628. fServices: array [0..0] of TextServiceInfo; { Note: array of 'TextServiceInfo' records follows }
  629. end;
  630. TextServiceListPtr = ^TextServiceList;
  631. type
  632. TextServiceListHandle = ^TextServiceListPtr;
  633. ScriptLanguageRecord = record
  634. fScript: ScriptCode;
  635. fLanguage: LangCode;
  636. end;
  637. ScriptLanguageRecordPtr = ^ScriptLanguageRecord;
  638. type
  639. ScriptLanguageSupport = record
  640. fScriptLanguageCount: SInt16; { number of entries in the 'fScriptLanguageArray' array }
  641. fScriptLanguageArray: array [0..0] of ScriptLanguageRecord; { Note: array of 'ScriptLanguageRecord' records follows }
  642. end;
  643. ScriptLanguageSupportPtr = ^ScriptLanguageSupport;
  644. type
  645. ScriptLanguageSupportHandle = ^ScriptLanguageSupportPtr;
  646. TSMGlyphInfo = record
  647. range: CFRange; { two SInt32s}
  648. fontRef: ATSFontRef;
  649. collection: UInt16; { kGlyphCollectionXXX enum}
  650. glyphID: UInt16; { GID (when collection==0) or CID}
  651. end;
  652. type
  653. TSMGlyphInfoArray = record
  654. numGlyphInfo: ItemCount; { UInt32}
  655. glyphInfo: array[0..$7F000000 div SizeOf(TSMGlyphInfo)-1] of TSMGlyphInfo;
  656. end;
  657. { High level TSM Doucment routines }
  658. {$ifc not TARGET_CPU_64}
  659. {
  660. * NewTSMDocument()
  661. *
  662. * Mac OS X threading:
  663. * Not thread safe
  664. *
  665. * Availability:
  666. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  667. * CarbonLib: in CarbonLib 1.0 and later
  668. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  669. }
  670. function NewTSMDocument( numOfInterface: SInt16; supportedInterfaceTypes: {variable-size-array} InterfaceTypeListPtr; var idocID: TSMDocumentID; refcon: SRefCon ): OSErr; external name '_NewTSMDocument';
  671. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  672. {$endc} {not TARGET_CPU_64}
  673. {$ifc not TARGET_CPU_64}
  674. {
  675. * DeleteTSMDocument()
  676. *
  677. * Mac OS X threading:
  678. * Not thread safe
  679. *
  680. * Availability:
  681. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  682. * CarbonLib: in CarbonLib 1.0 and later
  683. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  684. }
  685. function DeleteTSMDocument( idocID: TSMDocumentID ): OSErr; external name '_DeleteTSMDocument';
  686. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  687. {
  688. * ActivateTSMDocument()
  689. *
  690. * Mac OS X threading:
  691. * Not thread safe
  692. *
  693. * Availability:
  694. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  695. * CarbonLib: in CarbonLib 1.0 and later
  696. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  697. }
  698. function ActivateTSMDocument( idocID: TSMDocumentID ): OSErr; external name '_ActivateTSMDocument';
  699. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  700. {
  701. * DeactivateTSMDocument()
  702. *
  703. * Mac OS X threading:
  704. * Not thread safe
  705. *
  706. * Availability:
  707. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  708. * CarbonLib: in CarbonLib 1.0 and later
  709. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  710. }
  711. function DeactivateTSMDocument( idocID: TSMDocumentID ): OSErr; external name '_DeactivateTSMDocument';
  712. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  713. {
  714. * FixTSMDocument()
  715. *
  716. * Mac OS X threading:
  717. * Not thread safe
  718. *
  719. * Availability:
  720. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  721. * CarbonLib: in CarbonLib 1.0 and later
  722. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  723. }
  724. function FixTSMDocument( idocID: TSMDocumentID ): OSErr; external name '_FixTSMDocument';
  725. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  726. {
  727. * GetServiceList() *** DEPRECATED ***
  728. *
  729. * Deprecated:
  730. * Use TISCreateInputSourceList API instead:
  731. * kTISPropertyInputSourceType =
  732. * kTISTypeKeyboardInputMethodWithoutModes and/or
  733. * kTISTypeKeyboardInputMethodModeEnabled
  734. * kTISPropertyBundleID = <input method bundle identifier of
  735. * interest>
  736. *
  737. * Summary:
  738. * Used to get a list of installed input method Components
  739. *
  740. * Discussion:
  741. * This API was typically used to track down the Component ID for a
  742. * specific input method from the Component Manager's list of
  743. * installed Components, usually by componentType, componentSubType,
  744. * and/or componentManufacturer.
  745. *
  746. * Mac OS X threading:
  747. * Not thread safe
  748. *
  749. * Availability:
  750. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  751. * CarbonLib: in CarbonLib 1.0 and later
  752. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  753. }
  754. function GetServiceList( numOfInterface: SInt16; {const} supportedInterfaceTypes: {variable-size-array} InterfaceTypeListPtr; var serviceInfo: TextServiceListHandle; var seedValue: SInt32 ): OSErr; external name '_GetServiceList';
  755. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  756. {
  757. * OpenTextService() *** DEPRECATED ***
  758. *
  759. * Mac OS X threading:
  760. * Not thread safe
  761. *
  762. * Availability:
  763. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  764. * CarbonLib: in CarbonLib 1.0 and later
  765. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  766. }
  767. function OpenTextService( idocID: TSMDocumentID; aComponent: Component; var aComponentInstance: ComponentInstance ): OSErr; external name '_OpenTextService';
  768. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  769. {
  770. * CloseTextService() *** DEPRECATED ***
  771. *
  772. * Mac OS X threading:
  773. * Not thread safe
  774. *
  775. * Availability:
  776. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  777. * CarbonLib: in CarbonLib 1.0 and later
  778. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  779. }
  780. function CloseTextService( idocID: TSMDocumentID; aComponentInstance: ComponentInstance ): OSErr; external name '_CloseTextService';
  781. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  782. {
  783. * SendAEFromTSMComponent() *** DEPRECATED ***
  784. *
  785. * Mac OS X threading:
  786. * Not thread safe
  787. *
  788. * Availability:
  789. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  790. * CarbonLib: in CarbonLib 1.0 and later
  791. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  792. }
  793. function SendAEFromTSMComponent( const (*var*) theAppleEvent: AppleEvent; var reply: AppleEvent; sendMode: AESendMode; sendPriority: AESendPriority; timeOutInTicks: SInt32; idleProc: AEIdleUPP; filterProc: AEFilterUPP ): OSErr; external name '_SendAEFromTSMComponent';
  794. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  795. {
  796. * SendTextInputEvent()
  797. *
  798. * Discussion:
  799. * This API replaces SendAEFromTSMComponent on Mac OS X only. Input
  800. * Methods on Mac OS X are Carbon Event based instead of AppleEvent
  801. * based. The Carbon TextInput events which they generate are
  802. * provided to TSM for dispatching via this API.
  803. *
  804. * Mac OS X threading:
  805. * Not thread safe
  806. *
  807. * Availability:
  808. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  809. * CarbonLib: in CarbonLib N.e.v.e.r and later
  810. * Non-Carbon CFM: not available
  811. }
  812. function SendTextInputEvent( inEvent: EventRef ): OSStatus; external name '_SendTextInputEvent';
  813. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  814. {
  815. * SetDefaultInputMethod() *** DEPRECATED ***
  816. *
  817. * Deprecated:
  818. * Use TISSelectInputSource API
  819. *
  820. * Summary:
  821. * Set the input method Component ID to be used for the specified
  822. * script/language.
  823. *
  824. * Discussion:
  825. * This API also switches to the specified script/language.
  826. *
  827. * Mac OS X threading:
  828. * Not thread safe
  829. *
  830. * Availability:
  831. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  832. * CarbonLib: in CarbonLib 1.0 and later
  833. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  834. }
  835. function SetDefaultInputMethod( ts: Component; var slRecordPtr: ScriptLanguageRecord ): OSErr; external name '_SetDefaultInputMethod';
  836. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  837. {
  838. * GetDefaultInputMethod() *** DEPRECATED ***
  839. *
  840. * Deprecated:
  841. * Use TISCopyCurrentKeyboardInputSource API and query its
  842. * properties. If the current input source does not support the
  843. * specified script/language, use TISCopyInputSourceForLanguage to
  844. * find one that does.
  845. *
  846. * Summary:
  847. * Get the default (last used) input method Component ID for the
  848. * specified script/language.
  849. *
  850. * Mac OS X threading:
  851. * Not thread safe
  852. *
  853. * Availability:
  854. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  855. * CarbonLib: in CarbonLib 1.0 and later
  856. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  857. }
  858. function GetDefaultInputMethod( var ts: Component; var slRecordPtr: ScriptLanguageRecord ): OSErr; external name '_GetDefaultInputMethod';
  859. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  860. {
  861. * SetTextServiceLanguage() *** DEPRECATED ***
  862. *
  863. * Deprecated:
  864. * Use TISSelectInputSource API
  865. *
  866. * Summary:
  867. * Switch to the last used input method (if any) for the specified
  868. * script/language.
  869. *
  870. * Mac OS X threading:
  871. * Not thread safe
  872. *
  873. * Availability:
  874. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  875. * CarbonLib: in CarbonLib 1.0 and later
  876. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  877. }
  878. function SetTextServiceLanguage( var slRecordPtr: ScriptLanguageRecord ): OSErr; external name '_SetTextServiceLanguage';
  879. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  880. {
  881. * GetTextServiceLanguage() *** DEPRECATED ***
  882. *
  883. * Deprecated:
  884. * Use TISCopyCurrentKeyboardInputSource API and query its
  885. * properties, such as kTISPropertyInputSourceLanguages.
  886. *
  887. * Summary:
  888. * Get the current script/language.
  889. *
  890. * Mac OS X threading:
  891. * Not thread safe
  892. *
  893. * Availability:
  894. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  895. * CarbonLib: in CarbonLib 1.0 and later
  896. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  897. }
  898. function GetTextServiceLanguage( var slRecordPtr: ScriptLanguageRecord ): OSErr; external name '_GetTextServiceLanguage';
  899. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  900. {
  901. * UseInputWindow()
  902. *
  903. * Mac OS X threading:
  904. * Not thread safe
  905. *
  906. * Availability:
  907. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  908. * CarbonLib: in CarbonLib 1.0 and later
  909. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  910. }
  911. function UseInputWindow( idocID: TSMDocumentID; useWindow: Boolean ): OSErr; external name '_UseInputWindow';
  912. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  913. {
  914. * TSMSetInlineInputRegion() *** DEPRECATED ***
  915. *
  916. * Deprecated:
  917. * Implement kEventTextInputIsMouseEventInInlineInputArea TSM Carbon
  918. * event.
  919. *
  920. * Summary:
  921. * Tell TSM what region and which window make up the inline input
  922. * session.
  923. *
  924. * Discussion:
  925. * Tell TSM about the region occupied by an inline input session. If
  926. * the location of certain mouse events (clicks, mouse moved) occur
  927. * within the specified inline input region, TSM will forward these
  928. * events to the current Input Method so that it can interact with
  929. * the user. Note: If you do not specify this information, TSM will
  930. * need to intercept mouse events in the entire content region as
  931. * the default, when an input method is active, in order to ensure
  932. * that input methods can manage user interaction properly.
  933. *
  934. * Mac OS X threading:
  935. * Not thread safe
  936. *
  937. * Parameters:
  938. *
  939. * inTSMDocument:
  940. * The document.
  941. *
  942. * inWindow:
  943. * The window that contains the inline input session. You can pass
  944. * NULL for this parameter to indicate the user focus window.
  945. *
  946. * inRegion:
  947. * The region occupied by the current inline input region. This
  948. * should be in the coordinates of the port associated with the
  949. * window you passed to inPort. It will need to be recomputed when
  950. * the text content of the inline input session content changes
  951. * (i.e. due to Update Active Input Area events) and when the
  952. * region moves for other reasons, such as window resized,
  953. * scrolling, etc. If you pass a NULL region for this parameter,
  954. * TSM will default to intercept mouse events in the focus
  955. * window's content region.
  956. *
  957. * Availability:
  958. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  959. * CarbonLib: in CarbonLib 1.1 and later
  960. * Non-Carbon CFM: not available
  961. }
  962. function TSMSetInlineInputRegion( inTSMDocument: TSMDocumentID; inWindow: WindowRef; inRegion: RgnHandle ): OSStatus; external name '_TSMSetInlineInputRegion';
  963. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  964. { Component Manager Interfaces to Input Methods }
  965. {
  966. * GetScriptLanguageSupport() *** DEPRECATED ***
  967. *
  968. * Mac OS X threading:
  969. * Not thread safe
  970. *
  971. * Availability:
  972. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  973. * CarbonLib: in CarbonLib 1.0 and later
  974. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  975. }
  976. function GetScriptLanguageSupport( ts: ComponentInstance; var scriptHdl: ScriptLanguageSupportHandle ): ComponentResult; external name '_GetScriptLanguageSupport';
  977. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  978. {
  979. * InitiateTextService()
  980. *
  981. * Mac OS X threading:
  982. * Not thread safe
  983. *
  984. * Availability:
  985. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  986. * CarbonLib: in CarbonLib 1.0 and later
  987. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  988. }
  989. function InitiateTextService( ts: ComponentInstance ): ComponentResult; external name '_InitiateTextService';
  990. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  991. {
  992. * TerminateTextService()
  993. *
  994. * Mac OS X threading:
  995. * Not thread safe
  996. *
  997. * Availability:
  998. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  999. * CarbonLib: in CarbonLib 1.0 and later
  1000. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1001. }
  1002. function TerminateTextService( ts: ComponentInstance ): ComponentResult; external name '_TerminateTextService';
  1003. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1004. {
  1005. * ActivateTextService()
  1006. *
  1007. * Mac OS X threading:
  1008. * Not thread safe
  1009. *
  1010. * Availability:
  1011. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1012. * CarbonLib: in CarbonLib 1.0 and later
  1013. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1014. }
  1015. function ActivateTextService( ts: ComponentInstance ): ComponentResult; external name '_ActivateTextService';
  1016. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1017. {
  1018. * DeactivateTextService()
  1019. *
  1020. * Mac OS X threading:
  1021. * Not thread safe
  1022. *
  1023. * Availability:
  1024. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1025. * CarbonLib: in CarbonLib 1.0 and later
  1026. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1027. }
  1028. function DeactivateTextService( ts: ComponentInstance ): ComponentResult; external name '_DeactivateTextService';
  1029. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1030. {
  1031. * GetTextServiceMenu()
  1032. *
  1033. * Mac OS X threading:
  1034. * Not thread safe
  1035. *
  1036. * Availability:
  1037. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1038. * CarbonLib: in CarbonLib 1.0 and later
  1039. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1040. }
  1041. function GetTextServiceMenu( ts: ComponentInstance; var serviceMenu: MenuRef ): ComponentResult; external name '_GetTextServiceMenu';
  1042. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1043. { New Text Service call in Carbon. }
  1044. { Note: Only Raw Key and Mouse-flavored events are passed to Text Services on MacOS X. }
  1045. {
  1046. * TextServiceEventRef()
  1047. *
  1048. * Mac OS X threading:
  1049. * Not thread safe
  1050. *
  1051. * Availability:
  1052. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1053. * CarbonLib: in CarbonLib 1.1 and later
  1054. * Non-Carbon CFM: not available
  1055. }
  1056. function TextServiceEventRef( ts: ComponentInstance; event: EventRef ): ComponentResult; external name '_TextServiceEventRef';
  1057. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1058. {
  1059. * FixTextService()
  1060. *
  1061. * Mac OS X threading:
  1062. * Not thread safe
  1063. *
  1064. * Availability:
  1065. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1066. * CarbonLib: in CarbonLib 1.0 and later
  1067. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1068. }
  1069. function FixTextService( ts: ComponentInstance ): ComponentResult; external name '_FixTextService';
  1070. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1071. {
  1072. * HidePaletteWindows()
  1073. *
  1074. * Mac OS X threading:
  1075. * Not thread safe
  1076. *
  1077. * Availability:
  1078. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1079. * CarbonLib: in CarbonLib 1.0 and later
  1080. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1081. }
  1082. function HidePaletteWindows( ts: ComponentInstance ): ComponentResult; external name '_HidePaletteWindows';
  1083. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1084. {
  1085. Text Service Properties and standard values
  1086. (used with GetTextServiceProperty/SetTextServiceProperty)
  1087. }
  1088. {$endc} {not TARGET_CPU_64}
  1089. type
  1090. TextServicePropertyTag = OSType;
  1091. {
  1092. * Summary:
  1093. * TextService Properties
  1094. *
  1095. * Discussion:
  1096. * Text Service properties are passed directly to a text service
  1097. * component via Component Mgr glue provided by TSM. Applications
  1098. * that have special knowledge of specific input methods can
  1099. * communicate private properties between each other. The 2
  1100. * following errors have been introduced (as of Mac OS X 10.3) to
  1101. * better support these API: tsmComponentPropertyUnsupportedErr //
  1102. * SetTextServiceProperty failed tsmComponentPropertyNotFoundErr
  1103. * // GetTextServiceProperty failed
  1104. }
  1105. const
  1106. { Typing input mode property tag }
  1107. {
  1108. * The JaTypingMethod property is becoming obsolete. It was
  1109. * introduced as a way for the Setup Assistant to tell Apple's
  1110. * Kotoeri (Japanese) input method to switch to either Roman or
  1111. * Katakana input mode in certain text fields. The entire input mode
  1112. * mechanism is being superceded by kTextServiceInputModePropertyTag.
  1113. * Property available in TSM 1.5 on MacOSX 10.0 and later
  1114. }
  1115. kTextServiceJaTypingMethodPropertyTag = FourCharCode('jtyp'); { Japanese input method typing property}
  1116. {
  1117. * The InputMode property is a CFStringRef that uniquely identifies
  1118. * which input mode should be made current by a keyboard class input
  1119. * method, if possible. Input modes are either generic, i.e.
  1120. * pre-defined by TSM, or specific to an input method. An example of
  1121. * a generic input mode is Katakana input (Japanese) where input in a
  1122. * text field needs to be restricted to that character subset.
  1123. * Another is Roman input mode. This is useful to temporarily
  1124. * provide Roman input from an input method that normally allows text
  1125. * input in another script. The advantage to this over forcing the
  1126. * keyboard script to Roman is that the same input method's UI
  1127. * continues to be available to the user, even though the input
  1128. * script has changed. An example of a special input mode (input
  1129. * method specific) is Hanin input mode in Traditional Chinese input
  1130. * methods. To temporarily change the current input mode from
  1131. * whatever it is to a generic one, use GetTextServiceProperty to
  1132. * obtain the current input mode, then SetTextServiceProperty to
  1133. * switch to the generic mode, and when done restore the original
  1134. * input mode. Input Methods themselves make known what input modes
  1135. * they support via the CopyTextServiceInputModeList component call.
  1136. * If the input method does not support a specified inputMode,
  1137. * GetTextServiceProperty and SetTextServiceProperty will return
  1138. * tsmComponentPropertyUnsupportedErr. GetTextServiceProperty will
  1139. * return tsmComponentPropertyNotFoundErr. RemoveTextServiceProperty
  1140. * is not supported with this tag. NOTE: This property tag is
  1141. * identical to the kTSMDocumentInputModePropertyTag passed to the
  1142. * TSMDocumentProperty API. This allows the tag and value to be
  1143. * passed through without interpretation. NOTE: Input modes
  1144. * CFStringRef's are cast to SInt32 in these API. Property available
  1145. * in TSM 2.2 and later Error Codes (MacErrors.h)
  1146. * tsmComponentPropertyUnsupportedErr - SetTextServiceProperty does
  1147. * not support the specified inputMode. tsmInputModeChangeFailedErr -
  1148. * can be returned if an input method failed to succeed in switching
  1149. * to the requested input mode.
  1150. }
  1151. kTextServiceInputModePropertyTag = kTSMDocumentInputModePropertyTag; { input mode property for input methods}
  1152. { NOTE: This property is being deprecated. Use kTextServiceInputModePropertyTag instead. }
  1153. kIMJaTypingMethodProperty = kTextServiceJaTypingMethodPropertyTag; { Typing method property for Japanese input methods}
  1154. { Typing method property values for kTextServiceJaTypingMethodPropertyTag }
  1155. kIMJaTypingMethodRoman = FourCharCode('roma'); { Roman typing}
  1156. kIMJaTypingMethodKana = FourCharCode('kana'); { Kana typing}
  1157. {$ifc TARGET_CPU_64}
  1158. type
  1159. TextServicePropertyValue = UnivPtr;
  1160. {$elsec} {TARGET_CPU_64}
  1161. type
  1162. TextServicePropertyValue = SInt32;
  1163. {$endc} {TARGET_CPU_64}
  1164. {
  1165. Generic, restricted, input modes
  1166. Used as values for kTextServiceInputModePropertyTag TextServiceProperty API.
  1167. These values require a cast from CFStringRef to SInt32.
  1168. }
  1169. { Restrict output to Roman characters only}
  1170. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1171. {$definec kTextServiceInputModeRoman CFSTRP('com.apple.inputmethod.Roman')}
  1172. {$endc}
  1173. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1174. {$definec kTextServiceInputModePassword CFSTRP('com.apple.inputmethod.Password')}
  1175. {$endc}
  1176. { Restrict output to Hiragana characters only (no conversion to Kanji, i.e. yomi)}
  1177. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1178. {$definec kTextServiceInputModeJapaneseHiragana CFSTRP('com.apple.inputmethod.Japanese.Hiragana')}
  1179. {$endc}
  1180. { Restrict output to Katakana characters only (no conversion to Kanji)}
  1181. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1182. {$definec kTextServiceInputModeJapaneseKatakana CFSTRP('com.apple.inputmethod.Japanese.Katakana')}
  1183. {$endc}
  1184. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1185. {$definec kTextServiceInputModeJapaneseFullWidthRoman CFSTRP('com.apple.inputmethod.Japanese.FullWidthRoman')}
  1186. {$endc}
  1187. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1188. {$definec kTextServiceInputModeJapaneseHalfWidthKana CFSTRP('com.apple.inputmethod.Japanese.HalfWidthKana')}
  1189. {$endc}
  1190. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1191. {$definec kTextServiceInputModeJapanesePlaceName CFSTRP('com.apple.inputmethod.Japanese.PlaceName')}
  1192. {$endc}
  1193. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1194. {$definec kTextServiceInputModeJapaneseFirstName CFSTRP('com.apple.inputmethod.Japanese.FirstName')}
  1195. {$endc}
  1196. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1197. {$definec kTextServiceInputModeJapaneseLastName CFSTRP('com.apple.inputmethod.Japanese.LastName')}
  1198. {$endc}
  1199. { Restrict output to Bopomofo characters only (no conversion to Han)}
  1200. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1201. {$definec kTextServiceInputModeBopomofo CFSTRP('com.apple.inputmethod.TradChinese.Bopomofo')}
  1202. {$endc}
  1203. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1204. {$definec kTextServiceInputModeTradChinesePlaceName CFSTRP('com.apple.inputmethod.TradChinese.PlaceName')}
  1205. {$endc}
  1206. { Restrict output to Hangul syllables only (no conversion to Hanja)}
  1207. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1208. {$definec kTextServiceInputModeHangul CFSTRP('com.apple.inputmethod.Korean.Hangul')}
  1209. {$endc}
  1210. {
  1211. Generic, unrestricted, Input Mode strings
  1212. Used as values for kTextServiceInputModePropertyTag in TextServiceProperty API.
  1213. Unrestricted Japanese output
  1214. }
  1215. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1216. {$definec kTextServiceInputModeJapanese CFSTRP('com.apple.inputmethod.Japanese')}
  1217. {$endc}
  1218. { Traditional Chinese generic (unrestricted) input mode}
  1219. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1220. {$definec kTextServiceInputModeTradChinese CFSTRP('com.apple.inputmethod.TradChinese')}
  1221. {$endc}
  1222. { Simplified Chinese generic (unrestricted) input mode}
  1223. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1224. {$definec kTextServiceInputModeSimpChinese CFSTRP('com.apple.inputmethod.SimpChinese')}
  1225. {$endc}
  1226. { Korean generic (unrestricted) output (i.e. Hanja possible)}
  1227. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1228. {$definec kTextServiceInputModeKorean CFSTRP('com.apple.inputmethod.Korean')}
  1229. {$endc}
  1230. {$ifc not TARGET_CPU_64}
  1231. {
  1232. * GetTextServiceProperty()
  1233. *
  1234. * Mac OS X threading:
  1235. * Not thread safe
  1236. *
  1237. * Availability:
  1238. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1239. * CarbonLib: in CarbonLib 1.0 and later
  1240. * Non-Carbon CFM: not available
  1241. }
  1242. function GetTextServiceProperty( ts: ComponentInstance; inPropertyTag: TextServicePropertyTag; var outPropertyValue: TextServicePropertyValue ): ComponentResult; external name '_GetTextServiceProperty';
  1243. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1244. {
  1245. * SetTextServiceProperty()
  1246. *
  1247. * Mac OS X threading:
  1248. * Not thread safe
  1249. *
  1250. * Availability:
  1251. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  1252. * CarbonLib: in CarbonLib 1.0 and later
  1253. * Non-Carbon CFM: not available
  1254. }
  1255. function SetTextServiceProperty( ts: ComponentInstance; inPropertyTag: TextServicePropertyTag; inPropertyValue: TextServicePropertyValue ): ComponentResult; external name '_SetTextServiceProperty';
  1256. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1257. {
  1258. * CopyTextServiceInputModeList()
  1259. *
  1260. * Summary:
  1261. * Obtain a copy of the set of input modes supported by a
  1262. * keyboard-class input method.
  1263. *
  1264. * Discussion:
  1265. * This Component call is only intended to be supported by input
  1266. * methods that adopt the Input Mode protocol. If this component
  1267. * call is not supported by an input method, calls to the
  1268. * TextServiceProperty API with the kTextServiceInputModePropertyTag
  1269. * property will fail with tsmComponentPropertyUnsupportedErr. Below
  1270. * is the layout of the CFDictionary returned, using the constants
  1271. * defined for the keys (i.e. not using the actual strings for the
  1272. * keys). <dict> <key>kTSInputModeListKey</key> <dict> <key>
  1273. * modeSignature : (internal ascii name) </key> <!-- This can be any
  1274. * of the generic input modes defined in this file, --> <!-- such
  1275. * as kTextServiceInputModeRoman, or can be a private input --> <!--
  1276. * mode such as CFSTR(
  1277. * "com.apple.MyInputmethod.Japanese.CoolInputMode" ) --> <dict>
  1278. * <key>kTSInputModeMenuIconFileKey</key> <string> (path for menu
  1279. * icon image file) </string>
  1280. * <key>kTSInputModeAlternateMenuIconFileKey</key> <string> (path
  1281. * for alternate menu icon image file -- when item is hilited)
  1282. * </string> <key>kTSInputModePaletteIconFileKey</key> <string>
  1283. * (path for palette icon image file) </string>
  1284. * <key>kTSInputModeDefaultStateKey</key> <boolean> (default on/off
  1285. * state) </boolean> <key>kTSInputModeScriptKey</key> <string>
  1286. * (scriptCode string for this mode, i.e. "smRoman", "smJapanese",
  1287. * ...) </string> <key>kTSInputModePrimaryInScriptKey</key>
  1288. * <boolean> (true if this is primary mode in this script)
  1289. * </boolean> <key>kTSInputModeIsVisibleKey</key> <boolean> (true if
  1290. * this input mode should appear in System UI) </boolean>
  1291. * <key>kTSInputModeKeyEquivalentModifiersKey</key> <integer>
  1292. * (modifiers) </integer> <key>kTSInputModeKeyEquivalentKey</key>
  1293. * <string> (key equivalent character) </string>
  1294. * <key>kTSInputModeJISKeyboardShortcutKey</key> <integer>
  1295. * (optional: 0=none,1=hiragana,2=katakana,3=eisu) </integer>
  1296. * </dict> </dict> <key>kTSVisibleInputModeOrderedArrayKey</key>
  1297. * <!-- This array defines the ordering (for UI purposes) of input
  1298. * modes that are --> <!-- both visible and enabled (either by
  1299. * default, i.e. by the System, or by --> <!-- the user, i.e. via
  1300. * System provided UI) --> <array> <value> modeSignature </value>
  1301. * </array> </dict> Available in TSM 2.2 and later Important: This
  1302. * dictionary must also be present in the component bundle's
  1303. * Info.plist, in addition to being available through this component
  1304. * call. This will allow retrival of input modes by the System
  1305. * without opening the component. The component call will be used
  1306. * whenever the System is notified of a change in the contents of
  1307. * the inputMode list, such as when the name or key-equivalents of
  1308. * individual input modes have changed. Note: If, when the
  1309. * input method is first activated in a login session, the settings
  1310. * of the individual input modes (names or key-equivalents) differ
  1311. * from the default settings as found in the component bundle's
  1312. * Info.plist, the System will need to be notified of the change.
  1313. * The input method does this by sending out a
  1314. * kEventTextInputInputMenuChanged Carbon event, just as it is when
  1315. * the change originally took place.
  1316. *
  1317. * Mac OS X threading:
  1318. * Not thread safe
  1319. *
  1320. * Availability:
  1321. * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only]
  1322. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  1323. * Non-Carbon CFM: not available
  1324. }
  1325. function CopyTextServiceInputModeList( ts: ComponentInstance; var outInputModes: CFDictionaryRef ): ComponentResult; external name '_CopyTextServiceInputModeList';
  1326. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  1327. {
  1328. Key for InputMode dictionary in Component bundle's Info.plist
  1329. Value is a dictionary describing the set of input modes implemented by the component.
  1330. The supported keys in this dictionary are:
  1331. kTSInputModeListKey
  1332. kTSVisibleInputModeOrderedArrayKey
  1333. See CopyTextServiceInputModeList() for more details.
  1334. }
  1335. {$endc} {not TARGET_CPU_64}
  1336. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1337. {$definec kComponentBundleInputModeDictKey CFSTRP('ComponentInputModeDict')}
  1338. {$endc}
  1339. {
  1340. Info.plist keys for an Input Method icon TIFF file.
  1341. The filepath (.tif or .icns file) specified for an icon is relative to the input method bundle's Resources directory.
  1342. NOTE: This key is required if the input method (Component) does not contain a resource fork icon. This icon will
  1343. also be used for any input modes that do not specify their own icon.
  1344. }
  1345. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1346. {$definec kTSInputMethodIconFileKey CFSTRP('tsInputMethodIconFileKey')}
  1347. {$endc}
  1348. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1349. {$definec kTSInputMethodAlternateIconFileKey CFSTRP('tsInputMethodAlternateIconFileKey')}
  1350. {$endc}
  1351. {
  1352. Key for dictionary of individual input modes
  1353. NOTE: This key is used both in the Component bundle's Info.plist dictionary and the dictionary
  1354. returned by the CopyTextServiceInputModeList() component call.
  1355. }
  1356. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1357. {$definec kTSInputModeListKey CFSTRP('tsInputModeListKey')}
  1358. {$endc}
  1359. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1360. {$definec kTSInputModeMenuIconFileKey CFSTRP('tsInputModeMenuIconFileKey')}
  1361. {$endc}
  1362. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1363. {$definec kTSInputModeAlternateMenuIconFileKey CFSTRP('tsInputModeAlternateMenuIconFileKey')}
  1364. {$endc}
  1365. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1366. {$definec kTSInputModePaletteIconFileKey CFSTRP('tsInputModePaletteIconFileKey')}
  1367. {$endc}
  1368. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1369. {$definec kTSInputModeDefaultStateKey CFSTRP('tsInputModeDefaultStateKey')}
  1370. {$endc}
  1371. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1372. {$definec kTSInputModeScriptKey CFSTRP('tsInputModeScriptKey')}
  1373. {$endc}
  1374. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1375. {$definec kTSInputModePrimaryInScriptKey CFSTRP('tsInputModePrimaryInScriptKey')}
  1376. {$endc}
  1377. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1378. {$definec kTSInputModeIsVisibleKey CFSTRP('tsInputModeIsVisibleKey')}
  1379. {$endc}
  1380. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1381. {$definec kTSInputModeKeyEquivalentModifiersKey CFSTRP('tsInputModeKeyEquivalentModifiersKey')}
  1382. {$endc}
  1383. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1384. {$definec kTSInputModeKeyEquivalentKey CFSTRP('tsInputModeKeyEquivalentKey')}
  1385. {$endc}
  1386. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1387. {$definec kTSInputModeJISKeyboardShortcutKey CFSTRP('tsInputModeJISKeyboardShortcutKey')}
  1388. {$endc}
  1389. {
  1390. Key for array of visible input modes to determine UI ordering
  1391. NOTE: This key is intended to be used both in the Component bundle's Info.plist dictionary and in
  1392. in the dictionary returned by the CopyTextServiceInputModeList() component call. In the latter
  1393. case, the array should contain only the set of visible input modes that are also enabled.
  1394. }
  1395. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1396. {$definec kTSVisibleInputModeOrderedArrayKey CFSTRP('tsVisibleInputModeOrderedArrayKey')}
  1397. {$endc}
  1398. {
  1399. Key for Component bundle's Info.plist, controls visibility in System UI.
  1400. Value is a CFBoolean.
  1401. NOTE: Keyboard input methods are always visible in System UI.
  1402. }
  1403. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1404. {$definec kComponentBundleInvisibleInSystemUIKey CFSTRP('ComponentInvisibleInSystemUI')}
  1405. {$endc}
  1406. {$ifc not TARGET_CPU_64}
  1407. {
  1408. * TSMCopyInputMethodEnabledInputModes() *** DEPRECATED ***
  1409. *
  1410. * Deprecated:
  1411. * Use TISCreateInputSourceList API with:
  1412. * kTISPropertyInputSourceType = kTISTypeKeyboardInputMode
  1413. * kTISPropertyBundleID = <your input method bundle identifier>
  1414. * <BR> kTISPropertyInputSourceIsEnabled = true
  1415. *
  1416. * Summary:
  1417. * Obtain the array of a component's enabled (and visible) input
  1418. * modes.
  1419. *
  1420. * Discussion:
  1421. * The intended use of this API is to allow an input method to query
  1422. * the System for the subset of its own input modes that are
  1423. * enabled, so that the component's own UI can ommit input modes
  1424. * disabled by the user or the System. This API is only meaningful
  1425. * for input methods that adopt the Input Mode protocol. If the
  1426. * component passed is not inputMode-savvy, the returned array will
  1427. * be NULL. The enabled input modes returned in the array are always
  1428. * visible ones, i.e. those input modes for which
  1429. * kTSInputModeIsVisibleKey is true because non-visible input modes
  1430. * are not tracked by the System. It is the responsibility of the
  1431. * caller to release the returned array. <array> <value>
  1432. * modeSignature : (internal ascii name) </value> </array> Available
  1433. * in TSM 2.2 and later
  1434. *
  1435. * Mac OS X threading:
  1436. * Not thread safe
  1437. *
  1438. * Availability:
  1439. * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1440. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  1441. * Non-Carbon CFM: not available
  1442. }
  1443. function TSMCopyInputMethodEnabledInputModes( inComponent: Component; var outInputModeArray: CFArrayRef ): Boolean; external name '_TSMCopyInputMethodEnabledInputModes';
  1444. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1445. {
  1446. * TSMSelectInputMode() *** DEPRECATED ***
  1447. *
  1448. * Deprecated:
  1449. * Use TISSelectInputSource API passing your input mode's
  1450. * TISInputSourceRef
  1451. *
  1452. * Summary:
  1453. * Make the specified input method input mode the current input
  1454. * source.
  1455. *
  1456. * Discussion:
  1457. * The intended use of this API is to allow an input method to
  1458. * select one of its own input modes as the current input source and
  1459. * update the TextInput menu icon in the menubar. This API is only
  1460. * meaningful for input methods that adopt TSM's Input Mode
  1461. * protocol. Available in TSM 2.2 and later
  1462. *
  1463. * Mac OS X threading:
  1464. * Not thread safe
  1465. *
  1466. * Availability:
  1467. * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1468. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  1469. * Non-Carbon CFM: not available
  1470. }
  1471. function TSMSelectInputMode( inComponent: Component; inInputMode: CFStringRef ): OSStatus; external name '_TSMSelectInputMode';
  1472. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1473. { Get the active TSMDocument in the current application context. }
  1474. { If TSM has enabled bottom line input mode because no TSMDocument }
  1475. { is active, NULL will be returned. }
  1476. {$endc} {not TARGET_CPU_64}
  1477. {
  1478. * TSMGetActiveDocument()
  1479. *
  1480. * Mac OS X threading:
  1481. * Not thread safe
  1482. *
  1483. * Availability:
  1484. * Mac OS X: in version 10.0 and later in Carbon.framework
  1485. * CarbonLib: in CarbonLib 1.3 and later
  1486. * Non-Carbon CFM: not available
  1487. }
  1488. function TSMGetActiveDocument: TSMDocumentID; external name '_TSMGetActiveDocument';
  1489. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1490. {$ifc not TARGET_CPU_64}
  1491. {
  1492. * GetDefaultInputMethodOfClass() *** DEPRECATED ***
  1493. *
  1494. * Deprecated:
  1495. * See GetDefaultInputMethod.
  1496. *
  1497. * Summary:
  1498. * Get the default (last used) input method Component ID for the
  1499. * specified script/language.
  1500. *
  1501. * Discussion:
  1502. * Only kKeyboardInputMethodClass is supported.
  1503. *
  1504. * Mac OS X threading:
  1505. * Not thread safe
  1506. *
  1507. * Availability:
  1508. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1509. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1510. * Non-Carbon CFM: not available
  1511. }
  1512. function GetDefaultInputMethodOfClass( var aComp: Component; var slRecPtr: ScriptLanguageRecord; tsClass: TextServiceClass ): OSStatus; external name '_GetDefaultInputMethodOfClass';
  1513. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1514. {
  1515. * SetDefaultInputMethodOfClass() *** DEPRECATED ***
  1516. *
  1517. * Deprecated:
  1518. * See SetDefaultInputMethod.
  1519. *
  1520. * Summary:
  1521. * Set the input method Component ID to be used for the specified
  1522. * script/language.
  1523. *
  1524. * Discussion:
  1525. * Only kKeyboardInputMethodClass is supported.
  1526. * This API also switches to the specified script/language.
  1527. *
  1528. * Mac OS X threading:
  1529. * Not thread safe
  1530. *
  1531. * Availability:
  1532. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1533. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1534. * Non-Carbon CFM: not available
  1535. }
  1536. function SetDefaultInputMethodOfClass( aComp: Component; var slRecPtr: ScriptLanguageRecord; tsClass: TextServiceClass ): OSStatus; external name '_SetDefaultInputMethodOfClass';
  1537. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1538. {
  1539. * SelectTextService() *** DEPRECATED ***
  1540. *
  1541. * Deprecated:
  1542. * Use TISSelectInputSource API.
  1543. *
  1544. * Summary:
  1545. * Select a text service component
  1546. *
  1547. * Discussion:
  1548. * This API is currently only intended for use by input methods in
  1549. * text service classes which are "additive" in nature, that is
  1550. * where the input method can operate in parallel to other input
  1551. * methods in the same class and other additive text service
  1552. * classes. An example of such a class is the Character Palette
  1553. * class. It is not for use by traditional input methods, such as
  1554. * those that belong to the keyboard input method class.
  1555. *
  1556. * Mac OS X threading:
  1557. * Not thread safe
  1558. *
  1559. * Availability:
  1560. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1561. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1562. * Non-Carbon CFM: not available
  1563. }
  1564. function SelectTextService( aComp: Component ): OSStatus; external name '_SelectTextService';
  1565. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1566. {
  1567. * DeselectTextService() *** DEPRECATED ***
  1568. *
  1569. * Deprecated:
  1570. * Use TISDeselectInputSource API.
  1571. *
  1572. * Summary:
  1573. * Deselect a text service component
  1574. *
  1575. * Discussion:
  1576. * See SelectTextService.
  1577. *
  1578. * Mac OS X threading:
  1579. * Not thread safe
  1580. *
  1581. * Availability:
  1582. * Mac OS X: in version 10.2 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1583. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1584. * Non-Carbon CFM: not available
  1585. }
  1586. function DeselectTextService( aComp: Component ): OSStatus; external name '_DeselectTextService';
  1587. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1588. {
  1589. * IsTextServiceSelected() *** DEPRECATED ***
  1590. *
  1591. * Deprecated:
  1592. * Use TISGetInputSourceProperty API with
  1593. * kTISPropertyInputSourceIsSelected property.
  1594. *
  1595. * Summary:
  1596. * Checks if a text service component is selected
  1597. *
  1598. * Discussion:
  1599. * See SelectTextService.
  1600. *
  1601. * Mac OS X threading:
  1602. * Not thread safe
  1603. *
  1604. * Availability:
  1605. * Mac OS X: in version 10.3 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1606. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
  1607. * Non-Carbon CFM: not available
  1608. }
  1609. function IsTextServiceSelected( aComp: Component ): Boolean; external name '_IsTextServiceSelected';
  1610. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1611. {$endc} {not TARGET_CPU_64}
  1612. {-------------------------------------------}
  1613. { Input Mode Palette configuration routines }
  1614. {-------------------------------------------}
  1615. {$ifc not TARGET_CPU_64}
  1616. {
  1617. * TSMInputModePaletteLoadButtons() *** DEPRECATED ***
  1618. *
  1619. * Deprecated:
  1620. * Not used anymore.
  1621. *
  1622. * Discussion:
  1623. * Notifies the Input Mode Palette of changes in an input method's
  1624. * controls. Replaces the current controls with the new control
  1625. * array.
  1626. *
  1627. * Mac OS X threading:
  1628. * Not thread safe
  1629. *
  1630. * Parameters:
  1631. *
  1632. * paletteButtonsArray:
  1633. * CFArray containing descriptions of the controls. Each control
  1634. * is described using a CFDictionary, using the keys described
  1635. * below.
  1636. *
  1637. * Availability:
  1638. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1639. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1640. * Non-Carbon CFM: not available
  1641. }
  1642. procedure TSMInputModePaletteLoadButtons( paletteButtonsArray: CFArrayRef ); external name '_TSMInputModePaletteLoadButtons';
  1643. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1644. {
  1645. * TSMInputModePaletteUpdateButtons() *** DEPRECATED ***
  1646. *
  1647. * Deprecated:
  1648. * Not used anymore.
  1649. *
  1650. * Discussion:
  1651. * Notifies the Input Mode Palette of updates in an input method's
  1652. * controls. Will update controls based on the control tag ID.
  1653. * Does not replace/remove existing controls.
  1654. *
  1655. * Mac OS X threading:
  1656. * Not thread safe
  1657. *
  1658. * Parameters:
  1659. *
  1660. * paletteButtonsArray:
  1661. * CFArray containing descriptions of the controls. Each control
  1662. * is described using a CFDictionary, using the keys described
  1663. * below.
  1664. *
  1665. * Availability:
  1666. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1667. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1668. * Non-Carbon CFM: not available
  1669. }
  1670. procedure TSMInputModePaletteUpdateButtons( paletteButtonsArray: CFArrayRef ); external name '_TSMInputModePaletteUpdateButtons';
  1671. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1672. {----------------------------------------------------------------------------}
  1673. { CFDictionary keys used to build the control description passed }
  1674. { to TSMInputModePaletteLoadButtons() and TSMInputModePaletteUpdateButtons() }
  1675. {----------------------------------------------------------------------------}
  1676. {******************************************************
  1677. Example of palette controls CFArray passed to TSMInputModePaletteLoadButtons():
  1678. Buttons consist of a CFDictionary containing:
  1679. - itemType
  1680. - icon
  1681. - alternate icon
  1682. - ID
  1683. - enabled
  1684. - state
  1685. Pulldown menus consist of a CFDictionary containing:
  1686. - itemType
  1687. - icon
  1688. - alternate icon
  1689. - ID
  1690. <array>
  1691. <dict>
  1692. <!-- item 1 - a push button -->
  1693. <key>tsInputModePaletteItemTypeKey</key>
  1694. <integer>0</integer>
  1695. <key>tsInputModePaletteItemIconKey</key>
  1696. <string>modeButton1.tif</string>
  1697. <key>tsInputModePaletteItemAltIconKey</key>
  1698. <string>modeButton1Alt.tif</string>
  1699. <key>tsInputModePaletteItemIDKey</key>
  1700. <integer>1</integer>
  1701. <key>tsInputModePaletteItemEnabledKey</key>
  1702. <true/>
  1703. <key>tsInputModePaletteItemStateKey</key>
  1704. <integer>0</integer>
  1705. </dict>
  1706. <dict>
  1707. <!-- item 2 - a pulldown menu -->
  1708. <key>tsInputModePaletteItemTypeKey</key>
  1709. <integer>2</integer>
  1710. <key>tsInputModePaletteItemIconKey</key>
  1711. <string>modeMenu1.tif</string>
  1712. <key>tsInputModePaletteItemAltIconKey</key>
  1713. <string>modeMenu1Alt.tif</string>
  1714. <key>tsInputModePaletteItemIDKey</key>
  1715. <integer>2</integer>
  1716. </dict>
  1717. </array>
  1718. ******************************************************}
  1719. {$endc} {not TARGET_CPU_64}
  1720. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1721. {$definec kTSInputModePaletteItemTypeKey CFSTRP('tsInputModePaletteItemTypeKey')}
  1722. {$endc}
  1723. { CFNumber - the type of control (0: push button, 1: toggle button, 2: pulldown menu) }
  1724. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1725. {$definec kTSInputModePaletteItemIconKey CFSTRP('tsInputModePaletteItemIconKey')}
  1726. {$endc}
  1727. { CFString - icon file name (File located in IM bundle's resource directory, so this is just the file name, not full path) }
  1728. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1729. {$definec kTSInputModePaletteItemAltIconKey CFSTRP('tsInputModePaletteItemAltIconKey')}
  1730. {$endc}
  1731. { CFString - alternate icon file name (File located in IM bundle's resource directory, so this is just the file name, not full path) }
  1732. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1733. {$definec kTSInputModePaletteItemStateKey CFSTRP('tsInputModePaletteItemStateKey')}
  1734. {$endc}
  1735. { CFNumber - state of the control (0: clear/unpressed, 1: checked/pressed, 2: mixed) }
  1736. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1737. {$definec kTSInputModePaletteItemEnabledKey CFSTRP('tsInputModePaletteItemEnabledKey')}
  1738. {$endc}
  1739. { CFBoolean - enabled state of the control }
  1740. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1741. {$definec kTSInputModePaletteItemIDKey CFSTRP('tsInputModePaletteItemIDKey')}
  1742. {$endc}
  1743. { CFNumber - UInt32 tag ID for control }
  1744. {$ifc not TARGET_CPU_64}
  1745. {
  1746. * InputModePaletteItemHit() *** DEPRECATED ***
  1747. *
  1748. * Deprecated:
  1749. * No longer called.
  1750. *
  1751. * Discussion:
  1752. * Component Manager call to tell an Input Method that a function
  1753. * button on the Input Mode Palette was pressed.
  1754. *
  1755. * Mac OS X threading:
  1756. * Not thread safe
  1757. *
  1758. * Parameters:
  1759. *
  1760. * inInstance:
  1761. * The component instance.
  1762. *
  1763. * inItemID:
  1764. * The item ID of the function button pressed on the palette.
  1765. *
  1766. * inItemState:
  1767. * The new state of the button.
  1768. *
  1769. * Result:
  1770. * Return non-null on successful handling of call.
  1771. *
  1772. * Availability:
  1773. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1774. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1775. * Non-Carbon CFM: not available
  1776. }
  1777. function InputModePaletteItemHit( inInstance: ComponentInstance; inItemID: UInt32; inItemState: UInt32 ): ComponentResult; external name '_InputModePaletteItemHit';
  1778. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1779. {
  1780. * GetInputModePaletteMenu() *** DEPRECATED ***
  1781. *
  1782. * Deprecated:
  1783. * No longer called.
  1784. *
  1785. * Discussion:
  1786. * Component Manager call to ask an Input Method for the menu to
  1787. * display for a pull-down menu on the Input Mode Palette.
  1788. *
  1789. * Mac OS X threading:
  1790. * Not thread safe
  1791. *
  1792. * Parameters:
  1793. *
  1794. * inInstance:
  1795. * The component instance.
  1796. *
  1797. * inItemID:
  1798. * The item ID of the pull-down menu button.
  1799. *
  1800. * outMenuItemsArray:
  1801. * The menu array to return to the Input Mode Palette.
  1802. *
  1803. * Result:
  1804. * Return non-null on successful handling of call.
  1805. *
  1806. * Availability:
  1807. * Mac OS X: in version 10.4 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1808. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.4 and later
  1809. * Non-Carbon CFM: not available
  1810. }
  1811. function GetInputModePaletteMenu( inInstance: ComponentInstance; inItemID: UInt32; var outMenuItemsArray: CFArrayRef ): ComponentResult; external name '_GetInputModePaletteMenu';
  1812. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1813. {----------------------------------------------------------}
  1814. { CFDictionary keys for menu definition returned }
  1815. { for kCMGetInputModePaletteMenu/GetInputModePaletteMenu() }
  1816. {----------------------------------------------------------}
  1817. {******************************************************
  1818. Example of menu CFArray returned to GetInputModePaletteMenu():
  1819. Pull-down menus consist of an array of CFDictionary's containing:
  1820. - title
  1821. - ID
  1822. - state
  1823. - enabled
  1824. - key equivalent (optional)
  1825. - key equivalent modifiers (optional)
  1826. <array>
  1827. <dict>
  1828. <!-- menu item w/ modifiers -->
  1829. <key>tsInputModePaletteItemTitleKey</key>
  1830. <string>menu item 1</string>
  1831. <key>tsInputModePaletteItemIDKey</key>
  1832. <integer>10</integer>
  1833. <key>tsInputModePaletteItemEnabledKey</key>
  1834. <true/>
  1835. <key>tsInputModePaletteItemStateKey</key>
  1836. <integer>0</integer>
  1837. <key>tsInputModePaletteItemKeyEquivalentKey</key>
  1838. <string>j</string>
  1839. <key>tsInputModePaletteItemKeyEquivalentModifiersKey</key>
  1840. <integer>2048</integer>
  1841. </dict>
  1842. <dict>
  1843. <!-- divider -->
  1844. <key>tsInputModePaletteItemTypeKey</key>
  1845. <string>-</string>
  1846. </dict>
  1847. <!-- menu item w/o modifiers -->
  1848. <key>tsInputModePaletteItemTitleKey</key>
  1849. <string>menu item 2</string>
  1850. <key>tsInputModePaletteItemIDKey</key>
  1851. <integer>11</integer>
  1852. <key>tsInputModePaletteItemEnabledKey</key>
  1853. <true/>
  1854. <key>tsInputModePaletteItemStateKey</key>
  1855. <integer>0</integer>
  1856. </dict>
  1857. </array>
  1858. ******************************************************}
  1859. {$endc} {not TARGET_CPU_64}
  1860. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1861. {$definec kTSInputModePaletteItemTitleKey CFSTRP('tsInputModePaletteItemTitleKey')}
  1862. {$endc}
  1863. { CFString - menu item title (use '-' for a separator) }
  1864. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1865. {$definec kTSInputModePaletteItemKeyEquivalentKey CFSTRP('tsInputModePaletteItemKeyEquivalentKey')}
  1866. {$endc}
  1867. { CFString - menu item keyboard shortcut (example: 'j') }
  1868. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1869. {$definec kTSInputModePaletteItemKeyEquivalentModifiersKey CFSTRP('tsInputModePaletteItemKeyEquivalentModifiersKey')}
  1870. {$endc}
  1871. { CFNumber - menu item keyboard shortcut modifiers (from Events.h) }
  1872. {$endc} {TARGET_OS_MAC}
  1873. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  1874. end.
  1875. {$endc} {not MACOSALLINCLUDE}