[Uim] Please review Uim Developer's Document

YamaKen yamaken at bp.iij4u.or.jp
Sun Jul 4 06:58:18 EEST 2004


Hi Kazuki,

At Mon, 28 Jun 2004 16:22:24 +0900,
mover at hct.zaq.ne.jp wrote:
> Now, I propose these helper API instead of current API.
> The only idea is that all functions use static fd and 
> buffer, and create the function to get the value of static 
> fd to be able to get the value from the user side.
> 
> #in gtk-im-uim.c, fd is stored in static in im_uim_fd. I 
> think this is avoidable.
(snip)
> In future, helper system will be used for customizing of 
> committing string from another app (input palette) or so.
> Therefore, we need to prepere flexible API for it.
> 
> How do you think about this, Yamaken?

I think that it should be thought in the context of recent
inter-framework cooperation. i.e. Should we continue developing
the helper API and components?

My opinion about the cooperation with SCIM had already expressed
as below. The opinion implies possible discontinuance of the
helper system, although it is just a possible way.

http://freedesktop.org/pipermail/uim/2004-June/000457.html

But I think that to establish the common infrastructure between
IM frameworks corresponding to the helper system of uim is the
best way for developers and users, if possible and reasonable.

I want to know opinion of the other developers. Kazuki,
Hiroyuki, Yusuke, what do you think about the future of helper
system and our development resources?

> > > Would you point at the concreate weird points of helper
> > > related functions? I'll change the API according to
> > > your advice.
> >
> > ] /* API for input method user side */
> > ] int  uim_helper_init_client_fd(void
> > (*disconnect_cb)(void)); ] void
> > uim_helper_close_client_fd(int );
> > ] void uim_helper_read_proc(int fd);
> > ] char *uim_helper_send_message(int fd, const char
> > *message);
> >
> > These four functions work with fd stored on the user
> > side. init and close also keep the static uim_fd up to
> > date.
> >
> > ] void uim_helper_client_focus_in(uim_context uc);
> > ] void uim_helper_client_focus_out(uim_context uc);
> >
> > These two are only used by the input method clients, and
> > the helpers _receive_ the messages. They send over the
> > static uim_fd.
> >
> > ] void uim_helper_client_get_prop_list(void);
> >
> > This call sends a message to get the useful data for the
> > display... Using the static uim_fd.
> >
> > ] char *uim_helper_get_message(void);
> >
> > This uses a static buffer, filled by
> > uim_helper_read_proc.
> >
> > To my mind, it should be consitently either the static fd
> > in uim-helper-client.c, or a user-kept fd (which makes
> > more sense so it can be 'selected' on.)
> >
> > Also, uim_helper_read_proc seems unneccessary as a
> > function compared to uim_helper_get_message(int fd);
> >
> > In fact, given that the messages appear to be fairly
> > discrete and well deliminated, I would expect the read
> > routine could just pull data until it sees two \n's, and
> > block otherwise.
> >
> > (I could be wrong about this last bit, I've not delved
> > too deeply into the IPC stuff. :-)
> >
> > Just in case I'm doing it wrong, here's the stub helper I
> > knocked up last night so I could see what was coming out,
> > based on looking at helper-toolbar-common-gtk. As it
> > happens, the hard part looks like the blackbox slit
> > thingy.
> >
> > #include <uim/uim.h>
> > #include <uim/uim-helper.h>
> >
> > int main (void)
> > {
> > 	int uim_fd = -1;
> > 	char *tmp;
> > 	uim_fd = uim_helper_init_client_fd(NULL);
> > 	if (uim_fd < 0) {
> > 		printf("Barf\n");
> > 		return -1;
> > 	}
> > 	uim_helper_client_get_prop_list();
> > 	while (1) {
> > 		uim_helper_read_proc(uim_fd);
> > 		while ((tmp = uim_helper_get_message())) {
> > 			printf("%s\n", tmp);
> > 			free(tmp);
> > 		}
> > 	}
> > 	uim_helper_close_client_fd(uim_fd);
> > }

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




More information about the uim mailing list