Mac OS 9
TextServices.h
Go to the documentation of this file.
1 
19 #ifndef __TEXTSERVICES__
20 #define __TEXTSERVICES__
21 
22 #ifndef __CONDITIONALMACROS__
23 #include <ConditionalMacros.h>
24 #endif
25 
26 #ifndef __MACTYPES__
27 #include <MacTypes.h>
28 #endif
29 
30 #ifndef __EVENTS__
31 #include <Events.h>
32 #endif
33 
34 #ifndef __MENUS__
35 #include <Menus.h>
36 #endif
37 
38 #ifndef __AEDATAMODEL__
39 #include <AEDataModel.h>
40 #endif
41 
42 #ifndef __AEREGISTRY__
43 #include <AERegistry.h>
44 #endif
45 
46 #ifndef __AEINTERACTION__
47 #include <AEInteraction.h>
48 #endif
49 
50 #ifndef __COMPONENTS__
51 #include <Components.h>
52 #endif
53 
54 #ifndef __CARBONEVENTS__
55 #include <CarbonEvents.h>
56 #endif
57 
58 #if PRAGMA_ONCE
59 #pragma once
60 #endif
61 
62 #ifdef __cplusplus
63 extern "C"
64 {
65 #endif
66 
67 #if PRAGMA_IMPORT
68 #pragma import on
69 #endif
70 
71 #if PRAGMA_STRUCT_ALIGN
72 #pragma options align = mac68k
73 #elif PRAGMA_STRUCT_PACKPUSH
74 #pragma pack(push, 2)
75 #elif PRAGMA_STRUCT_PACK
76 #pragma pack(2)
77 #endif
78 
79  enum
80  {
81  kTextService = FOUR_CHAR_CODE(
82  'tsvc'),
83  kInputMethodService = FOUR_CHAR_CODE(
84  'inpm'),
85  kTSMVersion = 0x0150
86  };
87 
88  enum
89  {
90  kUnicodeDocument = FOUR_CHAR_CODE(
91  'udoc'),
93  FOUR_CHAR_CODE('utsv')
94  };
95 
97  enum
98  {
99  kUnknownLanguage = 0xFFFF,
100  kUnknownScript = 0xFFFF,
101  kNeutralScript = 0xFFFF
102  };
103 
104  enum
105  {
110  bScriptMask = 0x00007F00,
111  bLanguageMask = 0x000000FF,
113  };
114 
115  enum
116  {
118  kIMJaTypingMethodProperty = FOUR_CHAR_CODE(
119  'jtyp'),
120  kIMJaTypingMethodRoman = FOUR_CHAR_CODE('roma'),
121  kIMJaTypingMethodKana = FOUR_CHAR_CODE('kana')
122  };
123 
124  enum
125  {
136  kCMFixTextService = 0x0009,
140  kCMSetTextServiceProperty = 0x000D
141  };
142 
143  enum
144  {
147  kCMUCTextServiceEvent = 0x000E
148  };
149 
151 #define mGetScriptCode(cdRec) \
152  ((ScriptCode)((cdRec.componentFlags & bScriptMask) >> 8))
153 #define mGetLanguageCode(cdRec) ((LangCode)cdRec.componentFlags & bLanguageMask)
154 
156  typedef struct OpaqueTSMDocumentID *TSMDocumentID;
157  typedef OSType InterfaceTypeList[1];
158 
161  {
162  Component fComponent;
163  Str255 fItemName;
164  };
165  typedef struct TextServiceInfo TextServiceInfo;
168  {
169  short fTextServiceCount;
172  };
173  typedef struct TextServiceList TextServiceList;
177  {
178  ScriptCode fScript;
179  LangCode fLanguage;
180  };
183  {
184  short fScriptLanguageCount;
189  };
202  OSErr
203  NewTSMDocument(short numOfInterface, InterfaceTypeList supportedInterfaceTypes,
204  TSMDocumentID *idocID, long refcon);
205 
214  OSErr
216 
225  OSErr
227 
236  OSErr
238 
247  OSErr
249 
258  OSErr
259  GetServiceList(short numOfInterface, OSType *supportedInterfaceTypes,
260  TextServiceListHandle *serviceInfo, long *seedValue);
261 
270  OSErr
272  ComponentInstance *aComponentInstance);
273 
282  OSErr
283  CloseTextService(TSMDocumentID idocID, ComponentInstance aComponentInstance);
284 
293  OSErr
295  AESendMode sendMode, AESendPriority sendPriority,
296  long timeOutInTicks, AEIdleUPP idleProc,
297  AEFilterUPP filterProc);
298 
313  OSStatus
315 
324  OSErr
326 
335  OSErr
337 
346  OSErr
348 
357  OSErr
359 
368  OSErr
370 
409  OSStatus
411  RgnHandle inRegion);
412 
414 #if CALL_NOT_IN_CARBON
423  Boolean
425 
434  Boolean
435  TSMMenuSelect(long menuResult);
436 
445  Boolean
446  SetTSMCursor(Point mousePos);
447 
457  OSErr
458  NewServiceWindow(void *wStorage, const Rect *boundsRect, ConstStr255Param title,
459  Boolean visible, short theProc, WindowRef behind,
460  Boolean goAwayFlag, ComponentInstance ts, WindowRef *window);
461 
470  OSErr
472 
481  OSErr
483 
492  short
494 
503  OSErr
504  NewCServiceWindow(void *wStorage, const Rect *boundsRect,
505  ConstStr255Param title, Boolean visible, short theProc,
506  WindowRef behind, Boolean goAwayFlag, ComponentInstance ts,
507  WindowRef *window);
508 
519  OSErr
521 
530  OSErr
532 
534 #endif
544  ComponentResult
546  ScriptLanguageSupportHandle *scriptHdl);
547 
556  ComponentResult
558 
567  ComponentResult
569 
578  ComponentResult
580 
589  ComponentResult
591 
600  ComponentResult
602 
614  ComponentResult
616 
617 #if CALL_NOT_IN_CARBON
626  ComponentResult
628 
637  ComponentResult
639  UniChar unicodeString[], UniCharCount unicodeStrLength);
640 
649  ComponentResult
650  TextServiceMenuSelect(ComponentInstance ts, MenuRef serviceMenu, short item);
651 
660  ComponentResult
662 
663 #endif
673  ComponentResult
675 
684  ComponentResult
686 
695  ComponentResult
696  GetTextServiceProperty(ComponentInstance ts, OSType propertySelector,
697  SInt32 *result);
698 
707  ComponentResult
708  SetTextServiceProperty(ComponentInstance ts, OSType propertySelector,
709  SInt32 value);
710 
724 
725 #if PRAGMA_STRUCT_ALIGN
726 #pragma options align = reset
727 #elif PRAGMA_STRUCT_PACKPUSH
728 #pragma pack(pop)
729 #elif PRAGMA_STRUCT_PACK
730 #pragma pack()
731 #endif
732 
733 #ifdef PRAGMA_IMPORT_OFF
734 #pragma import off
735 #elif PRAGMA_IMPORT
736 #pragma import reset
737 #endif
738 
739 #ifdef __cplusplus
740 }
741 #endif
742 
743 #endif
AppleEvent Data Model Interfaces.
AppleEvent functions that deal with Events and interacting with user.
AppleEvents Registry Interface.
Carbon Event Manager.
Component Manager Interfaces.
Set up for compiler independent conditionals.
Event Manager Interfaces.
struct OpaqueEventRef * EventRef
Definition: Events.h:1081
Basic Macintosh data types.
unsigned char Boolean
Definition: MacTypes.h:318
Menu Manager Interfaces.
ComponentResult TextServiceMenuSelect(ComponentInstance ts, MenuRef serviceMenu, short item)
@ kCMTextServiceEvent
Definition: TextServices.h:133
@ kCMTerminateTextService
Definition: TextServices.h:130
@ kCMTextServiceMenuSelect
Definition: TextServices.h:135
@ kCMGetTextServiceProperty
Definition: TextServices.h:139
@ kCMHidePaletteWindows
Definition: TextServices.h:138
@ kCMSetTextServiceProperty
Definition: TextServices.h:140
@ kCMActivateTextService
Definition: TextServices.h:131
@ kCMGetTextServiceMenu
Definition: TextServices.h:134
@ kCMDeactivateTextService
Definition: TextServices.h:132
@ kCMFixTextService
Definition: TextServices.h:136
@ kCMSetTextServiceCursor
Definition: TextServices.h:137
@ kCMInitiateTextService
Definition: TextServices.h:129
@ kCMGetScriptLangSupport
Definition: TextServices.h:128
ComponentResult GetTextServiceMenu(ComponentInstance ts, MenuRef *serviceMenu)
OSErr CloseTextService(TSMDocumentID idocID, ComponentInstance aComponentInstance)
ComponentResult UCTextServiceEvent(ComponentInstance ts, short numOfEvents, EventRecord *event, UniChar unicodeString[], UniCharCount unicodeStrLength)
OSErr NewCServiceWindow(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short theProc, WindowRef behind, Boolean goAwayFlag, ComponentInstance ts, WindowRef *window)
OSErr ActivateTSMDocument(TSMDocumentID idocID)
@ kTSMVersion
Definition: TextServices.h:85
@ kInputMethodService
Definition: TextServices.h:83
ComponentResult DeactivateTextService(ComponentInstance ts)
ComponentResult HidePaletteWindows(ComponentInstance ts)
OSErr FixTSMDocument(TSMDocumentID idocID)
OSErr GetFrontServiceWindow(WindowRef *window)
Boolean SetTSMCursor(Point mousePos)
@ bScriptMask
Definition: TextServices.h:110
@ bTakeActiveEvent
Definition: TextServices.h:107
@ bScriptLanguageMask
Definition: TextServices.h:112
@ bLanguageMask
Definition: TextServices.h:111
@ bHandleAERecording
Definition: TextServices.h:108
@ kIMJaTypingMethodKana
Definition: TextServices.h:121
@ kIMJaTypingMethodProperty
Definition: TextServices.h:118
@ kIMJaTypingMethodRoman
Definition: TextServices.h:120
OSErr CloseServiceWindow(WindowRef window)
OSErr DeleteTSMDocument(TSMDocumentID idocID)
ComponentResult GetTextServiceProperty(ComponentInstance ts, OSType propertySelector, SInt32 *result)
OSErr InitTSMAwareApplication(void)
ComponentResult FixTextService(ComponentInstance ts)
Boolean TSMMenuSelect(long menuResult)
OSErr OpenTextService(TSMDocumentID idocID, Component aComponent, ComponentInstance *aComponentInstance)
OSErr SetDefaultInputMethod(Component ts, ScriptLanguageRecord *slRecordPtr)
ComponentResult TextServiceEvent(ComponentInstance ts, short numOfEvents, EventRecord *event)
ComponentResult TerminateTextService(ComponentInstance ts)
OSStatus TSMSetInlineInputRegion(TSMDocumentID inTSMDocument, WindowRef inWindow, RgnHandle inRegion)
ComponentResult InitiateTextService(ComponentInstance ts)
short FindServiceWindow(Point thePoint, WindowRef *theWindow)
OSErr CloseTSMAwareApplication(void)
TSMDocumentID TSMGetActiveDocument(void)
OSErr GetServiceList(short numOfInterface, OSType *supportedInterfaceTypes, TextServiceListHandle *serviceInfo, long *seedValue)
struct OpaqueTSMDocumentID * TSMDocumentID
Definition: TextServices.h:156
OSErr UseInputWindow(TSMDocumentID idocID, Boolean useWindow)
ComponentResult GetScriptLanguageSupport(ComponentInstance ts, ScriptLanguageSupportHandle *scriptHdl)
ComponentResult SetTextServiceCursor(ComponentInstance ts, Point mousePos)
ComponentResult SetTextServiceProperty(ComponentInstance ts, OSType propertySelector, SInt32 value)
OSErr NewServiceWindow(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short theProc, WindowRef behind, Boolean goAwayFlag, ComponentInstance ts, WindowRef *window)
OSErr GetTextServiceLanguage(ScriptLanguageRecord *slRecordPtr)
OSErr SetTextServiceLanguage(ScriptLanguageRecord *slRecordPtr)
Boolean TSMEvent(EventRecord *event)
ComponentResult TextServiceEventRef(ComponentInstance ts, EventRef event)
@ kUnicodeTextService
Definition: TextServices.h:92
OSErr GetDefaultInputMethod(Component *ts, ScriptLanguageRecord *slRecordPtr)
OSErr DeactivateTSMDocument(TSMDocumentID idocID)
OSErr SendAEFromTSMComponent(const AppleEvent *theAppleEvent, AppleEvent *reply, AESendMode sendMode, AESendPriority sendPriority, long timeOutInTicks, AEIdleUPP idleProc, AEFilterUPP filterProc)
OSStatus SendTextInputEvent(EventRef inEvent)
ComponentResult ActivateTextService(ComponentInstance ts)
OSErr NewTSMDocument(short numOfInterface, InterfaceTypeList supportedInterfaceTypes, TSMDocumentID *idocID, long refcon)
@ kCMUCTextServiceEvent
Definition: TextServices.h:147
Definition: AEDataModel.h:175
Definition: Components.h:220
Definition: Components.h:214
Definition: Events.h:224
Definition: Quickdraw.h:1648
Definition: Quickdraw.h:306
Definition: Menus.h:753
Definition: MacTypes.h:520
Definition: MacTypes.h:527
Definition: TextServices.h:177
Definition: TextServices.h:183
ScriptLanguageRecord fScriptLanguageArray[1]
Definition: TextServices.h:187
Definition: TextServices.h:161
Definition: TextServices.h:168
TextServiceInfo fServices[1]
Definition: TextServices.h:171