[Uim] Please review Uim Developer's Document

Paul Hampson Paul.Hampson at anu.edu.au
Thu Jun 24 17:02:36 EEST 2004


On Thu, Jun 24, 2004 at 11:22:38AM +0900, Kazuki Ohta wrote:
> Hi, Paul.

> Thank you for your work:-D

> I don't decide nothing about the plan in detail, but I think 
> of the cooperating with other project in GUI panel, systray 
> or so, This will give unified user-interface to the users.

> I'm now in the phase of searching the way to cooperate.
> Now, I read SCIM's socket system, but it seems to depend on 
> SCIM's own Signal/Slot mechanism and written in C++,..

I was going to try SCIM on top of uim, but the Debian scim and uim
packages don't seem to acknowledge each other (scim only offers
English, even though it has Japanese tables loaded in the config)
and the scim toolbar's not particularly helpful since it disappers
if there's any windows between my window and the helper... This
is of course also true of the UIM helper, but I'm more interested
in having the current mode visible as I change windows... I might
not bother having it clickable at all, initially. :-)

I've been trying to work out why no-one else has this problem,
and it's of course because I'm using sloppy focus. Duh. I can't
for the life of me think of a better way, either. Might have
to change focus models...

The only compelling reason for SCIM for me is if it has better
XIM support than uim, but apart from a recent prime/ruby issue
of some kind which caused uim to die until ruby was updated, I
have been quite satisfied with uim-xim, and will remain so until
I resume my Chinese studies. :-)

> 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);
}

-- 
-----------------------------------------------------------
Paul "TBBle" Hampson, MCSE
7th year CompSci/Asian Studies student, ANU
The Boss, Bubblesworth Pty Ltd (ABN: 51 095 284 361)
Paul.Hampson at Anu.edu.au

"No survivors? Then where do the stories come from I wonder?"
-- Capt. Jack Sparrow, "Pirates of the Caribbean"

This email is licensed to the recipient for non-commercial
use, duplication and distribution.
-----------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/uim/attachments/20040625/3bb216d4/attachment.pgp 


More information about the uim mailing list