[Uim] API for getting available IM engines

Takuro Ashie ashie at good-day.co.jp
Thu Aug 5 12:05:38 EEST 2004


Hi.

On Wed, 4 Aug 2004 20:39:29 +0900
Takuro Ashie <ashie at homa.ne.jp> wrote:

> This is the current patch agaist r1085:
> 
>   http://www.homa.ne.jp/~ashie/linux/files/uim-switch-im-test.diff.gz
> 
> It has some problems yet, but it can switch IM engine from helper toolbar.
> 
> There are some issues about this patch, so I'll describe it later.

BTW, when I was implementing this feature, I noticed that API for
getting available IM engines seems strange.

To get available IM, current uim requires user to create "dummy"
uim_context.

  uc = uim_create_context(NULL, "UTF-8",
			  NULL, NULL, uim_iconv, NULL);

  for (i = 0; i < uim_get_nr_im(uc); i++) {
    const char *name = uim_get_im_name(uc, i);
  }

  uim_release_context(uc);

And all uim_context are contains all IM engines list although it can not
switch IM backend engine dynamically.

It may break users mental model.

I think we should change getting IM engines API like this:

  int         uim_get_nr_im   (void);
  const char *uim_get_im_name (int nth,
                               uim_code_converter *conv,
                               const char *lang);
  const char *uim_get_im_lang (int nth,
                               uim_code_converter *conv,
                               const char *lang);

And I think uim_create_context() should return NULL for invalid engine
name.

Regards,

-- 
Takuro Ashie <ashie at good-day.co.jp>




More information about the uim mailing list