Back to index

im-sdk  12.3.91
Defines | Functions
iiimpIC.h File Reference
#include <X11/X.h>
#include <X11/Xlib.h>
#include "commonIM.h"
#include "Xlcint.h"
#include "XimpIm.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define _IIIMP_IC_H

Functions

void ChangePreeditState (XicCommon ic)
void SetConversionMode (XicCommon ic, int mode)
XIC CreateIC (XimCommon im, XIMArg *arg)
Status IIIMP_CreateIC_SWITCH (XIC xic, XIMArg *arg)
char * IIIMP_SetICValues (XIC xic, XIMArg *arg)
char * IIIMP_GetICValues (XIC xic, XIMArg *arg)
int IIIMP_MbLookupString_SWITCH (XIC xic, XKeyEvent *ev, char *buffer, int len, KeySym *keysym, Status *status)
int IIIMP_WcLookupString_SWITCH (XIC xic, XKeyEvent *ev, wchar_t *buffer, int len, KeySym *keysym, Status *status)
void HoldXKeyEvent (XicCommon ic, XEvent *ev)
void PutBackXKeyEvent (XicCommon ic)

Define Documentation

#define _IIIMP_IC_H

Definition at line 52 of file iiimpIC.h.


Function Documentation

Definition at line 156 of file iiimpIC.c.

{
    if (ic->core.preedit_attr.preedit_state == XIMPreeditEnable &&
       !IsConversionMode(ic)) {
       SetConversionMode(ic, True);
       IMTriggerNotify(ic, CONV_ON);
    }
    if (ic->core.preedit_attr.preedit_state == XIMPreeditDisable &&
       IsConversionMode(ic)) {
       IMTriggerNotify(ic, CONV_OFF);
       SetConversionMode(ic, False);
    }
    return;
}
XIC CreateIC ( XimCommon  im,
XIMArg arg 
)

Definition at line 274 of file iiimpIC.c.

{
    XicCommon ic = (XicCommon)NULL;

    ic = (XicCommon)Xmalloc(sizeof(XicCommonRec));
    if (ic == (XicCommon)NULL) goto Error;
    memset(ic, 0, sizeof(XicCommonRec));

    ic->core.im = (XIM)im;
    ic->methods = get_iiimp_ic_methods();

    if (!CommonCreateIC((XIC)ic, arg)) goto Error;
    
    if (!IIIMP_CreateIC_SWITCH((XIC)ic, arg)) goto Error;

    ic->current_language = im_canonicalize_langname(im);

    _XRegisterFilterByType(ic->core.im->core.display, ic->core.focus_window,
                        KeyPress, KeyRelease,
                        IIIMP_Local_KeyFilter, (XPointer)ic);
    return (XIC)ic;
Error:
    if (ic) Xfree(ic);
    return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void HoldXKeyEvent ( XicCommon  ic,
XEvent *  ev 
)

Definition at line 748 of file iiimpIC.c.

{
    XICKeyEventListRec *    kel;

    kel = (XICKeyEventListRec *)Xmalloc(sizeof (XICKeyEventListRec));
    if (NULL == kel) {
       return;
    }

    memcpy(&(kel->key_event), ev, sizeof (XKeyEvent));
    kel->next = XIC_IIIMP(ic, key_event_list);
    XIC_IIIMP(ic, key_event_list) = kel;

    return;
}
Status IIIMP_CreateIC_SWITCH ( XIC  xic,
XIMArg arg 
)

Definition at line 304 of file iiimpIC.c.

{
    int id;
    XicCommon ic = (XicCommon)xic;
    XimCommon im = (XimCommon)ic->core.im;
    XimpChangeMaskRec dummy;

    ic->core.filter_events = KeyPressMask|ExposureMask|
       ButtonPressMask |PointerMotionMask;
    if (!(ic->iiimp_icpart = Xmalloc(sizeof(XICIIimpIMRec)))) {
       goto Error;
    }
    memset(ic->iiimp_icpart, 0, sizeof(XICIIimpIMRec));
    XIC_IIIMP(ic, switch_methods) = get_switch_ic_methods();
    if (IMCreateIC(im, &XIC_IIIMP(ic, context))
       != IIIMF_STATUS_SUCCESS) {
       goto Error;
    }
    id = XIM_IIIMP(im, counter);
    XIC_IIIMP(ic, id) = id;
    XIM_IIIMP(im, counter) = id + 1;
    SetConversionMode(ic, False);

    memset(&dummy, 0, sizeof(dummy));
    if (SetICValueData(ic, arg, CREATE_IC, &dummy)) {
       goto Error;
    }

    /* switch */
    if (XIM_IS_SWITCH(im)) {
       RegisterSwitchFilter(ic, SwitchFilter,
                          IIIMP_Local_KeyFilter,
                          get_iiimp_ic_methods());
    }

    return True;
Error:
    if (ic->iiimp_icpart)
       Xfree(ic->iiimp_icpart);
    return False;
}
char* IIIMP_GetICValues ( XIC  xic,
XIMArg arg 
)

Definition at line 543 of file iiimpIC.c.

{
    XicCommon ic = (XicCommon)xic;
    XimpChangeMaskRec dummy;
    char *ret = NULL;

    memset(&dummy, 0, sizeof (dummy));

    (void)IMGetICValues(ic, NULL, 0);

    ret = GetICValueData(ic, arg, &dummy);

    return ret;
}
int IIIMP_MbLookupString_SWITCH ( XIC  xic,
XKeyEvent *  ev,
char *  buffer,
int  len,
KeySym keysym,
Status *  status 
)

Definition at line 562 of file iiimpIC.c.

{
    if (XIM_COMPOSE_KEYCODE == ev->keycode) {
       return IIIMP_MbLookupString(xic, ev, buffer, len, keysym, status);
    } else {
       return 0;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* IIIMP_SetICValues ( XIC  xic,
XIMArg arg 
)

Definition at line 526 of file iiimpIC.c.

{
    XicCommon ic = (XicCommon)xic;
    XimpChangeMaskRec dummy;
    char *ret = NULL;

    memset(&dummy, 0, sizeof (dummy));

    ret = SetICValueData(ic, arg, SET_IC, &dummy);

    return ret;
}
int IIIMP_WcLookupString_SWITCH ( XIC  xic,
XKeyEvent *  ev,
wchar_t *  buffer,
int  len,
KeySym keysym,
Status *  status 
)

Definition at line 653 of file iiimpIC.c.

{
    if (XIM_COMPOSE_KEYCODE == ev->keycode) {
       return IIIMP_WcLookupString(xic, ev, buffer, len, keysym, status);
    } else {
       return 0;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 768 of file iiimpIC.c.

{
    XICKeyEventListRec *    key_event_list;
    XICKeyEventListRec *    kel;
    int                     key_event_num;

    key_event_list = XIC_IIIMP(ic, key_event_list);
    if (NULL == key_event_list) {
       return;
    }

    key_event_num = XIC_IIIMP(ic, key_event_num);
    if (key_event_num < 0) {
       key_event_num = 0;
    }

    while (NULL != key_event_list) {
       if (XIM_COMPOSE_KEYCODE != key_event_list->key_event.keycode) {
           key_event_num += 1;
       }
       XPutBackEvent(ic->core.im->core.display,
                    (XEvent *)(&key_event_list->key_event));
       kel = key_event_list->next;
       Xfree(key_event_list);
       key_event_list = kel;
    }

    XIC_IIIMP(ic, key_event_list) = NULL;
    XIC_IIIMP(ic, key_event_num) = key_event_num;

    return;
}
void SetConversionMode ( XicCommon  ic,
int  mode 
)

Definition at line 174 of file iiimpIC.c.

{
    XIC_IIIMP(ic, filtered) = mode;

    ic->core.preedit_attr.preedit_state = ((mode == True) ?
                                      XIMPreeditEnable :
                                      XIMPreeditDisable);
    if ((int)ic->core.preedit_attr.state_notify_callback.callback) {
       XIMPreeditStateNotifyCallbackStruct call_data;
       call_data.state = ic->core.preedit_attr.preedit_state;
       ic->core.preedit_attr.state_notify_callback.callback(
           (XIC)ic,
           ic->core.preedit_attr.state_notify_callback.client_data,
           (XPointer)&call_data
       );
    }
    if (XIM_IS_SWITCH(ic->core.im)) {
       if (mode == False) {        /* CONV_OFF */
           ResetSwitchFilter(ic);
           Ximp_Local_Status_Set(ic);
           Ximp_Local_Status_Draw(ic);
       } else {
           ic->active_filter = IIIMP_Local_KeyFilter;
           ic->active_methods = get_iiimp_ic_methods();
       }
    }
}