Re: how input method editors work
Re: how input method editors work
- Subject: Re: how input method editors work
- From: Douglas Davidson <email@hidden>
- Date: Tue, 5 Apr 2005 14:01:17 -0700
On Apr 5, 2005, at 1:46 PM, Daniel Child wrote: Now, however, I am thoroughly confused. On the one hand, some people are suggesting that IMEs can only be done using Carbon. (That suggestion admittedly put me in a temporary state of shock, since I know nothing about Carbon and reckoned I'd been wasting my time learning Cocoa.) Now, all the "NS" class methods and protocols you mention seem to be in Cocoa, but you refer me to (Carbon) TSM documentation.
So should I write my model in Cocoa (for the linguistic data) with a Carbon plugin, or is it just the opposite (Carbon base with Cocoa plugin). Or am I totally off the mark? Is MVC an inappropriate paradigm? And to interact with the character palette (which seems to to have a very modern feel => Cocoa-based?) would you use the Carbon or Cocoa API?
Cocoa and Carbon aren't really two entirely different things; they interact and work together, sharing a great deal of common functionality. When you write an input method, remember that it will potentially run as a plugin in every application on the system, Carbon or Cocoa. The way that the input method communicates with its host application is through a Carbon interface, TSM. The way that the UI elements in the host application communicate with the input method is different depending on whether the app is Carbon or Cocoa; Cocoa views like NSTextView use NSTextInput to communicate with input methods, and Cocoa under the hood handles the translation between this and TSM.
I know of no particular reason why you shouldn't write your input method using Cocoa for as much of it as you choose. There may be some quirks associated with displaying Cocoa windows in a Carbon application, that you might run into when your input method was loaded into a Carbon application, if your input method puts up windows of its own--check the documentation on Carbon-Cocoa interaction.
Douglas Davidson
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden