[Uim] Suggestion: context object integration

Kazuki Ohta mover at hct.zaq.ne.jp
Fri Sep 24 10:29:57 EEST 2004


Hi, Yamaken.

I think your suggestion is reasonable and uim-anthy works well on my 
environment after patching your patch.
Please commit:-)

> Hi all,
>
> I suggest a Scheme API change to make implementing IM
> easier. Please tell me how do you think about it.
>
> Currently IM programmers are required to deal with the 3 context
> objects.
>
> - id
> - context
> - per-im-context
>
> 'id' is used to communicate with C-side APIs such as im-commit
> or im-update-preedit.
>
> 'context' is used as base object of Scheme-side context. It is
> retrieved by (find-context id).
>
> 'per-im-context' contains IM-specific data. It is stored in a
> 'context' and retrieved by (context-data context).
>
> The distinguishment requires IM-implementors tedious context
> handling. You might have seen following code.
>
>   (lambda (id mode)
>     (let* ((c (find-context id))
>            (ac (context-data c)))
>
> Although some reasons to distinguish the objects exist for API
> implementor, all 3 context objects semantically mean same 'this
> input context' for IM-implementors. So we should show the
> context object as unified one for IM-implementors to eliminate
> complexity and confusion.
>
> After the integration, IM-implementors can always use
> per-im-context as context object such as in following example.
>
> ;; ac is an anthy-context
> (im-commit ac "foo")
> (context-id ac)
> (anthy-context-rkc ac)
>
> The attached patch implements such context object integration
> for uim-anthy. Please review it.
>
> I'll port other IMs and write a document about the API change
> once the suggestion has been approved.
>
> -------------------------------
> YamaKen  yamaken at bp.iij4u.or.jp

-- 
---------------------------------
Move the worl:D!
Kazuki Ohta : mover at hct.zaq.ne.jp



More information about the uim mailing list