Mac OS 9
TextServices.h File Reference

Text Services Manager Interfaces. More...

#include <ConditionalMacros.h>
#include <MacTypes.h>
#include <Events.h>
#include <Menus.h>
#include <AEDataModel.h>
#include <AERegistry.h>
#include <AEInteraction.h>
#include <Components.h>
#include <CarbonEvents.h>

Go to the source code of this file.

Data Structures

struct  TextServiceInfo
 
struct  TextServiceList
 
struct  ScriptLanguageRecord
 
struct  ScriptLanguageSupport
 

Macros

#define mGetScriptCode(cdRec)    ((ScriptCode)((cdRec.componentFlags & bScriptMask) >> 8))
 
#define mGetLanguageCode(cdRec)   ((LangCode)cdRec.componentFlags & bLanguageMask)
 

Typedefs

typedef struct OpaqueTSMDocumentID * TSMDocumentID
 
typedef OSType InterfaceTypeList[1]
 
typedef struct TextServiceInfo TextServiceInfo
 
typedef TextServiceInfoTextServiceInfoPtr
 
typedef struct TextServiceList TextServiceList
 
typedef TextServiceListTextServiceListPtr
 
typedef TextServiceListPtrTextServiceListHandle
 
typedef struct ScriptLanguageRecord ScriptLanguageRecord
 
typedef struct ScriptLanguageSupport ScriptLanguageSupport
 
typedef ScriptLanguageSupportScriptLanguageSupportPtr
 
typedef ScriptLanguageSupportPtrScriptLanguageSupportHandle
 

Enumerations

enum  { kTextService , kInputMethodService , kTSMVersion = 0x0150 }
 
enum  { kUnicodeDocument , kUnicodeTextService }
 
enum  { kUnknownLanguage = 0xFFFF , kUnknownScript = 0xFFFF , kNeutralScript = 0xFFFF }
 
enum  {
  bTakeActiveEvent = 15 , bHandleAERecording = 16 , bScriptMask = 0x00007F00 , bLanguageMask = 0x000000FF ,
  bScriptLanguageMask = bScriptMask + bLanguageMask
}
 
enum  { kIMJaTypingMethodProperty , kIMJaTypingMethodRoman = FOUR_CHAR_CODE('roma') , kIMJaTypingMethodKana = FOUR_CHAR_CODE('kana') }
 
enum  {
  kCMGetScriptLangSupport = 0x0001 , kCMInitiateTextService = 0x0002 , kCMTerminateTextService = 0x0003 , kCMActivateTextService = 0x0004 ,
  kCMDeactivateTextService = 0x0005 , kCMTextServiceEvent = 0x0006 , kCMGetTextServiceMenu = 0x0007 , kCMTextServiceMenuSelect = 0x0008 ,
  kCMFixTextService = 0x0009 , kCMSetTextServiceCursor = 0x000A , kCMHidePaletteWindows = 0x000B , kCMGetTextServiceProperty = 0x000C ,
  kCMSetTextServiceProperty = 0x000D
}
 
enum  { kCMUCTextServiceEvent = 0x000E }
 

Functions

OSErr NewTSMDocument (short numOfInterface, InterfaceTypeList supportedInterfaceTypes, TSMDocumentID *idocID, long refcon)
 
OSErr DeleteTSMDocument (TSMDocumentID idocID)
 
OSErr ActivateTSMDocument (TSMDocumentID idocID)
 
OSErr DeactivateTSMDocument (TSMDocumentID idocID)
 
OSErr FixTSMDocument (TSMDocumentID idocID)
 
OSErr GetServiceList (short numOfInterface, OSType *supportedInterfaceTypes, TextServiceListHandle *serviceInfo, long *seedValue)
 
OSErr OpenTextService (TSMDocumentID idocID, Component aComponent, ComponentInstance *aComponentInstance)
 
OSErr CloseTextService (TSMDocumentID idocID, ComponentInstance aComponentInstance)
 
OSErr SendAEFromTSMComponent (const AppleEvent *theAppleEvent, AppleEvent *reply, AESendMode sendMode, AESendPriority sendPriority, long timeOutInTicks, AEIdleUPP idleProc, AEFilterUPP filterProc)
 
OSStatus SendTextInputEvent (EventRef inEvent)
 
OSErr SetDefaultInputMethod (Component ts, ScriptLanguageRecord *slRecordPtr)
 
OSErr GetDefaultInputMethod (Component *ts, ScriptLanguageRecord *slRecordPtr)
 
OSErr SetTextServiceLanguage (ScriptLanguageRecord *slRecordPtr)
 
OSErr GetTextServiceLanguage (ScriptLanguageRecord *slRecordPtr)
 
OSErr UseInputWindow (TSMDocumentID idocID, Boolean useWindow)
 
OSStatus TSMSetInlineInputRegion (TSMDocumentID inTSMDocument, WindowRef inWindow, RgnHandle inRegion)
 
Boolean TSMEvent (EventRecord *event)
 
Boolean TSMMenuSelect (long menuResult)
 
Boolean SetTSMCursor (Point mousePos)
 
OSErr NewServiceWindow (void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short theProc, WindowRef behind, Boolean goAwayFlag, ComponentInstance ts, WindowRef *window)
 
OSErr CloseServiceWindow (WindowRef window)
 
OSErr GetFrontServiceWindow (WindowRef *window)
 
short FindServiceWindow (Point thePoint, WindowRef *theWindow)
 
OSErr NewCServiceWindow (void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short theProc, WindowRef behind, Boolean goAwayFlag, ComponentInstance ts, WindowRef *window)
 
OSErr InitTSMAwareApplication (void)
 
OSErr CloseTSMAwareApplication (void)
 
ComponentResult GetScriptLanguageSupport (ComponentInstance ts, ScriptLanguageSupportHandle *scriptHdl)
 
ComponentResult InitiateTextService (ComponentInstance ts)
 
ComponentResult TerminateTextService (ComponentInstance ts)
 
ComponentResult ActivateTextService (ComponentInstance ts)
 
ComponentResult DeactivateTextService (ComponentInstance ts)
 
ComponentResult GetTextServiceMenu (ComponentInstance ts, MenuRef *serviceMenu)
 
ComponentResult TextServiceEventRef (ComponentInstance ts, EventRef event)
 
ComponentResult TextServiceEvent (ComponentInstance ts, short numOfEvents, EventRecord *event)
 
ComponentResult UCTextServiceEvent (ComponentInstance ts, short numOfEvents, EventRecord *event, UniChar unicodeString[], UniCharCount unicodeStrLength)
 
ComponentResult TextServiceMenuSelect (ComponentInstance ts, MenuRef serviceMenu, short item)
 
ComponentResult SetTextServiceCursor (ComponentInstance ts, Point mousePos)
 
ComponentResult FixTextService (ComponentInstance ts)
 
ComponentResult HidePaletteWindows (ComponentInstance ts)
 
ComponentResult GetTextServiceProperty (ComponentInstance ts, OSType propertySelector, SInt32 *result)
 
ComponentResult SetTextServiceProperty (ComponentInstance ts, OSType propertySelector, SInt32 value)
 
TSMDocumentID TSMGetActiveDocument (void)
 

Detailed Description

Text Services Manager Interfaces.

Introduced In: Mac OS 9
Avaliable From: Universal Interfaces 3.4.1
Copyright: © 1991-2001 by Apple Computer, Inc., all rights reserved.

For bug reports, consult the following page on the World Wide Web:

http://developer.apple.com/bugreporter/

Macro Definition Documentation

◆ mGetScriptCode

#define mGetScriptCode (   cdRec)     ((ScriptCode)((cdRec.componentFlags & bScriptMask) >> 8))

extract Script/Language code from Component flag ...

Typedef Documentation

◆ TSMDocumentID

typedef struct OpaqueTSMDocumentID* TSMDocumentID

New opaque definitions for types

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kInputMethodService 

component type for the component description

kTSMVersion 

component subtype for the component description

◆ anonymous enum

anonymous enum
Enumerator
kUnicodeTextService 

TSM Document type for Unicode-savvy application

◆ anonymous enum

anonymous enum

Language and Script constants

◆ anonymous enum

anonymous enum
Enumerator
bTakeActiveEvent 

Component Flags in ComponentDescription

bHandleAERecording 

bit set if the component takes active event

bScriptMask 

bit set if the component takes care of recording Apple Events <new in vers2.0>

bLanguageMask 

bit 8 - 14

bScriptLanguageMask 

bit 0 - 7

◆ anonymous enum

anonymous enum
Enumerator
kIMJaTypingMethodProperty 

Typing method property constants for Input Methods

kIMJaTypingMethodRoman 

Typing method property for Japanese input methods

kIMJaTypingMethodKana 

Roman typing

◆ anonymous enum

anonymous enum
Enumerator
kCMGetScriptLangSupport 

Low level routines which are dispatched directly to the Component Manager

kCMInitiateTextService 

Component Manager call selector 1

kCMTerminateTextService 

Component Manager call selector 2

kCMActivateTextService 

Component Manager call selector 3

kCMDeactivateTextService 

Component Manager call selector 4

kCMTextServiceEvent 

Component Manager call selector 5

kCMGetTextServiceMenu 

Component Manager call selector 6

kCMTextServiceMenuSelect 

Component Manager call selector 7

kCMFixTextService 

Component Manager call selector 8

kCMSetTextServiceCursor 

Component Manager call selector 9

kCMHidePaletteWindows 

Component Manager call selector 10

kCMGetTextServiceProperty 

Component Manager call selector 11

kCMSetTextServiceProperty 

Component Manager call selector 12

◆ anonymous enum

anonymous enum
Enumerator
kCMUCTextServiceEvent 

New low level routines which are dispatched directly to the Component Manager

Function Documentation

◆ ActivateTextService()

ComponentResult ActivateTextService ( ComponentInstance  ts)

ActivateTextService()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ ActivateTSMDocument()

OSErr ActivateTSMDocument ( TSMDocumentID  idocID)

ActivateTSMDocument()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ CloseServiceWindow()

OSErr CloseServiceWindow ( WindowRef  window)

CloseServiceWindow()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ CloseTextService()

OSErr CloseTextService ( TSMDocumentID  idocID,
ComponentInstance  aComponentInstance 
)

CloseTextService()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ CloseTSMAwareApplication()

OSErr CloseTSMAwareApplication ( void  )

CloseTSMAwareApplication()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ DeactivateTextService()

ComponentResult DeactivateTextService ( ComponentInstance  ts)

DeactivateTextService()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ DeactivateTSMDocument()

OSErr DeactivateTSMDocument ( TSMDocumentID  idocID)

DeactivateTSMDocument()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ DeleteTSMDocument()

OSErr DeleteTSMDocument ( TSMDocumentID  idocID)

DeleteTSMDocument()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ FindServiceWindow()

short FindServiceWindow ( Point  thePoint,
WindowRef theWindow 
)

FindServiceWindow()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ FixTextService()

ComponentResult FixTextService ( ComponentInstance  ts)

CALL_NOT_IN_CARBON FixTextService()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ FixTSMDocument()

OSErr FixTSMDocument ( TSMDocumentID  idocID)

FixTSMDocument()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ GetDefaultInputMethod()

OSErr GetDefaultInputMethod ( Component ts,
ScriptLanguageRecord slRecordPtr 
)

GetDefaultInputMethod()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ GetFrontServiceWindow()

OSErr GetFrontServiceWindow ( WindowRef window)

GetFrontServiceWindow()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ GetScriptLanguageSupport()

ComponentResult GetScriptLanguageSupport ( ComponentInstance  ts,
ScriptLanguageSupportHandle scriptHdl 
)

Component Manager Interfaces to Input Methods CALL_NOT_IN_CARBON GetScriptLanguageSupport()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ GetServiceList()

OSErr GetServiceList ( short  numOfInterface,
OSType *  supportedInterfaceTypes,
TextServiceListHandle serviceInfo,
long *  seedValue 
)

GetServiceList()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ GetTextServiceLanguage()

OSErr GetTextServiceLanguage ( ScriptLanguageRecord slRecordPtr)

GetTextServiceLanguage()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ GetTextServiceMenu()

ComponentResult GetTextServiceMenu ( ComponentInstance  ts,
MenuRef serviceMenu 
)

GetTextServiceMenu()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ GetTextServiceProperty()

ComponentResult GetTextServiceProperty ( ComponentInstance  ts,
OSType  propertySelector,
SInt32 *  result 
)

GetTextServiceProperty()

Non-Carbon CFM: not available
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ HidePaletteWindows()

ComponentResult HidePaletteWindows ( ComponentInstance  ts)

HidePaletteWindows()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ InitiateTextService()

ComponentResult InitiateTextService ( ComponentInstance  ts)

InitiateTextService()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ InitTSMAwareApplication()

OSErr InitTSMAwareApplication ( void  )

Explicit initialization not needed for Carbon clients, since TSM is instanciated per-context. InitTSMAwareApplication()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ NewCServiceWindow()

OSErr NewCServiceWindow ( void *  wStorage,
const Rect boundsRect,
ConstStr255Param  title,
Boolean  visible,
short  theProc,
WindowRef  behind,
Boolean  goAwayFlag,
ComponentInstance  ts,
WindowRef window 
)

NewCServiceWindow()

Non-Carbon CFM: in InterfaceLib 8.5 and later
Carbon Lib: not available
Mac OS X: not available

◆ NewServiceWindow()

OSErr NewServiceWindow ( void *  wStorage,
const Rect boundsRect,
ConstStr255Param  title,
Boolean  visible,
short  theProc,
WindowRef  behind,
Boolean  goAwayFlag,
ComponentInstance  ts,
WindowRef window 
)

Following ServiceWindow API replaced by Window Manager API in Carbon. NewServiceWindow()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ NewTSMDocument()

OSErr NewTSMDocument ( short  numOfInterface,
InterfaceTypeList  supportedInterfaceTypes,
TSMDocumentID idocID,
long  refcon 
)

High level TSM Doucment routines NewTSMDocument()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ OpenTextService()

OSErr OpenTextService ( TSMDocumentID  idocID,
Component  aComponent,
ComponentInstance aComponentInstance 
)

OpenTextService()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ SendAEFromTSMComponent()

OSErr SendAEFromTSMComponent ( const AppleEvent theAppleEvent,
AppleEvent reply,
AESendMode  sendMode,
AESendPriority  sendPriority,
long  timeOutInTicks,
AEIdleUPP  idleProc,
AEFilterUPP  filterProc 
)

SendAEFromTSMComponent()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ SendTextInputEvent()

OSStatus SendTextInputEvent ( EventRef  inEvent)

SendTextInputEvent()

Discussion: This API replaces SendAEFromTSMComponent on Mac OS X only. Input Methods on Mac OS X are Carbon Event based instead of AppleEvent based. The Carbon TextInput events which they generate are provided to TSM for dispatching via this API.

Non-Carbon CFM: not available
Carbon Lib: in CarbonLib N.e.v.e.r and later
Mac OS X: in version 10.0 and later

◆ SetDefaultInputMethod()

OSErr SetDefaultInputMethod ( Component  ts,
ScriptLanguageRecord slRecordPtr 
)

SetDefaultInputMethod()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ SetTextServiceCursor()

ComponentResult SetTextServiceCursor ( ComponentInstance  ts,
Point  mousePos 
)

SetTextServiceCursor()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ SetTextServiceLanguage()

OSErr SetTextServiceLanguage ( ScriptLanguageRecord slRecordPtr)

SetTextServiceLanguage()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ SetTextServiceProperty()

ComponentResult SetTextServiceProperty ( ComponentInstance  ts,
OSType  propertySelector,
SInt32  value 
)

SetTextServiceProperty()

Non-Carbon CFM: not available
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ SetTSMCursor()

Boolean SetTSMCursor ( Point  mousePos)

SetTSMCursor()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ TerminateTextService()

ComponentResult TerminateTextService ( ComponentInstance  ts)

TerminateTextService()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ TextServiceEvent()

ComponentResult TextServiceEvent ( ComponentInstance  ts,
short  numOfEvents,
EventRecord event 
)

TextServiceEvent()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ TextServiceEventRef()

ComponentResult TextServiceEventRef ( ComponentInstance  ts,
EventRef  event 
)

New Text Service call in Carbon. Note: Only Raw Key and Mouse-flavored events are passed to Text Services on MacOS X. TextServiceEventRef()

Non-Carbon CFM: not available
Carbon Lib: in CarbonLib 1.1 and later
Mac OS X: in version 10.0 and later

◆ TextServiceMenuSelect()

ComponentResult TextServiceMenuSelect ( ComponentInstance  ts,
MenuRef  serviceMenu,
short  item 
)

TextServiceMenuSelect()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ TSMEvent()

Boolean TSMEvent ( EventRecord event)

Following calls from Classic event loops not needed for Carbon clients. TSMEvent()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ TSMGetActiveDocument()

TSMDocumentID TSMGetActiveDocument ( void  )

Get the active TSMDocument in the current application context.
If TSM has enabled bottom line input mode because no TSMDocument
is active, NULL will be returned.
TSMGetActiveDocument()

Non-Carbon CFM: not available
Carbon Lib: in CarbonLib 1.3 and later
Mac OS X: in version 10.0 and later

◆ TSMMenuSelect()

Boolean TSMMenuSelect ( long  menuResult)

TSMMenuSelect()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ TSMSetInlineInputRegion()

OSStatus TSMSetInlineInputRegion ( TSMDocumentID  inTSMDocument,
WindowRef  inWindow,
RgnHandle  inRegion 
)

TSMSetInlineInputRegion()

Discussion: Tell TSM about the region occupied by an inline input session. If the location of certain mouse events (clicks, mouse moved) occur within the specified inline input region, TSM will forward these events to the current Input Method so that it can interact with the user. Note: If you do not specify this information, TSM will need to intercept mouse events in the entire content region as the default, when an input method is active, in order to ensure that input methods can manage user interaction properly.

Parameters:

inTSMDocument: The document.

inWindow: The window that contains the inline input session. You can pass NULL for this parameter to indicate the user focus window.

inRegion: The region occupied by the current inline input region. This should be in the coordinates of the port associated with the window you passed to inPort. It will need to be recomputed when the text content of the inline input session content changes (i.e. due to Update Active Input Area events) and when the region moves for other reasons, such as window resized, scrolling, etc. If you pass a NULL region for this parameter, TSM will default to intercept mouse events in the focus window's content region.

Non-Carbon CFM: not available
Carbon Lib: in CarbonLib 1.1 and later
Mac OS X: in version 10.0 and later

◆ UCTextServiceEvent()

ComponentResult UCTextServiceEvent ( ComponentInstance  ts,
short  numOfEvents,
EventRecord event,
UniChar  unicodeString[],
UniCharCount  unicodeStrLength 
)

UCTextServiceEvent()

Non-Carbon CFM: in InterfaceLib 8.5 and later
Carbon Lib: not available
Mac OS X: not available

◆ UseInputWindow()

OSErr UseInputWindow ( TSMDocumentID  idocID,
Boolean  useWindow 
)

UseInputWindow()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later