[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xfree-i18n
Subject:    Re: [I18n]Comprehensive Document on XIM Callback?
From:       Theppitak Karoonboonyanan <thep () links ! nectec ! or ! th>
Date:       2001-02-26 7:33:13
[Download RAW message or body]

In my recent patches (#4478, #4479), I've chosen safe values so that the
callbacks that follow the following cases will be able to use the Thai input
method :-

Input Context:  abcde|fghi   ('|' is the cursor)

position  = p (=1 as the example)
direction = XIMBackwardChar
factor    = f (=3 as the example)
operation = XIMStringConversionRetrieval

[x] "gfe"  (start from p chars to the right, retrieve f chars, reversed order)
[ ] "efg"  (start from p chars to the right, retrieve f chars, in left-to-right
            order)
[x] "gfed" (start from p chars to the right, count back f chars, mark it as
            the last char to retrieve, get it in reversed order)
[*] "defg" (start from p chars to the right, count back f chars, mark it as
            the last char to retrieve, get it in left-to-right order)
[P] "edc"  (start from p chars to the left [as it is XIMBackwardChar],
            retrieve f chars, reversed order)
[ ] "cde"  (start from p chars to the left [as it is XIMBackwardChar]
            retrieve f chars, in left-to-right order)
[x] "edcb" (start from p chars to the left, count back f chars, mark it as
            the last char to retrieve, get it in reversed order)
[*] "bcde" (start from p chars to the left, count back f chars, mark it as
            the last char to retrieve, get it in left-to-right order)

[x] = works intentionally
[P] = works intentionally & preferred
[*] = works by coincidence
[ ] = not works

The one marked [P] is preferred for practical reasons :-

- It makes starting from the left of the current cursor position possible
  with the "unsigned" starting position.

  And it's natural to look back what we typed so far to determine the
  validity of the new key, rather than to look forward. So, the ability
  to start the retrieval from the left is necessary.

- As the callback may or may not include the last character pointed by
  the "ending" position, retrieving in reversed order, without assuming
  the last character in problem is safe.

  However, it's extremely necessary to make clear the inclusion of the
  character at the "ending" position when XIMStringConversionSubstitution
  comes into play, because it will affect the application's input buffer.

-- 
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

On Wed, Feb 21, 2001 at 10:54:54PM +0700, Theppitak Karoonboonyanan wrote:
> Hello,
> 
> I've been successful in making Thai XIM consult the input context of the
> application via the XNStringConversionCallback. And, since there is no any
> existing implementation found to provide such callback, I have to do it
> myself with an X terminal emulator for a first one.
> 
> The problem is I can't find any precise specification on the arguments
> passed through the callback. Section 13.18.4 of Xlib Programming Manual
> does provide a most comprehensive description I can find. But when putting
> my hands on the keyboard, I feel confused in many things, such as :-
> 
> - Why is the XIMStringConversionPosition be "unsigned" short?
>   Can I start from one character left to the cursor, then?
> - In case of XIMBackwardChar, should the text be returned in reversed order?
> - Is the character at the "ending" position determined by 'factor' and
>   XIMCaretDirection counted in the returned text?
> 
> Here's a sample situation I can't find the answer from the manual :-
> 
> Input Context:  abcde|fghi   ('|' is the cursor)
> 
> position  = 1
> direction = XIMBackwardChar
> factor    = 3
> operation = XIMStringConversionRetrieval
> 
> What should be returned?
> - "gfe"  (start from 1 char to the right, retrieve 3 chars, reversed order)
> - "efg"  (same as above, not reverse)
> - "gfed" (start from 1 char to the right, count back 3 chars, mark it as
>           the last char to retrieve, get it in reversed order)
> - "defg" (same as above, not reverse)
> - "edc"  (start from 1 char to the left [as it is XIMBackwardChar],
>           retrieve 3 chars, reversed order)
> - "cde"  (same as above, not reverse)
> - "edcb" (start from 1 char to the left, count back 3 chars, mark it as
>           the last char to retrieve, get it in reversed order)
> - "bcde" (same as above, not reverse)
> 
> Or could somebody point me to a more comprehensive document?
> 
> Thank you,
> -- 
> 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
> _______________________________________________
> I18n mailing list
> I18n@XFree86.Org
> http://XFree86.Org/mailman/listinfo/i18n

_______________________________________________
I18n mailing list
I18n@XFree86.Org
http://XFree86.Org/mailman/listinfo/i18n

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic