Re: XIM String Conversion Callback



On Wed, Jan 03, 2001 at 10:55:52AM -0500, Owen Taylor wrote:
> 
> Theppitak Karoonboonayanan <thep links nectec or th> writes:
> 
> > So, the question is: has the callback be supported any where in GTK+?
> 
> GTK+-1.2 does not support XNStringConversionCallback.
> 
> GTK+-1.3 also does not include support for context and recoversion
> yet, though that may change. There are two basic reasons why I did not
> add it initially:
> 
>  - It adds sigificant complexity, and I wanted to see if I could
>    avoid adding that complexity.

Agreed. And that makes it so hard to find an application that provides
such callback. I have once experienced a successful Thai XIM working with
XView, but that's not open source, and not running on Linux. So, I can't
study how it works.

>  - I don't understand either the Xlib interfaces or the problem very
>    well, so I didn't know exactly how to set it up.
> 
> Reconversion is especially tricky and I'm not sure it should be
> joined together with context.

The minimal requirement of Thai XIM is to retrieve the immediate character
before the cursor, to determine if the next key is permissible.
So far, the Thai XIM embeded in the Xlib uses a one-char internal
buffer of XIC to keep the previously typed char. But that's not
sufficient for general cases, where the cursor can be moved to different
contexts. So, the actual access to the context is still necessary.

A yet more sophisticated Thai XIM might "postedit" the context to correct
the illegal sequences.

> For getting context, my current idea of how it should look is:
> 
>  GtkIMContext should have a signal ::retrieve_context() which has parameters
>  indicating the desired context region.
> 
>  When the owner of the context (the GtkEntry, for example), gets this
>  signal, it should call:
> 
>   gtk_im_context_set_context (GtkIMContext *im_context,
>                               gint          position,
>                               gchar        *context_text,
>                               gint          length);
> 
>  Where position is the offset (in bytes, not including the 
>  preedit string) of the start of the context string from the cursor 
>  position.

This seems more intuitive than that in X specification. :)

However, please note that X also allows retrieval by word. This should be
useful for applications like pop-up dictionaries (?)


Thank you for your response,
-Theppitak.
-- 
Theppitak Karoonboonyanan
Information Research and Development Division, NECTEC
(Was: Software and Language Engineering Laboratory)
http://www.links.nectec.or.th/~thep/  mailto:theppitak nectec or th





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]