Important: The information in this document is obsolete and should not be used for new development.
Chapter 7 - Text Services Manager
This chapter describes how text-processing applications can communicate flexibly and efficiently with utilities that provide services to those applications. Applications that need input methods, spell-checking, hyphenation, and so forth can use the Text Services Manager to search for, obtain information about, and communicate with those utilities. Utilities can use the Text Services Manager to request actions and information from applications, and to send data to them.Read this chapter if you are developing or enhancing an application to use text services. In particular, if you want your application to support text input in a 2-byte script system, you should use the Text Services Manager. Your application will then work with multiple script systems and many input methods.
Read this chapter if you are writing or adapting a utility that provides a text service such as text input. Utilities that work with the Text Services Manager are called text service components. If your utility is a text service component, it will be able to communicate with a wide range of applications.
Before reading this chapter, read the chapter "Introduction to Text on the Macintosh" in this book. To use this chapter, you should also be familiar with the Apple Event Manager and the Component Manager. For details on the Apple Event Manager, see Inside Macintosh: Interapplication Communication. For more on the Component Manager, see Inside Macintosh: More Macintosh Toolbox.
This chapter refers to routines, constants, and data structures from QuickDraw, the Event Manager, the Window Manager, the Menu Manager, and the Process Manager. For details on QuickDraw, see Inside Macintosh: Imaging. For more on the Event Manager, Window Manager, and Menu Manager, see Inside Macintosh: Macintosh Toolbox Essentials. For information on the Process Manager, see Inside Macintosh: Processes.
This chapter first provides a brief introduction to text services in general, input methods in particular, and the Text Services Manager itself. If you are writing an application, it then discusses how you can
If you are writing a text service component, this chapter discusses how you can
- use the Text Services Manager routines for client applications, to send information to text service components
- implement the text-service Apple event handlers in your client application, to receive information from text service components
- communicate directly with the Component Manager and text service components, if your application's special needs require you to bypass the Text Services Manager
- implement the text service component routines, so that the Text Services Manager and client applications can request the text services you provide
- use the Text Services Manager routines for text service components, to send information to client applications and the Text Services Manager
Chapter Contents
- About Text Services
- About Input Methods
- About the Text Services Manager
- The Text Services Environment
- The Text Services Manager and Input Methods
- Inline Input
- Floating Input Windows
- Floating Utility Windows
- About Text Service Components
- Using the Text Services Manager (for Client Applications)
- Testing for the Availability of the Text Services Manager
- Calling the Text Services Manager
- Initializing as a TSM-Aware Application
- Creating a TSM Document
- Making Text Services Available to the User
- Activating and Deactivating a TSM Document
- Passing Events, Menu Selections, and Cursor Setting
- Confirming Active Text Within a TSM Document
- Deleting a TSM Document
- Closing Down as a TSM-Aware Application
- Requesting a Floating Input Window for Text Entry
- Associating Input Methods With Scripts and Languages
- Handling Text Service Apple Events
- Receiving Text and Updating the Active Input Area
- Converting Screen Position to Text Offset
- Converting Text Offset to Screen Position
- Showing or Hiding the Input Window
- Direct Access to Text Service Components
- Calling the Component Manager
- Calling Text Service Components
- Using the Text Services Manager (for Text Service Components)
- Providing Menus and Icons
- Providing a Text Service Component Menu
- Providing Input Method Icons for the Keyboard Menu
- Responding to Calls
- Initiating a Text Service
- Activating Text Service Component Windows
- Responding to Events and Updating the Cursor and Menu
- Confirming Active Text Input
- Closing a Text Service
- Identifying the Supported Scripts and Languages
- Making Calls
- Sending Apple Events to Client Applications
- Opening Floating Utility Windows
- Text Services Manager Reference
- Text Services Manager Routines for Client Applications
- Initializing and Closing as a TSM-Aware Application
- Creating and Activating TSM Documents
- Passing Events to Text Service Components
- Passing Menu Selections and Cursor Setting
- Confirming Active Input in a TSM Document
- Making Text Services Available to the User
- Requesting a Floating Input Window
- Associating Scripts and Languages With Components
- Apple Event Handlers Supplied by Client Applications
- Creating and Updating an Active Input Area
- Converting Global Coordinates to Text Offsets
- Converting Text Offsets to Global Coordinates
- Showing or Hiding the Floating Input Window
- Text Services Manager Routines for Components
- Sending Apple Events to a Client Application
- Opening Floating Utility Windows
- Text Service Component Routines
- Providing a Text Service
- Responding to Events and Updating the Cursor and Menu
- Confirming Active Input in a TSM Document
- Identifying the Supported Scripts and Languages
- Summary of the Text Services Manager
- Pascal Summary
- Constants
- Data Types
- Text Services Manager Routines for Client Applications
- Text Services Manager Routines for Components
- Text Service Component Routines
- C Summary
- Constants
- Data Types
- Text Services Manager Routines for Client Applications
- Text Services Manager Routines for Components
- Text Service Component Routines
- Assembly-Language Summary
- Trap Macros
- Result Codes