On Wed, 29 Jan 2003, Angus Leeming wrote:

> It seems to me that you should post a question to some eastern mailing 
list  
> where you're more likely to find experts at this sort of thing.
> 
> Sorry I can't be of more help.
> Best wishes,
> Angus


I can feel your frustration, but here's a question I'm sure you can 
answer:

The usual way of changing the input context is using  "XSetICValues".
For example, if you have create ic in lib/flresource.c as 
[I]****************
        XPoint location;
        location.x = 0;
        location.y = 0;
        XVaNestedList preedit_list;

        preedit_list = XVaCreateNestedList( 0,
                                           XNSpotLocation, &location,
                                           XNFontSet, fontset,
                                            NULL);
 fl_context->xic = XCreateIC(fl_context->xim,
                                    XNInputStyle, xim_style,
                                    XNPreeditAttributes, preedit_list,
                                    XNStatusAttributes,status_list,
                                    0);
         XFree(preedit_list);
********************

then, the preedit-composition starts at (x=0,y=0). Now, Changing the 
above in flresource.c into

[II]*********************
        XPoint location;
        location.x = 0;
        location.y = 0;
        XVaNestedList preedit_list;

        preedit_list = XVaCreateNestedList( 0,
                                           XNSpotLocation, &location,
                                           XNFontSet, fontset,
                                            NULL);
 fl_context->xic = XCreateIC(fl_context->xim,
                                    XNInputStyle, xim_style,
                                    XNPreeditAttributes, preedit_list,
                                    XNStatusAttributes,status_list,
                                    0);
         XFree(preedit_list);

         location.x = 20;
         location.y = 0;
         preedit_list = XVaCreateNestedList( 0,
                                             XNSpotLocation, &location,
                                              NULL);
         XSetICValues(fl_context->xic,XNPreeditAttributes,preedit_list,0);
         XFree(preedit_list);
********************

makes the preedit-composition starts at (x=20,y=0) instead of (x=0,y=0).

Now if I maintain code [I] in flresource.c and put 


*************************
         location.x = 20;
         location.y = 0;
         preedit_list = XVaCreateNestedList( 0,
                                             XNSpotLocation, &location,
                                              NULL);
         XSetICValues(fl_context->xic,XNPreeditAttributes,preedit_list,0);
         XFree(preedit_list);
**************************


into turn_on_local_input in input.c such as


*******************************
static void turn_on_local_input(FL_OBJECT * ob)
{
    SPEC *sp = ob->spec;

    printf("Turning on CJK local input\n");
    sp->CJK_local_input = 1;
if (fl_context->xic)
                XDestroyIC(fl_context->xic);

        XPoint location;
        location.x = 20;
        location.y = 0;
        XVaNestedList preedit_list;
        XVaNestedList status_list;

        preedit_list = XVaCreateNestedList( 0,
                                           XNSpotLocation, &location,
//                                           XNFontSet, fontset,
                                            NULL);
         XSetICValues(0,XNPreeditAttributes,preedit_list,0);
        
          XFree(preedit_list);
}
*********************************

I should expect the same effect, right? Wrong! No change of xic. That is, 
with this input.c, the composition starts at (x=0,y=0) instead of 
(x=20,y=0). What goes wrong here?  I'm sure you get me right this time.

Regards,


cghan

Reply via email to