[Uim] Re: Suggestion: Renaming new API functions

YamaKen yamaken at bp.iij4u.or.jp
Fri Oct 1 11:48:52 EEST 2004


At Thu, 30 Sep 2004 03:47:39 +0900,
tkng at xem.jp wrote:
> 
> On Tue, 28 Sep 2004 23:21:23 +0900
> YamaKen <yamaken at bp.iij4u.or.jp> wrote:
> 
> > I would like to rename some new API functions that you had added
> > for upcoming release. Please try to understand my fearing. I'm
> > sorry for too late suggestion.
> 
> I agree with you except uim_get_im_name_of_context(). Can you commit
> those changes today?

Committed as r1374 and r1377.

> >   This function name and the description in the comment
> >   indicates that 'this function returns the im-name of the
> >   context currently selected in the system'. But it's not
> >   truth. The function performs 'returns the im-name of the
> >   context PASSED AS ARGUMENT'. This difference will cause
> >   serious misunderstanding to API users. In fact, I had
> >   misunderstood.
> 
> I couldn't guess what is the problem here. 'in the system' or 'PASSED AS
> ARGUMENT'? I need a more detailed description...

I was still misunderstood the model in your mind when I had sent
the previous mail although I know actual behavior of the
code. Perhaps I've now understood your intention about 'current
input method'. It's quite strange for me and difficult to
imagine.

> >   So I suggest an accurate name uim_get_im_name_of_context().
> 
> Because uim's input context has plural input methods (so of course
> plural input method names), I opposite this function name. Anyway, I
> need your blow-by-blow opinion.

In your view, an input context HAS an input method as slave. So
each input context also has the concept 'current input context'.


                     master                       slave
                 ---------------   has-a    ----------------- 
            ^   | input context | -------> |      Anthy      |
            |    ---------------            -----------------
            |                   ^           -----------------
            |                   | -------> |      SKK        |
            |       switcheable |           -----------------
   coexist  |                   |           ----------------------
            |                   v -------> | another input method |
            |                               ----------------------
            |
            |    ---------------   has-a    ----------------- 
            v   | input context | -------> |      Anthy      |
                 ---------------            -----------------
                                ^           -----------------
                                | -------> |      SKK        |
                    switcheable |           -----------------
                                |           ----------------------
                                v -------> | another input method |
                                            ----------------------

                           Your model


But in natural view, an input context BELONGS TO only one input
method. So I suggest the name uim_im_name_of_context() to
conform to this model. It simply returns its only one input
method name as an attribute of the input context.

Although uim_im_switch() reuses C-side input context object
struct uim_context_, actual context object in the Scheme world
is discarded and re-created as another instance of another input
method on a switching. struct uim_context_ only behaves as a
reference to the actual input context object with some attribute
cache. In this accurate model, no concept 'current input method
of an input context' exists although upper-layer of the libuim
such as gtk-im-uim regards an uim_context as multiplexing object
and therefore 'current IM name' is natural view from the layer.
libuim itself should not enforce such restricted view to users.


                     instance                     class
                 ---------------     of     -----------------
             ^  | input context | -------> |      Anthy      |
             |   ---------------            -----------------
             |  
             |   ---------------            -----------------
   coexist   |  | input context | -------> |      SKK        |
             |   ---------------            -----------------
             |  
             |   ---------------            ----------------------
             v  | input context | -------> | another input method |
                 ---------------            ----------------------


                         Accurate model


I hope I've expressed my mind well.

-------------------------------
YamaKen  yamaken at bp.iij4u.or.jp



More information about the uim mailing list