Re: XIM String Conversion Callback



Owen Taylor wrote:

> 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.
>
>  - I don't understand either the Xlib interfaces or the problem very
>    well, so I didn't know exactly how to set it up.

I suspect the developers of the XIM parts of Xlib had the same problem, since the
design and the documentation are a bit woolly at best. For example, if an app
shuts down it would be expected to close/clear the input context. If it crashes,
or is killed, the IME doesn't receive any indication, and has no clean way to
clear out the redundant context.

> Reconversion is especially tricky and I'm not sure it should be
> joined together with context.
>
>
> 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.

I think there are likely to be contention problems here between what the app
thinks is the current context, and what the IME might do. Defining context
requires a model of "context", and that varies between input methods, even for a
single language. Is the context the last few characters which form a polysyllabic
word in Chinese? Is it the sentance to date (where "sentance" can be a slightly
vague term in some languages)? The XIM documentation doesn't really address these
issues. It just vaguely refers to "context".

Actually, I'm not sure precisely what you mean by context and reconversion in your

comments. By "reconversion"  are you just refering to the repeated changes of the
pre-edit string, or something more?

Regards,
Steve






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