Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1001 lines
30 KiB

  1. /*
  2. File: TextServices.h
  3. Contains: Text Services Manager Interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1991-2001 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __TEXTSERVICES__
  11. #define __TEXTSERVICES__
  12. #ifndef __CONDITIONALMACROS__
  13. #include <ConditionalMacros.h>
  14. #endif
  15. #ifndef __MACTYPES__
  16. #include <MacTypes.h>
  17. #endif
  18. #ifndef __COMPONENTS__
  19. #include <Components.h>
  20. #endif
  21. #ifndef __AEDATAMODEL__
  22. #include <AEDataModel.h>
  23. #endif
  24. #ifndef __AEREGISTRY__
  25. #include <AERegistry.h>
  26. #endif
  27. #ifndef __EVENTS__
  28. #include <Events.h>
  29. #endif
  30. #ifndef __MENUS__
  31. #include <Menus.h>
  32. #endif
  33. #ifndef __AEINTERACTION__
  34. #include <AEInteraction.h>
  35. #endif
  36. #ifndef __ATSUNICODE__
  37. #include <ATSUnicode.h>
  38. #endif
  39. #if PRAGMA_ONCE
  40. #pragma once
  41. #endif
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45. #if PRAGMA_IMPORT
  46. #pragma import on
  47. #endif
  48. #if PRAGMA_STRUCT_ALIGN
  49. #pragma options align=mac68k
  50. #elif PRAGMA_STRUCT_PACKPUSH
  51. #pragma pack(push, 2)
  52. #elif PRAGMA_STRUCT_PACK
  53. #pragma pack(2)
  54. #endif
  55. enum {
  56. kTextService = FOUR_CHAR_CODE('tsvc'), /* component type for the component description */
  57. kTSMVersion = 0x0150 /* Version of the Text Services Manager is 1.5 */
  58. };
  59. /*
  60. TextServiceClass constants supported by TSM
  61. Same as component subtype for the component description
  62. */
  63. enum {
  64. kKeyboardInputMethodClass = FOUR_CHAR_CODE('inpm'),
  65. kInkInputMethodClass = FOUR_CHAR_CODE('ink '),
  66. kCharacterPaletteInputMethodClass = FOUR_CHAR_CODE('cplt')
  67. };
  68. typedef OSType TextServiceClass;
  69. enum {
  70. kTSClassHonorUserSetting = 1,
  71. kTSClassForceSetting = 2,
  72. kTSClassForceToHonorUserSetting = 3
  73. };
  74. typedef UInt32 TSClassEnablingForceLevel;
  75. enum {
  76. kUnicodeDocument = FOUR_CHAR_CODE('udoc'), /* TSM Document type for Unicode-savvy application */
  77. kUnicodeTextService = FOUR_CHAR_CODE('utsv') /* Component type for Unicode Text Service */
  78. };
  79. /* TSMDocumentID property tags*/
  80. enum {
  81. kTSMDocumentPropertySupportGlyphInfo = FOUR_CHAR_CODE('dpgi') /* property value is arbitrary*/
  82. };
  83. /* Language and Script constants*/
  84. enum {
  85. kUnknownLanguage = 0xFFFF,
  86. kUnknownScript = 0xFFFF,
  87. kNeutralScript = 0xFFFF
  88. };
  89. enum {
  90. /* Component Flags in ComponentDescription */
  91. bTakeActiveEvent = 15, /* bit set if the component takes active event */
  92. bHandleAERecording = 16, /* bit set if the component takes care of recording Apple Events <new in vers2.0> */
  93. bScriptMask = 0x00007F00, /* bit 8 - 14 */
  94. bLanguageMask = 0x000000FF, /* bit 0 - 7 */
  95. bScriptLanguageMask = bScriptMask + bLanguageMask /* bit 0 - 14 */
  96. };
  97. enum {
  98. /* Typing method property constants for Input Methods */
  99. kIMJaTypingMethodProperty = FOUR_CHAR_CODE('jtyp'), /* Typing method property for Japanese input methods*/
  100. kIMJaTypingMethodRoman = FOUR_CHAR_CODE('roma'), /* Roman typing*/
  101. kIMJaTypingMethodKana = FOUR_CHAR_CODE('kana') /* Kana typing*/
  102. };
  103. enum {
  104. /* Low level routines which are dispatched directly to the Component Manager */
  105. kCMGetScriptLangSupport = 0x0001, /* Component Manager call selector 1 */
  106. kCMInitiateTextService = 0x0002, /* Component Manager call selector 2 */
  107. kCMTerminateTextService = 0x0003, /* Component Manager call selector 3 */
  108. kCMActivateTextService = 0x0004, /* Component Manager call selector 4 */
  109. kCMDeactivateTextService = 0x0005, /* Component Manager call selector 5 */
  110. kCMTextServiceEvent = 0x0006, /* Component Manager call selector 6 */
  111. kCMGetTextServiceMenu = 0x0007, /* Component Manager call selector 7 */
  112. kCMTextServiceMenuSelect = 0x0008, /* Component Manager call selector 8 */
  113. kCMFixTextService = 0x0009, /* Component Manager call selector 9 */
  114. kCMSetTextServiceCursor = 0x000A, /* Component Manager call selector 10 */
  115. kCMHidePaletteWindows = 0x000B, /* Component Manager call selector 11 */
  116. kCMGetTextServiceProperty = 0x000C, /* Component Manager call selector 12 */
  117. kCMSetTextServiceProperty = 0x000D /* Component Manager call selector 13 */
  118. };
  119. enum {
  120. /* New low level routines which are dispatched directly to the Component Manager */
  121. kCMUCTextServiceEvent = 0x000E /* Component Manager call selector 14 */
  122. };
  123. /* extract Script/Language code from Component flag ... */
  124. #define mGetScriptCode(cdRec) ((ScriptCode) ((cdRec.componentFlags & bScriptMask) >> 8))
  125. #define mGetLanguageCode(cdRec) ((LangCode) cdRec.componentFlags & bLanguageMask)
  126. /* New opaque definitions for types */
  127. typedef struct OpaqueTSMDocumentID* TSMDocumentID;
  128. typedef OSType InterfaceTypeList[1];
  129. /* Text Service Info List */
  130. struct TextServiceInfo {
  131. Component fComponent;
  132. Str255 fItemName;
  133. };
  134. typedef struct TextServiceInfo TextServiceInfo;
  135. typedef TextServiceInfo * TextServiceInfoPtr;
  136. struct TextServiceList {
  137. short fTextServiceCount; /* number of entries in the 'fServices' array */
  138. TextServiceInfo fServices[1]; /* Note: array of 'TextServiceInfo' records follows */
  139. };
  140. typedef struct TextServiceList TextServiceList;
  141. typedef TextServiceList * TextServiceListPtr;
  142. typedef TextServiceListPtr * TextServiceListHandle;
  143. struct ScriptLanguageRecord {
  144. ScriptCode fScript;
  145. LangCode fLanguage;
  146. };
  147. typedef struct ScriptLanguageRecord ScriptLanguageRecord;
  148. struct ScriptLanguageSupport {
  149. short fScriptLanguageCount; /* number of entries in the 'fScriptLanguageArray' array */
  150. ScriptLanguageRecord fScriptLanguageArray[1]; /* Note: array of 'ScriptLanguageRecord' records follows */
  151. };
  152. typedef struct ScriptLanguageSupport ScriptLanguageSupport;
  153. typedef ScriptLanguageSupport * ScriptLanguageSupportPtr;
  154. typedef ScriptLanguageSupportPtr * ScriptLanguageSupportHandle;
  155. struct TSMGlyphInfo {
  156. CFRange range; /* two SInt32s*/
  157. ATSFontRef fontRef;
  158. UInt16 collection; /* kGlyphCollectionXXX enum*/
  159. UInt16 glyphID; /* GID (when collection==0) or CID*/
  160. };
  161. typedef struct TSMGlyphInfo TSMGlyphInfo;
  162. struct TSMGlyphInfoArray {
  163. ItemCount numGlyphInfo; /* UInt32*/
  164. TSMGlyphInfo glyphInfo[1];
  165. };
  166. typedef struct TSMGlyphInfoArray TSMGlyphInfoArray;
  167. /* High level TSM Doucment routines */
  168. /*
  169. * NewTSMDocument()
  170. *
  171. * Availability:
  172. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  173. * CarbonLib: in CarbonLib 1.0 and later
  174. * Mac OS X: in version 10.0 and later
  175. */
  176. EXTERN_API( OSErr )
  177. NewTSMDocument(
  178. short numOfInterface,
  179. InterfaceTypeList supportedInterfaceTypes,
  180. TSMDocumentID * idocID,
  181. long refcon) TWOWORDINLINE(0x7000, 0xAA54);
  182. /*
  183. * DeleteTSMDocument()
  184. *
  185. * Availability:
  186. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  187. * CarbonLib: in CarbonLib 1.0 and later
  188. * Mac OS X: in version 10.0 and later
  189. */
  190. EXTERN_API( OSErr )
  191. DeleteTSMDocument(TSMDocumentID idocID) TWOWORDINLINE(0x7001, 0xAA54);
  192. /*
  193. * ActivateTSMDocument()
  194. *
  195. * Availability:
  196. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  197. * CarbonLib: in CarbonLib 1.0 and later
  198. * Mac OS X: in version 10.0 and later
  199. */
  200. EXTERN_API( OSErr )
  201. ActivateTSMDocument(TSMDocumentID idocID) TWOWORDINLINE(0x7002, 0xAA54);
  202. /*
  203. * DeactivateTSMDocument()
  204. *
  205. * Availability:
  206. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  207. * CarbonLib: in CarbonLib 1.0 and later
  208. * Mac OS X: in version 10.0 and later
  209. */
  210. EXTERN_API( OSErr )
  211. DeactivateTSMDocument(TSMDocumentID idocID) TWOWORDINLINE(0x7003, 0xAA54);
  212. /*
  213. * FixTSMDocument()
  214. *
  215. * Availability:
  216. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  217. * CarbonLib: in CarbonLib 1.0 and later
  218. * Mac OS X: in version 10.0 and later
  219. */
  220. EXTERN_API( OSErr )
  221. FixTSMDocument(TSMDocumentID idocID) TWOWORDINLINE(0x7007, 0xAA54);
  222. /*
  223. * GetServiceList()
  224. *
  225. * Availability:
  226. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  227. * CarbonLib: in CarbonLib 1.0 and later
  228. * Mac OS X: in version 10.0 and later
  229. */
  230. EXTERN_API( OSErr )
  231. GetServiceList(
  232. short numOfInterface,
  233. OSType * supportedInterfaceTypes,
  234. TextServiceListHandle * serviceInfo,
  235. long * seedValue) TWOWORDINLINE(0x7008, 0xAA54);
  236. /*
  237. * OpenTextService()
  238. *
  239. * Availability:
  240. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  241. * CarbonLib: in CarbonLib 1.0 and later
  242. * Mac OS X: in version 10.0 and later
  243. */
  244. EXTERN_API( OSErr )
  245. OpenTextService(
  246. TSMDocumentID idocID,
  247. Component aComponent,
  248. ComponentInstance * aComponentInstance) TWOWORDINLINE(0x7009, 0xAA54);
  249. /*
  250. * CloseTextService()
  251. *
  252. * Availability:
  253. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  254. * CarbonLib: in CarbonLib 1.0 and later
  255. * Mac OS X: in version 10.0 and later
  256. */
  257. EXTERN_API( OSErr )
  258. CloseTextService(
  259. TSMDocumentID idocID,
  260. ComponentInstance aComponentInstance) TWOWORDINLINE(0x700A, 0xAA54);
  261. /*
  262. * SendAEFromTSMComponent()
  263. *
  264. * Availability:
  265. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  266. * CarbonLib: in CarbonLib 1.0 and later
  267. * Mac OS X: in version 10.0 and later
  268. */
  269. EXTERN_API( OSErr )
  270. SendAEFromTSMComponent(
  271. const AppleEvent * theAppleEvent,
  272. AppleEvent * reply,
  273. AESendMode sendMode,
  274. AESendPriority sendPriority,
  275. long timeOutInTicks,
  276. AEIdleUPP idleProc,
  277. AEFilterUPP filterProc) TWOWORDINLINE(0x700B, 0xAA54);
  278. /*
  279. * SendTextInputEvent()
  280. *
  281. * Discussion:
  282. * This API replaces SendAEFromTSMComponent on Mac OS X only. Input
  283. * Methods on Mac OS X are Carbon Event based instead of AppleEvent
  284. * based. The Carbon TextInput events which they generate are
  285. * provided to TSM for dispatching via this API.
  286. *
  287. * Availability:
  288. * Non-Carbon CFM: not available
  289. * CarbonLib: in CarbonLib N.e.v.e.r and later
  290. * Mac OS X: in version 10.0 and later
  291. */
  292. EXTERN_API( OSStatus )
  293. SendTextInputEvent(EventRef inEvent);
  294. /*
  295. * SetDefaultInputMethod()
  296. *
  297. * Availability:
  298. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  299. * CarbonLib: in CarbonLib 1.0 and later
  300. * Mac OS X: in version 10.0 and later
  301. */
  302. EXTERN_API( OSErr )
  303. SetDefaultInputMethod(
  304. Component ts,
  305. ScriptLanguageRecord * slRecordPtr) TWOWORDINLINE(0x700C, 0xAA54);
  306. /*
  307. * GetDefaultInputMethod()
  308. *
  309. * Availability:
  310. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  311. * CarbonLib: in CarbonLib 1.0 and later
  312. * Mac OS X: in version 10.0 and later
  313. */
  314. EXTERN_API( OSErr )
  315. GetDefaultInputMethod(
  316. Component * ts,
  317. ScriptLanguageRecord * slRecordPtr) TWOWORDINLINE(0x700D, 0xAA54);
  318. /*
  319. * SetTextServiceLanguage()
  320. *
  321. * Availability:
  322. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  323. * CarbonLib: in CarbonLib 1.0 and later
  324. * Mac OS X: in version 10.0 and later
  325. */
  326. EXTERN_API( OSErr )
  327. SetTextServiceLanguage(ScriptLanguageRecord * slRecordPtr) TWOWORDINLINE(0x700E, 0xAA54);
  328. /*
  329. * GetTextServiceLanguage()
  330. *
  331. * Availability:
  332. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  333. * CarbonLib: in CarbonLib 1.0 and later
  334. * Mac OS X: in version 10.0 and later
  335. */
  336. EXTERN_API( OSErr )
  337. GetTextServiceLanguage(ScriptLanguageRecord * slRecordPtr) TWOWORDINLINE(0x700F, 0xAA54);
  338. /*
  339. * UseInputWindow()
  340. *
  341. * Availability:
  342. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  343. * CarbonLib: in CarbonLib 1.0 and later
  344. * Mac OS X: in version 10.0 and later
  345. */
  346. EXTERN_API( OSErr )
  347. UseInputWindow(
  348. TSMDocumentID idocID,
  349. Boolean useWindow) TWOWORDINLINE(0x7010, 0xAA54);
  350. /*
  351. * TSMSetInlineInputRegion()
  352. *
  353. * Discussion:
  354. * Tell TSM about the region occupied by an inline input session. If
  355. * the location of certain mouse events (clicks, mouse moved) occur
  356. * within the specified inline input region, TSM will forward these
  357. * events to the current Input Method so that it can interact with
  358. * the user. Note: If you do not specify this information, TSM will
  359. * need to intercept mouse events in the entire content region as
  360. * the default, when an input method is active, in order to ensure
  361. * that input methods can manage user interaction properly.
  362. *
  363. * Parameters:
  364. *
  365. * inTSMDocument:
  366. * The document.
  367. *
  368. * inWindow:
  369. * The window that contains the inline input session. You can pass
  370. * NULL for this parameter to indicate the user focus window.
  371. *
  372. * inRegion:
  373. * The region occupied by the current inline input region. This
  374. * should be in the coordinates of the port associated with the
  375. * window you passed to inPort. It will need to be recomputed when
  376. * the text content of the inline input session content changes
  377. * (i.e. due to Update Active Input Area events) and when the
  378. * region moves for other reasons, such as window resized,
  379. * scrolling, etc. If you pass a NULL region for this parameter,
  380. * TSM will default to intercept mouse events in the focus
  381. * window's content region.
  382. *
  383. * Availability:
  384. * Non-Carbon CFM: not available
  385. * CarbonLib: in CarbonLib 1.1 and later
  386. * Mac OS X: in version 10.0 and later
  387. */
  388. EXTERN_API( OSStatus )
  389. TSMSetInlineInputRegion(
  390. TSMDocumentID inTSMDocument,
  391. WindowRef inWindow,
  392. RgnHandle inRegion);
  393. /* Following calls from Classic event loops not needed for Carbon clients. */
  394. #if CALL_NOT_IN_CARBON
  395. /*
  396. * TSMEvent()
  397. *
  398. * Availability:
  399. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  400. * CarbonLib: not available
  401. * Mac OS X: not available
  402. */
  403. EXTERN_API( Boolean )
  404. TSMEvent(EventRecord * event) TWOWORDINLINE(0x7004, 0xAA54);
  405. /*
  406. * TSMMenuSelect()
  407. *
  408. * Availability:
  409. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  410. * CarbonLib: not available
  411. * Mac OS X: not available
  412. */
  413. EXTERN_API( Boolean )
  414. TSMMenuSelect(long menuResult) TWOWORDINLINE(0x7005, 0xAA54);
  415. /*
  416. * SetTSMCursor()
  417. *
  418. * Availability:
  419. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  420. * CarbonLib: not available
  421. * Mac OS X: not available
  422. */
  423. EXTERN_API( Boolean )
  424. SetTSMCursor(Point mousePos) TWOWORDINLINE(0x7006, 0xAA54);
  425. /* Following ServiceWindow API replaced by Window Manager API in Carbon. */
  426. /*
  427. * NewServiceWindow()
  428. *
  429. * Availability:
  430. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  431. * CarbonLib: not available
  432. * Mac OS X: not available
  433. */
  434. EXTERN_API( OSErr )
  435. NewServiceWindow(
  436. void * wStorage,
  437. const Rect * boundsRect,
  438. ConstStr255Param title,
  439. Boolean visible,
  440. short theProc,
  441. WindowRef behind,
  442. Boolean goAwayFlag,
  443. ComponentInstance ts,
  444. WindowRef * window) TWOWORDINLINE(0x7011, 0xAA54);
  445. /*
  446. * CloseServiceWindow()
  447. *
  448. * Availability:
  449. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  450. * CarbonLib: not available
  451. * Mac OS X: not available
  452. */
  453. EXTERN_API( OSErr )
  454. CloseServiceWindow(WindowRef window) TWOWORDINLINE(0x7012, 0xAA54);
  455. /*
  456. * GetFrontServiceWindow()
  457. *
  458. * Availability:
  459. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  460. * CarbonLib: not available
  461. * Mac OS X: not available
  462. */
  463. EXTERN_API( OSErr )
  464. GetFrontServiceWindow(WindowRef * window) TWOWORDINLINE(0x7013, 0xAA54);
  465. /*
  466. * FindServiceWindow()
  467. *
  468. * Availability:
  469. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  470. * CarbonLib: not available
  471. * Mac OS X: not available
  472. */
  473. EXTERN_API( short )
  474. FindServiceWindow(
  475. Point thePoint,
  476. WindowRef * theWindow) TWOWORDINLINE(0x7017, 0xAA54);
  477. /*
  478. * NewCServiceWindow()
  479. *
  480. * Availability:
  481. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  482. * CarbonLib: not available
  483. * Mac OS X: not available
  484. */
  485. EXTERN_API( OSErr )
  486. NewCServiceWindow(
  487. void * wStorage,
  488. const Rect * boundsRect,
  489. ConstStr255Param title,
  490. Boolean visible,
  491. short theProc,
  492. WindowRef behind,
  493. Boolean goAwayFlag,
  494. ComponentInstance ts,
  495. WindowRef * window) TWOWORDINLINE(0x701A, 0xAA54);
  496. /* Explicit initialization not needed for Carbon clients, since TSM is */
  497. /* instanciated per-context. */
  498. /*
  499. * InitTSMAwareApplication()
  500. *
  501. * Availability:
  502. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  503. * CarbonLib: not available
  504. * Mac OS X: not available
  505. */
  506. EXTERN_API( OSErr )
  507. InitTSMAwareApplication(void) TWOWORDINLINE(0x7014, 0xAA54);
  508. /*
  509. * CloseTSMAwareApplication()
  510. *
  511. * Availability:
  512. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  513. * CarbonLib: not available
  514. * Mac OS X: not available
  515. */
  516. EXTERN_API( OSErr )
  517. CloseTSMAwareApplication(void) TWOWORDINLINE(0x7015, 0xAA54);
  518. /* Component Manager Interfaces to Input Methods */
  519. #endif /* CALL_NOT_IN_CARBON */
  520. /*
  521. * GetScriptLanguageSupport()
  522. *
  523. * Availability:
  524. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  525. * CarbonLib: in CarbonLib 1.0 and later
  526. * Mac OS X: in version 10.0 and later
  527. */
  528. EXTERN_API( ComponentResult )
  529. GetScriptLanguageSupport(
  530. ComponentInstance ts,
  531. ScriptLanguageSupportHandle * scriptHdl) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  532. /*
  533. * InitiateTextService()
  534. *
  535. * Availability:
  536. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  537. * CarbonLib: in CarbonLib 1.0 and later
  538. * Mac OS X: in version 10.0 and later
  539. */
  540. EXTERN_API( ComponentResult )
  541. InitiateTextService(ComponentInstance ts) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0002, 0x7000, 0xA82A);
  542. /*
  543. * TerminateTextService()
  544. *
  545. * Availability:
  546. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  547. * CarbonLib: in CarbonLib 1.0 and later
  548. * Mac OS X: in version 10.0 and later
  549. */
  550. EXTERN_API( ComponentResult )
  551. TerminateTextService(ComponentInstance ts) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0003, 0x7000, 0xA82A);
  552. /*
  553. * ActivateTextService()
  554. *
  555. * Availability:
  556. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  557. * CarbonLib: in CarbonLib 1.0 and later
  558. * Mac OS X: in version 10.0 and later
  559. */
  560. EXTERN_API( ComponentResult )
  561. ActivateTextService(ComponentInstance ts) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0004, 0x7000, 0xA82A);
  562. /*
  563. * DeactivateTextService()
  564. *
  565. * Availability:
  566. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  567. * CarbonLib: in CarbonLib 1.0 and later
  568. * Mac OS X: in version 10.0 and later
  569. */
  570. EXTERN_API( ComponentResult )
  571. DeactivateTextService(ComponentInstance ts) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0005, 0x7000, 0xA82A);
  572. /*
  573. * GetTextServiceMenu()
  574. *
  575. * Availability:
  576. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  577. * CarbonLib: in CarbonLib 1.0 and later
  578. * Mac OS X: in version 10.0 and later
  579. */
  580. EXTERN_API( ComponentResult )
  581. GetTextServiceMenu(
  582. ComponentInstance ts,
  583. MenuRef * serviceMenu) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  584. /* New Text Service call in Carbon. */
  585. /* Note: Only Raw Key and Mouse-flavored events are passed to Text Services on MacOS X. */
  586. /*
  587. * TextServiceEventRef()
  588. *
  589. * Availability:
  590. * Non-Carbon CFM: not available
  591. * CarbonLib: in CarbonLib 1.1 and later
  592. * Mac OS X: in version 10.0 and later
  593. */
  594. EXTERN_API( ComponentResult )
  595. TextServiceEventRef(
  596. ComponentInstance ts,
  597. EventRef event) FIVEWORDINLINE(0x2F3C, 0x0006, 0x0006, 0x7000, 0xA82A);
  598. #if CALL_NOT_IN_CARBON
  599. /*
  600. * TextServiceEvent()
  601. *
  602. * Availability:
  603. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  604. * CarbonLib: not available
  605. * Mac OS X: not available
  606. */
  607. EXTERN_API( ComponentResult )
  608. TextServiceEvent(
  609. ComponentInstance ts,
  610. short numOfEvents,
  611. EventRecord * event) FIVEWORDINLINE(0x2F3C, 0x0006, 0x0006, 0x7000, 0xA82A);
  612. /*
  613. * UCTextServiceEvent()
  614. *
  615. * Availability:
  616. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  617. * CarbonLib: not available
  618. * Mac OS X: not available
  619. */
  620. EXTERN_API( ComponentResult )
  621. UCTextServiceEvent(
  622. ComponentInstance ts,
  623. short numOfEvents,
  624. EventRecord * event,
  625. UniChar unicodeString[],
  626. UniCharCount unicodeStrLength) FIVEWORDINLINE(0x2F3C, 0x000E, 0x000E, 0x7000, 0xA82A);
  627. /*
  628. * TextServiceMenuSelect()
  629. *
  630. * Availability:
  631. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  632. * CarbonLib: not available
  633. * Mac OS X: not available
  634. */
  635. EXTERN_API( ComponentResult )
  636. TextServiceMenuSelect(
  637. ComponentInstance ts,
  638. MenuRef serviceMenu,
  639. short item) FIVEWORDINLINE(0x2F3C, 0x0006, 0x0008, 0x7000, 0xA82A);
  640. /*
  641. * SetTextServiceCursor()
  642. *
  643. * Availability:
  644. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  645. * CarbonLib: not available
  646. * Mac OS X: not available
  647. */
  648. EXTERN_API( ComponentResult )
  649. SetTextServiceCursor(
  650. ComponentInstance ts,
  651. Point mousePos) FIVEWORDINLINE(0x2F3C, 0x0004, 0x000A, 0x7000, 0xA82A);
  652. #endif /* CALL_NOT_IN_CARBON */
  653. /*
  654. * FixTextService()
  655. *
  656. * Availability:
  657. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  658. * CarbonLib: in CarbonLib 1.0 and later
  659. * Mac OS X: in version 10.0 and later
  660. */
  661. EXTERN_API( ComponentResult )
  662. FixTextService(ComponentInstance ts) FIVEWORDINLINE(0x2F3C, 0x0000, 0x0009, 0x7000, 0xA82A);
  663. /*
  664. * HidePaletteWindows()
  665. *
  666. * Availability:
  667. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  668. * CarbonLib: in CarbonLib 1.0 and later
  669. * Mac OS X: in version 10.0 and later
  670. */
  671. EXTERN_API( ComponentResult )
  672. HidePaletteWindows(ComponentInstance ts) FIVEWORDINLINE(0x2F3C, 0x0000, 0x000B, 0x7000, 0xA82A);
  673. /*
  674. * GetTextServiceProperty()
  675. *
  676. * Availability:
  677. * Non-Carbon CFM: not available
  678. * CarbonLib: in CarbonLib 1.0 and later
  679. * Mac OS X: in version 10.0 and later
  680. */
  681. EXTERN_API( ComponentResult )
  682. GetTextServiceProperty(
  683. ComponentInstance ts,
  684. OSType propertySelector,
  685. SInt32 * result) FIVEWORDINLINE(0x2F3C, 0x0008, 0x000C, 0x7000, 0xA82A);
  686. /*
  687. * SetTextServiceProperty()
  688. *
  689. * Availability:
  690. * Non-Carbon CFM: not available
  691. * CarbonLib: in CarbonLib 1.0 and later
  692. * Mac OS X: in version 10.0 and later
  693. */
  694. EXTERN_API( ComponentResult )
  695. SetTextServiceProperty(
  696. ComponentInstance ts,
  697. OSType propertySelector,
  698. SInt32 value) FIVEWORDINLINE(0x2F3C, 0x0008, 0x000D, 0x7000, 0xA82A);
  699. /* Get the active TSMDocument in the current application context. */
  700. /* If TSM has enabled bottom line input mode because no TSMDocument */
  701. /* is active, NULL will be returned. */
  702. /*
  703. * TSMGetActiveDocument()
  704. *
  705. * Availability:
  706. * Non-Carbon CFM: not available
  707. * CarbonLib: in CarbonLib 1.3 and later
  708. * Mac OS X: in version 10.0 and later
  709. */
  710. EXTERN_API( TSMDocumentID )
  711. TSMGetActiveDocument(void);
  712. /*
  713. * GetDefaultInputMethodOfClass()
  714. *
  715. * Availability:
  716. * Non-Carbon CFM: not available
  717. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  718. * Mac OS X: in version 10.2 and later
  719. */
  720. EXTERN_API( OSStatus )
  721. GetDefaultInputMethodOfClass(
  722. Component * aComp,
  723. ScriptLanguageRecord * slRecPtr,
  724. TextServiceClass tsClass);
  725. /*
  726. * SetDefaultInputMethodOfClass()
  727. *
  728. * Availability:
  729. * Non-Carbon CFM: not available
  730. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  731. * Mac OS X: in version 10.2 and later
  732. */
  733. EXTERN_API( OSStatus )
  734. SetDefaultInputMethodOfClass(
  735. Component aComp,
  736. ScriptLanguageRecord * slRecPtr,
  737. TextServiceClass tsClass);
  738. /*
  739. * DeselectTextService()
  740. *
  741. * Discussion:
  742. * This API is currently only intended for use by Character Palette
  743. * class input methods. It allows such an input method to notify TSM
  744. * that it has been closed by the user as a result of interaction
  745. * with the input method's own UI, such a palette window's close
  746. * button, instead of via the normal UI provided by the System, such
  747. * as the Keyboard Menu. Note that this API is only meant for use
  748. * with "additive" text service classes (such as Character
  749. * Palettes), and not with traditional input methods which are
  750. * exclusively selected in a given class and script, such as
  751. * keyboard input methods.
  752. *
  753. * Availability:
  754. * Non-Carbon CFM: not available
  755. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  756. * Mac OS X: in version 10.2 and later
  757. */
  758. EXTERN_API( OSStatus )
  759. DeselectTextService(Component aComp);
  760. /*
  761. * SelectTextService()
  762. *
  763. * Discussion:
  764. * This API is currently only intended for use by the system UI
  765. * (Keyboard Menu or prefs panel) and input methods that wish to set
  766. * to the "selected" state a text service which is "additive" in
  767. * nature. It is not intended for use with input methods that are
  768. * "exclusive" in nature (see DeselectTextService). It allows an
  769. * input method to notify TSM that it has been selected by the user
  770. * as a result of interaction with some UI (possibly another input
  771. * method), instead of via the normal UI provided by the System,
  772. * such as the Keyboard Menu.
  773. *
  774. * Availability:
  775. * Non-Carbon CFM: not available
  776. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  777. * Mac OS X: in version 10.2 and later
  778. */
  779. EXTERN_API( OSStatus )
  780. SelectTextService(Component aComp);
  781. /*
  782. * TSMSetDocumentProperty()
  783. *
  784. * Discussion:
  785. * This API is currently only needed for applications that wish to
  786. * signal to TSM that it supports GlyphID specification in TSM
  787. * events containing Unicode text (see
  788. * kTSMDocumentPropertySupportGlyphInfo). Input Methods call
  789. * TSMGetDocumentProperty() against the currently active TSMDocument
  790. * to test whether the app supports this glyph info. These TSM
  791. * property API can also be freely used by applications to relate
  792. * arbitrary data to a given TSMDocument.
  793. *
  794. * Availability:
  795. * Non-Carbon CFM: not available
  796. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  797. * Mac OS X: in version 10.2 and later
  798. */
  799. EXTERN_API( OSStatus )
  800. TSMSetDocumentProperty(
  801. TSMDocumentID docID,
  802. OSType propertyTag,
  803. UInt32 propertySize,
  804. void * propertyData);
  805. /*
  806. * TSMGetDocumentProperty()
  807. *
  808. * Availability:
  809. * Non-Carbon CFM: not available
  810. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  811. * Mac OS X: in version 10.2 and later
  812. */
  813. EXTERN_API( OSStatus )
  814. TSMGetDocumentProperty(
  815. TSMDocumentID docID,
  816. OSType propertyTag,
  817. UInt32 bufferSize,
  818. UInt32 * actualSize,
  819. void * propertyBuffer); /* can be NULL */
  820. /*
  821. * TSMRemoveDocumentProperty()
  822. *
  823. * Availability:
  824. * Non-Carbon CFM: not available
  825. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  826. * Mac OS X: in version 10.2 and later
  827. */
  828. EXTERN_API( OSStatus )
  829. TSMRemoveDocumentProperty(
  830. TSMDocumentID docID,
  831. OSType propertyTag);
  832. #if OLDROUTINENAMES
  833. enum {
  834. kInputMethodService = kKeyboardInputMethodClass
  835. };
  836. #endif /* OLDROUTINENAMES */
  837. #if PRAGMA_STRUCT_ALIGN
  838. #pragma options align=reset
  839. #elif PRAGMA_STRUCT_PACKPUSH
  840. #pragma pack(pop)
  841. #elif PRAGMA_STRUCT_PACK
  842. #pragma pack()
  843. #endif
  844. #ifdef PRAGMA_IMPORT_OFF
  845. #pragma import off
  846. #elif PRAGMA_IMPORT
  847. #pragma import reset
  848. #endif
  849. #ifdef __cplusplus
  850. }
  851. #endif
  852. #endif /* __TEXTSERVICES__ */