Back to index

im-sdk  12.3.91
Defines | Functions
i18nPtHdr.c File Reference
#include <sys/param.h>
#include <X11/Xlib.h>
#include <X11/Xproto.h>
#include "FrameMgr.h"
#include "X11R6IMProtoData.h"
#include "Xi18n.h"
#include "XIC_Interface.h"

Go to the source code of this file.

Defines

#define NEED_EVENTS

Functions

Xi18nClient_Xi18nFindClient (Xi18n, CARD16)
int _Xi18nNeedSwap (Xi18n i18n_core, CARD16 connect_id)
void _Xi18nSendMessage (XIMS ims, CARD16 connect_id, CARD8 major_opcode, CARD8 minor_opcode, unsigned char *data, long length)
void _Xi18nSendTriggerKey (XIMS ims, CARD16 connect_id)
void _Xi18nChangeIC (XIMS ims, X11R6IMProtocol call_data, unsigned char *p, int create_flag)
void _Xi18nGetIC (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
void FilterEvent (int icid, XEvent *event)
void GetProtocolVersion (CARD16 client_major, CARD16 client_minor, CARD16 *server_major, CARD16 *server_minor)
static void ConnectMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
static void DisConnectMessageProc (XIMS ims, X11R6IMProtocol call_data)
static void OpenMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
static void CloseMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
static XIMExtMakeExtensionList (Xi18n i18n_core, XIMStr *lib_extension, int number, int *reply_number)
static void QueryExtensionMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
static void SyncReplyMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
static void GetIMValueFromName (Xi18n i18n_core, CARD16 connect_id, char *buf, const char *name, int *length)
static XIMAttributeMakeIMAttributeList (Xi18n i18n_core, CARD16 connect_id, CARD16 *list, int *number, int *length)
static void GetIMValuesMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
static void CreateICMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
static void SetICValuesMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
static void GetICValuesMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
static void SetICFocusMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
static void UnsetICFocusMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
static void DestroyICMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
static void ResetICMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
static int WireEventToEvent (Xi18n i18n_core, xEvent *event, CARD16 serial, XEvent *ev)
static void ForwardEventMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
static void ExtForwardKeyEventMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
static void ExtMoveMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
static void ExtensionMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
static void TriggerNotifyMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
static INT16 ChooseEncoding (Xi18n i18n_core, IMEncodingNegotiationStruct *enc_nego)
static void EncodingNegotiatonMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
void PreeditStartReplyMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
void PreeditCaretReplyMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
void StrConvReplyMessageProc (XIMS ims, X11R6IMProtocol call_data, unsigned char *p)
static void AddQueue (Xi18nClient *client, unsigned char *p)
static void ProcessQueue (XIMS ims, CARD16 connect_id)
void _Xi18nMessageHandler (XIMS ims, CARD16 connect_id, unsigned char *p, Bool *delete)

Define Documentation

#define NEED_EVENTS

Definition at line 32 of file i18nPtHdr.c.


Function Documentation

void _Xi18nChangeIC ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p,
int  create_flag 
)

Definition at line 581 of file i18nIc.c.

                                                 {
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    FmStatus status;
    CARD16 byte_length;
    register int total_size;
    unsigned char *reply = NULL;
    register int i, attrib_num;
    XICAttribute *attrib_list;
    XICAttribute pre_attr[IC_SIZE], sts_attr[IC_SIZE], ic_attr[IC_SIZE];
    CARD16 preedit_ic_num = 0, status_ic_num = 0, ic_num = 0;
    CARD16 connect_id = call_data->any.connect_id;
    IMChangeICStruct *changeic =
      (IMChangeICStruct*)&call_data->changeic;
    extern XimFrameRec create_ic_fr[], create_ic_reply_fr[];
    extern XimFrameRec set_ic_values_fr[], set_ic_values_reply_fr[];
    CARD16 input_method_ID;

    memset(pre_attr, 0, sizeof(XICAttribute) * IC_SIZE);
    memset(sts_attr, 0, sizeof(XICAttribute) * IC_SIZE);
    memset(ic_attr, 0, sizeof(XICAttribute) * IC_SIZE);

    /* create FrameMgr */
    if (create_flag == True) {
       fm = FrameMgrInit(create_ic_fr, (char *)p,
                       _Xi18nNeedSwap(i18n_core, connect_id));
       /* get data */
       FrameMgrGetToken(fm, input_method_ID);
       FrameMgrGetToken(fm, byte_length);
    } else {
       fm = FrameMgrInit(set_ic_values_fr, (char *)p,
                       _Xi18nNeedSwap(i18n_core, connect_id));
       /* get data */
       FrameMgrGetToken(fm, input_method_ID);
       FrameMgrGetToken(fm, changeic->icid);
       FrameMgrGetToken(fm, byte_length);
    }
    attrib_list = (XICAttribute *)malloc(sizeof(XICAttribute) * IC_SIZE);
    if (!attrib_list) {
       _Xi18nSendMessage(ims, connect_id, XIM_ERROR, 0, 0, 0);
       return;
    }
    memset(attrib_list, 0, sizeof(XICAttribute) * IC_SIZE);

    attrib_num = 0;
    while (FrameMgrIsIterLoopEnd(fm, &status) == False) {
       void *value;
       int value_length;
       FrameMgrGetToken(fm, attrib_list[attrib_num].attribute_id);
       FrameMgrGetToken(fm, value_length);
       FrameMgrSetSize(fm, value_length);
       attrib_list[attrib_num].value_length = value_length;
       FrameMgrGetToken(fm, value);
       attrib_list[attrib_num].value = (void *)malloc(value_length + 1);
       memmove(attrib_list[attrib_num].value, value, value_length);
       attrib_num++;
    }

    for (i = 0; i < attrib_num; i++) {
       CARD16 number;
       if (IsNestedList(i18n_core, attrib_list[i].attribute_id)) {
           if (attrib_list[i].attribute_id == i18n_core->address.preeditAttr_id) {
              ReadICValue(i18n_core, attrib_list[i].attribute_id,
                         attrib_list[i].value_length,
                         attrib_list[i].value,
                         &pre_attr[preedit_ic_num], &number,
                         _Xi18nNeedSwap(i18n_core, connect_id));
              preedit_ic_num += number;
           } else if (attrib_list[i].attribute_id == i18n_core->address.statusAttr_id) {
              ReadICValue(i18n_core, attrib_list[i].attribute_id,
                         attrib_list[i].value_length,
                         attrib_list[i].value,
                         &sts_attr[status_ic_num], &number,
                         _Xi18nNeedSwap(i18n_core, connect_id));
              status_ic_num += number;
           } else {
              /* another nested list.. possible? */
           }
       } else {
           ReadICValue(i18n_core, attrib_list[i].attribute_id,
                     attrib_list[i].value_length,
                     attrib_list[i].value,
                     &ic_attr[ic_num], &number,
                     _Xi18nNeedSwap(i18n_core, connect_id));
           ic_num +=number;
       }
    }
    for (i = 0; i < attrib_num; i++) {
       XFree(attrib_list[i].value);
    }
    XFree(attrib_list);

    /* free FrameMgr */
    FrameMgrFree(fm);

    changeic->preedit_attr_num = preedit_ic_num;
    changeic->status_attr_num = status_ic_num;
    changeic->ic_attr_num = ic_num;
    changeic->preedit_attr = pre_attr;
    changeic->status_attr = sts_attr;
    changeic->ic_attr = ic_attr;

#ifdef IM_PROTO_HANDLER
    CALL_PROTO_HANDLER;
#else
    if (create_flag == True) {
      changeic->icid = CreateXIC(ims,
                             connect_id,
                             preedit_ic_num,
                             status_ic_num,
                             ic_num,
                             pre_attr,
                             sts_attr,
                             ic_attr);
    } else {
      SetICValues(changeic->icid,
                preedit_ic_num,
                status_ic_num,
                ic_num,
                pre_attr,
                sts_attr,
                ic_attr);
    }
#endif

    /* need to free attr->value of pre_attr, sts_attr, ic_attr */
    FreeICAttrValues(preedit_ic_num, status_ic_num, ic_num,
                pre_attr, sts_attr, ic_attr);

    /* create FrameMgr */
    if (create_flag == True) {
       fm = FrameMgrInit(create_ic_reply_fr, NULL,
                       _Xi18nNeedSwap(i18n_core, connect_id));
    } else {
       fm = FrameMgrInit(set_ic_values_reply_fr, NULL,
                       _Xi18nNeedSwap(i18n_core, connect_id));
    }
    total_size = FrameMgrGetTotalSize(fm);
    reply = (unsigned char *)malloc(total_size);
    if (!reply) {
       _Xi18nSendMessage(ims, connect_id, XIM_ERROR, 0, 0, 0);
       return;
    }
    memset(reply, 0, total_size);
    FrameMgrSetBuffer(fm, reply);

    FrameMgrPutToken(fm, input_method_ID);
    FrameMgrPutToken(fm, changeic->icid);

    if (create_flag == True) {
       _Xi18nSendMessage(ims, connect_id, XIM_CREATE_IC_REPLY, 0,
                       reply, total_size);
    } else {
       _Xi18nSendMessage(ims, connect_id, XIM_SET_IC_VALUES_REPLY, 0,
                       reply, total_size);
    }
    if (create_flag == True) {
       int on_key_num = i18n_core->address.on_keys.count_keys;
       int off_key_num = i18n_core->address.off_keys.count_keys;

       if (on_key_num == 0 && off_key_num == 0) {
           long mask;
           if (i18n_core->address.imvalue_mask & I18N_FILTERMASK)
             mask = i18n_core->address.filterevent_mask;
           else
             mask = DEFAULT_FILTER_MASK;
           /* static event flow is default */
           _Xi18nSetEventMask(ims, connect_id,
                            input_method_ID,
                            changeic->icid,
                            mask, ~mask);
       }
    }
    XFree(reply);
    /* free FrameMgr */
    FrameMgrFree(fm);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 70 of file i18nUtil.c.

{
    Xi18nClient *client = i18n_core->address.clients;

    while (client != NULL) {
       if (client->connect_id == connect_id)
         return client;
       client = client->next;
    }
    return NULL;
}
void _Xi18nGetIC ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
)

Definition at line 763 of file i18nIc.c.

{
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    FmStatus status;
    extern XimFrameRec get_ic_values_fr[], get_ic_values_reply_fr[];
    CARD16 byte_length;
    register int total_size;
    unsigned char *reply = NULL;
    XICAttribute *preedit_ret = NULL, *status_ret = NULL;
    register int i, number;
    int iter_count;
    CARD16 *attrID_list;
    XICAttribute pre_attr[IC_SIZE], sts_attr[IC_SIZE], ic_attr[IC_SIZE];
    CARD16 pre_count = 0, sts_count = 0, ic_count = 0;
    IMChangeICStruct *getic =
      (IMChangeICStruct*)&call_data->changeic;
    CARD16 connect_id = call_data->any.connect_id;
    CARD16 input_method_ID;

    memset(pre_attr, 0, sizeof(XICAttribute) * IC_SIZE);
    memset(sts_attr, 0, sizeof(XICAttribute) * IC_SIZE);
    memset(ic_attr, 0, sizeof(XICAttribute) * IC_SIZE);

    /* create FrameMgr */
    fm = FrameMgrInit(get_ic_values_fr, (char *)p,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    /* get data */
    FrameMgrGetToken(fm, input_method_ID);
    FrameMgrGetToken(fm, getic->icid);
    FrameMgrGetToken(fm, byte_length);

    attrID_list = (CARD16 *)malloc(sizeof(CARD16) * IC_SIZE); /* bogus */
    memset(attrID_list, 0, sizeof(CARD16) * IC_SIZE);

    number = 0;
    while (FrameMgrIsIterLoopEnd(fm, &status) == False) {
       FrameMgrGetToken(fm, attrID_list[number]);
       number++;
    }
    /* free FrameMgr */
    FrameMgrFree(fm);

    i = 0;
    while (i < number) {
       int read_number;
       if (IsNestedList(i18n_core, attrID_list[i])) {
           if (attrID_list[i] == i18n_core->address.preeditAttr_id) {
              GetICValue(i18n_core, &pre_attr[pre_count],
                        &attrID_list[i], number, &read_number);
              i += read_number + 1;
              pre_count += read_number;
           } else if (attrID_list[i] == i18n_core->address.statusAttr_id) {
              GetICValue(i18n_core, &sts_attr[sts_count],
                        &attrID_list[i], number, &read_number);
              i += read_number + 1;
              sts_count += read_number;
           } else {
              /* another nested list.. possible? */
           }
       } else {
           GetICValue(i18n_core, &ic_attr[ic_count], &attrID_list[i],
                     number, &read_number);
           i += read_number;
           ic_count += read_number;
       }
    }
    getic->preedit_attr_num = pre_count;
    getic->status_attr_num = sts_count;
    getic->ic_attr_num = ic_count;
    getic->preedit_attr = pre_attr;
    getic->status_attr = sts_attr;
    getic->ic_attr = ic_attr;

    XFree(attrID_list);

#ifdef IM_PROTO_HANDLER
    CALL_PROTO_HANDLER;
#else
    GetICValues(getic->icid,
              pre_count, sts_count, ic_count,
              pre_attr, sts_attr, ic_attr);
#endif

    iter_count = getic->ic_attr_num;

    preedit_ret = CreateNestedList(i18n_core->address.preeditAttr_id,
                               getic->preedit_attr,
                               getic->preedit_attr_num,
                               _Xi18nNeedSwap(i18n_core, connect_id));
    if (preedit_ret != NULL)
      iter_count++;
    status_ret = CreateNestedList(i18n_core->address.statusAttr_id,
                              getic->status_attr,
                              getic->status_attr_num,
                              _Xi18nNeedSwap(i18n_core, connect_id));
    if (status_ret != NULL)
      iter_count++;

    /* create FrameMgr */
    fm = FrameMgrInit(get_ic_values_reply_fr, NULL,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    /* set iteration count for list of ic_attribute */
    FrameMgrSetIterCount(fm, iter_count);

    /* set length of BARRAY item in xicattribute_fr*/
    for (i = 0; i < (int)getic->ic_attr_num; i++) {
       FrameMgrSetSize(fm, ic_attr[i].value_length);
    }

    if (preedit_ret != NULL)
      FrameMgrSetSize(fm, preedit_ret->value_length);
    if (status_ret != NULL)
      FrameMgrSetSize(fm, status_ret->value_length);

    total_size = FrameMgrGetTotalSize(fm);
    reply = (unsigned char *)malloc(total_size);
    if (!reply) {
       _Xi18nSendMessage(ims, connect_id, XIM_ERROR, 0, 0, 0);
       return;
    }
    memset(reply, 0, total_size);
    FrameMgrSetBuffer(fm, reply);

    FrameMgrPutToken(fm, input_method_ID);
    FrameMgrPutToken(fm, getic->icid);

    for (i = 0; i < (int)getic->ic_attr_num; i++) {
       FrameMgrPutToken(fm, ic_attr[i].attribute_id);
       FrameMgrPutToken(fm, ic_attr[i].value_length);
       FrameMgrPutToken(fm, ic_attr[i].value);
    }
    if (preedit_ret != NULL) {
       FrameMgrPutToken(fm, preedit_ret->attribute_id);
       FrameMgrPutToken(fm, preedit_ret->value_length);
       FrameMgrPutToken(fm, preedit_ret->value);
    }
    if (status_ret != NULL) {
       FrameMgrPutToken(fm, status_ret->attribute_id);
       FrameMgrPutToken(fm, status_ret->value_length);
       FrameMgrPutToken(fm, status_ret->value);
    }
    _Xi18nSendMessage(ims, connect_id,
                    XIM_GET_IC_VALUES_REPLY, 0, reply, total_size);
    XFree(reply);

    /* need to free attr->name of pre_attr, sts_attr, ic_attr */
    FreeICAttrValues(pre_count, sts_count, ic_count,
              pre_attr, sts_attr, ic_attr);

    /* need to free attr->name of pre_attr, sts_attr, ic_attr */
    FreeICAttrNames(pre_count, sts_count, ic_count,
              pre_attr, sts_attr, ic_attr);

    if (preedit_ret != NULL) {
       XFree(preedit_ret->value);
       XFree(preedit_ret);
    }
    if (status_ret != NULL) {
       XFree(status_ret->value);
       XFree(status_ret);
    }
    /* free FrameMgr */
    FrameMgrFree(fm);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _Xi18nMessageHandler ( XIMS  ims,
CARD16  connect_id,
unsigned char *  p,
Bool delete 
)

Definition at line 1508 of file i18nPtHdr.c.

                                                   {
    XimProtoHdr      *hdr = (XimProtoHdr *)p;
    unsigned char *p1 = (unsigned char *)(hdr + 1);
    X11R6IMProtocolStruct call_data;
    Xi18n i18n_core = ims->protocol;
    Xi18nClient *client = (Xi18nClient *)_Xi18nFindClient(i18n_core,
                                                   connect_id);

    if (hdr == (XimProtoHdr*)NULL) return;

    memset(&call_data, 0, sizeof(X11R6IMProtocolStruct));

    call_data.major_code = hdr->major_opcode;
    call_data.any.minor_code = hdr->minor_opcode;
    call_data.any.connect_id = connect_id;

    switch (call_data.major_code) {
      case XIM_CONNECT:
       ConnectMessageProc(ims, &call_data, p1);
       break;
      case XIM_DISCONNECT:
       DisConnectMessageProc(ims, &call_data);
       break;
      case XIM_OPEN:
       OpenMessageProc(ims, &call_data, p1);
       break;
      case XIM_CLOSE:
       CloseMessageProc(ims, &call_data, p1);
       break;
      case XIM_QUERY_EXTENSION:
       QueryExtensionMessageProc(ims, &call_data, p1);
       break;
      case XIM_GET_IM_VALUES:
       GetIMValuesMessageProc(ims, &call_data, p1);
       break;
      case XIM_CREATE_IC:
       CreateICMessageProc(ims, &call_data, p1);
       break;
      case XIM_SET_IC_VALUES:
       SetICValuesMessageProc(ims, &call_data, p1);
       break;
      case XIM_GET_IC_VALUES:
       GetICValuesMessageProc(ims, &call_data, p1);
       break;
      case XIM_SET_IC_FOCUS:
       SetICFocusMessageProc(ims, &call_data, p1);
       break;
      case XIM_UNSET_IC_FOCUS:
       UnsetICFocusMessageProc(ims, &call_data, p1);
       break;
      case XIM_DESTROY_IC:
       DestroyICMessageProc(ims, &call_data, p1);
       break;
      case XIM_RESET_IC:
       ResetICMessageProc(ims, &call_data, p1);
       break;
      case XIM_FORWARD_EVENT:
       if (client->sync == True) {
           AddQueue(client, p);
           *delete = False;
       } else {
           ForwardEventMessageProc(ims, &call_data, p1);
       }
       break;
      case XIM_EXTENSION:
       ExtensionMessageProc(ims, &call_data, p1);
       break;
      case XIM_SYNC:
       break;
      case XIM_SYNC_REPLY:
       SyncReplyMessageProc(ims, &call_data, p1);
       ProcessQueue(ims, connect_id);
       break;
      case XIM_TRIGGER_NOTIFY:
       TriggerNotifyMessageProc(ims, &call_data, p1);
       break;
      case XIM_ENCODING_NEGOTIATION:
       EncodingNegotiatonMessageProc(ims, &call_data, p1);
       break;
      case XIM_PREEDIT_START_REPLY:
       PreeditStartReplyMessageProc(ims, &call_data, p1);
       break;
      case XIM_PREEDIT_CARET_REPLY:
       PreeditCaretReplyMessageProc(ims, &call_data, p1);
       break;
      case XIM_STR_CONVERSION_REPLY:
       StrConvReplyMessageProc(ims, &call_data, p1);
       break;
      default:
       break;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

int _Xi18nNeedSwap ( Xi18n  i18n_core,
CARD16  connect_id 
)

Definition at line 37 of file i18nUtil.c.

{
    CARD8 im_byteOrder = i18n_core->address.im_byteOrder;
    Xi18nClient *client = _Xi18nFindClient(i18n_core, connect_id);
    
    return (client->byte_order != im_byteOrder);
}

Here is the call graph for this function:

void _Xi18nSendMessage ( XIMS  ims,
CARD16  connect_id,
CARD8  major_opcode,
CARD8  minor_opcode,
unsigned char *  data,
long  length 
)

Definition at line 107 of file i18nUtil.c.

{
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    extern XimFrameRec packet_header_fr[];
    unsigned char *reply_hdr = NULL;
    int header_size;
    unsigned char *reply = NULL;
    unsigned char *replyp;
    int reply_length;
    long p_len = length/4;

    /* create FrameMgr */
    fm = FrameMgrInit(packet_header_fr, NULL,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    header_size = FrameMgrGetTotalSize(fm);
    reply_hdr = (unsigned char *)malloc(header_size);
    if (!reply_hdr) {
       _Xi18nSendMessage(ims, connect_id, XIM_ERROR, 0, 0, 0);
       return;
    }
    FrameMgrSetBuffer(fm, reply_hdr);

    /* put data */
    FrameMgrPutToken(fm, major_opcode);
    FrameMgrPutToken(fm, minor_opcode);
    FrameMgrPutToken(fm, p_len);

    reply_length = header_size + length;
    reply = (unsigned char *)malloc(reply_length);
    replyp = reply;
    memmove(reply, reply_hdr, header_size);
    replyp += header_size;
    memmove(replyp, data, length);

    i18n_core->methods.send(ims, connect_id, reply, reply_length);

    XFree(reply_hdr);
    XFree(reply);
    /* free FrameMgr */
    FrameMgrFree(fm);

    return;
}

Here is the call graph for this function:

void _Xi18nSendTriggerKey ( XIMS  ims,
CARD16  connect_id 
)

Definition at line 156 of file i18nUtil.c.

{
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    extern XimFrameRec register_triggerkeys_fr[];
    XIMTriggerKey *on_keys = i18n_core->address.on_keys.keylist;
    XIMTriggerKey *off_keys = i18n_core->address.off_keys.keylist;
    int on_key_num = i18n_core->address.on_keys.count_keys;
    int off_key_num = i18n_core->address.off_keys.count_keys;
    unsigned char *reply = NULL;
    register int i, total_size;
    CARD16 im_id;

    if (on_key_num == 0 && off_key_num == 0)
      return;

    /* create FrameMgr */
    fm = FrameMgrInit(register_triggerkeys_fr, NULL,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    /* set iteration count for on-keys list */
    FrameMgrSetIterCount(fm, on_key_num);
    /* set iteration count for off-keys list */
    FrameMgrSetIterCount(fm, off_key_num);

    /* get total_size */
    total_size = FrameMgrGetTotalSize(fm);

    reply = (unsigned char *)malloc(total_size);
    if (!reply) {
       return;
    }
    memset(reply, 0, total_size);
    FrameMgrSetBuffer(fm, reply);

    /* Right now XIM_OPEN_REPLY hasn't been sent to this new client, so
       the input-method-id is still invalid, and should be set to zero...
       Reter to $(XC)/lib/X11/imDefLkup.c:_XimRegisterTriggerKeysCallback
     */
    im_id = 0;
    FrameMgrPutToken(fm, im_id); /* input-method-id */
    for (i = 0; i < on_key_num; i++) {
       FrameMgrPutToken(fm, on_keys[i].keysym);
       FrameMgrPutToken(fm, on_keys[i].modifier);
       FrameMgrPutToken(fm, on_keys[i].modifier_mask);
    }
    for (i = 0; i < off_key_num; i++) {
       FrameMgrPutToken(fm, off_keys[i].keysym);
       FrameMgrPutToken(fm, off_keys[i].modifier);
       FrameMgrPutToken(fm, off_keys[i].modifier_mask);
    }

    _Xi18nSendMessage(ims, connect_id, XIM_REGISTER_TRIGGERKEYS, 0,
                    reply, total_size);

    XFree(reply);
    /* free FrameMgr */
    FrameMgrFree(fm);

    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void AddQueue ( Xi18nClient client,
unsigned char *  p 
) [static]

Definition at line 1459 of file i18nPtHdr.c.

                                                {
    XIMPending        *new_pend, *last;

    if ((new_pend = (XIMPending *)malloc(sizeof(XIMPending))) == NULL)
      return;
    new_pend->p = p;
    new_pend->next = (XIMPending *)NULL;
    if (!client->pending)
      client->pending = new_pend;
    else {
       for (last = client->pending; last->next; last = last->next);
       last->next = new_pend;
    }
    return;
}

Here is the caller graph for this function:

static INT16 ChooseEncoding ( Xi18n  i18n_core,
IMEncodingNegotiationStruct enc_nego 
) [static]

Definition at line 1215 of file i18nPtHdr.c.

{
    Xi18nAddressRec *address = (Xi18nAddressRec *)&i18n_core->address;
    XIMEncodings *p;
    int i, j;
    int enc_index;

    p = (XIMEncodings*)&address->encoding_list;
    for (i = 0; i < (int)p->count_encodings; i++) {
       for (j = 0; j < (int)enc_nego->encoding_number; j++) {
           if (!strcmp(p->supported_encodings[i],
                     enc_nego->encoding[j].name)) {
              enc_index = j;
              break;
           }
       }
    }
    /*
      Encoinding Negotiation isn't supported yet in the IMlibrary, so
      rather safe and sound to always return XIM_Default_Encoding_IDX(-1).
     */
    return (INT16)XIM_Default_Encoding_IDX;
}

Here is the caller graph for this function:

static void CloseMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
) [static]

Definition at line 235 of file i18nPtHdr.c.

                                                                        {
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    extern XimFrameRec close_fr[], close_reply_fr[];
    unsigned char *reply = NULL;
    register int total_size;
    CARD16 connect_id = call_data->any.connect_id;
    CARD16 input_method_ID;

    /* create FrameMgr */
    fm = FrameMgrInit(close_fr, (char *)p,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    FrameMgrGetToken(fm, input_method_ID);

    /* free FrameMgr */
    FrameMgrFree(fm);

#ifdef IM_PROTO_HANDLER
    CALL_PROTO_HANDLER;
#else
    /* nothing to do here */
#endif

    /* create FrameMgr */
    fm = FrameMgrInit(close_reply_fr, NULL,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    total_size = FrameMgrGetTotalSize(fm);
    reply = (unsigned char *)malloc(total_size);
    if (!reply) {
       _Xi18nSendMessage(ims, connect_id, XIM_ERROR,
                       0, 0, 0);
       return;
    }
    memset(reply, 0, total_size);
    FrameMgrSetBuffer(fm, reply);

    FrameMgrPutToken(fm, input_method_ID);

    _Xi18nSendMessage(ims, connect_id, XIM_CLOSE_REPLY,
                    0, reply, total_size);

    XFree(reply);
    /* free FrameMgr */
    FrameMgrFree(fm);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void ConnectMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
) [static]

Definition at line 61 of file i18nPtHdr.c.

                                                                          {
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    extern XimFrameRec connect_fr[], connect_reply_fr[];
    register int total_size;
    CARD16 server_major_version, server_minor_version;
    unsigned char *reply = NULL;
    IMConnectStruct *imconnect =
      (IMConnectStruct*)&call_data->imconnect;
    CARD16 connect_id = call_data->any.connect_id;

    /* create FrameMgr */
    fm = FrameMgrInit(connect_fr, (char *)p,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    /* get data */
    FrameMgrGetToken(fm, imconnect->byte_order);
    FrameMgrGetToken(fm, imconnect->major_version);
    FrameMgrGetToken(fm, imconnect->minor_version);

    /* free FrameMgr */
    FrameMgrFree(fm);

    GetProtocolVersion(imconnect->major_version, imconnect->minor_version,
                     &server_major_version, &server_minor_version);
#ifdef IM_PROTO_HANDLER
    CALL_PROTO_HANDLER;
#else
    /* nothing to do here */
#endif

    /* create FrameMgr */
    fm = FrameMgrInit(connect_reply_fr, NULL,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    total_size = FrameMgrGetTotalSize(fm);
    reply = (unsigned char *)malloc(total_size);
    if (!reply) {
       _Xi18nSendMessage(ims, connect_id, XIM_ERROR, 0, 0, 0);
       return;
    }
    memset(reply, 0, total_size);
    FrameMgrSetBuffer(fm, reply);

    FrameMgrPutToken(fm, server_major_version);
    FrameMgrPutToken(fm, server_minor_version);

    _Xi18nSendMessage(ims, connect_id, XIM_CONNECT_REPLY,
                    0, reply, total_size);

    XFree(reply);
    /* free FrameMgr */
    FrameMgrFree(fm);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void CreateICMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
) [static]

Definition at line 692 of file i18nPtHdr.c.

{
    _Xi18nChangeIC(ims, call_data, p, True);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void DestroyICMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
) [static]

Definition at line 787 of file i18nPtHdr.c.

{
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    extern XimFrameRec destroy_ic_fr[], destroy_ic_reply_fr[];
    register int total_size;
    unsigned char *reply = NULL;
    IMDestroyICStruct *destroy =
      (IMDestroyICStruct*)&call_data->destroyic;
    CARD16 connect_id = call_data->any.connect_id;
    CARD16 input_method_ID;

    /* create FrameMgr */
    fm = FrameMgrInit(destroy_ic_fr, (char *)p,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    /* get data */
    FrameMgrGetToken(fm, input_method_ID);
    FrameMgrGetToken(fm, destroy->icid);

    /* free FrameMgr */
    FrameMgrFree(fm);

#ifdef IM_PROTO_HANDLER
    CALL_PROTO_HANDLER;
#else
    DestroyIC(destroy->icid);
#endif

    /* create FrameMgr */
    fm = FrameMgrInit(destroy_ic_reply_fr, NULL,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    total_size = FrameMgrGetTotalSize(fm);
    reply = (unsigned char *)malloc(total_size);
    if (!reply) {
       _Xi18nSendMessage(ims, connect_id, XIM_ERROR, 0, 0, 0);
       return;
    }
    memset(reply, 0, total_size);
    FrameMgrSetBuffer(fm, reply);

    FrameMgrPutToken(fm, input_method_ID);
    FrameMgrPutToken(fm, destroy->icid);

    _Xi18nSendMessage(ims, connect_id,
                    XIM_DESTROY_IC_REPLY, 0, reply, total_size);
    XFree(reply);
    /* free FrameMgr */
    FrameMgrFree(fm);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void DisConnectMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data 
) [static]

Definition at line 118 of file i18nPtHdr.c.

                                                           {
    Xi18n i18n_core = ims->protocol;
    unsigned char *reply = NULL;
    CARD16 connect_id = call_data->any.connect_id;

#ifdef IM_PROTO_HANDLER
    CALL_PROTO_HANDLER;
#else
    /* destroy all remaining input contexts for this connection */
#endif

    _Xi18nSendMessage(ims, connect_id, XIM_DISCONNECT_REPLY,
                    0, reply, 0);

    i18n_core->methods.disconnect(ims, connect_id);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void EncodingNegotiatonMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
) [static]

Definition at line 1241 of file i18nPtHdr.c.

{
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    FmStatus status;
    CARD16 byte_length;
    extern XimFrameRec encoding_negotiation_fr[];
    extern XimFrameRec encoding_negotiation_reply_fr[];
    register int i, number, total_size;
    unsigned char *reply = NULL;
    IMEncodingNegotiationStruct *enc_nego =
      (IMEncodingNegotiationStruct *)&call_data->encodingnego;
    CARD16 connect_id = call_data->any.connect_id;
    CARD16 input_method_ID;
    XPointer listofStr = NULL;
    XPointer listofStr_p;

    fm = FrameMgrInit(encoding_negotiation_fr, (char *)p,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    FrameMgrGetToken(fm, input_method_ID);

    /* get ENCODING STR field */
    FrameMgrGetToken(fm, byte_length);
    if (byte_length > 0) {
       listofStr = (XPointer)malloc(byte_length);
       memset(listofStr, 0, byte_length);
       listofStr_p = listofStr;

       number = 0;
       while (FrameMgrIsIterLoopEnd(fm, &status) == False) {
           char *name;
           CARD8 str_length;
           FrameMgrGetToken(fm, str_length);
           FrameMgrSetSize(fm, str_length);
           memmove(listofStr_p++, &str_length, 1);
           FrameMgrGetToken(fm, name);
           strncpy(listofStr_p, name, str_length);
           listofStr_p += str_length;
           number++;
       }
       enc_nego->encoding_number = number;
       if (number > 0) {
           enc_nego->encoding = (XIMStr *)malloc(sizeof(XIMStr) * number);
           memset(enc_nego->encoding, 0, sizeof(XIMStr) * number);

           for (listofStr_p = listofStr,i = 0; i < number; i++) {
              CARD8 str_length;
              str_length = (CARD8)(*listofStr_p++);
              enc_nego->encoding[i].length = str_length;
              enc_nego->encoding[i].name = malloc(str_length + 1);
              memmove(enc_nego->encoding[i].name, listofStr_p, str_length);
              enc_nego->encoding[i].name[str_length] = (char)0;
              listofStr_p += str_length;
           }
       }
       XFree(listofStr);
    }
    /* get ENCODING INFO field */
    FrameMgrGetToken(fm, byte_length);
    if (byte_length > 0) {
       listofStr = (XPointer)malloc(byte_length);
       memset(listofStr, 0, byte_length);
       listofStr_p = listofStr;

       number = 0;
       while (FrameMgrIsIterLoopEnd(fm, &status) == False) {
           char *name;
           CARD8 str_length;
           FrameMgrGetToken(fm, str_length);
           FrameMgrSetSize(fm, str_length);
           memmove(listofStr_p++, &str_length, 1);
           FrameMgrGetToken(fm, name);
           strncpy(listofStr_p, name, str_length);
           listofStr_p += str_length;
           number++;
       }
       enc_nego->encoding_info_number = number;
       if (number > 0) {
           enc_nego->encodinginfo = (XIMStr *)
              malloc(sizeof(XIMStr) * number);
           memset(enc_nego->encoding, 0, sizeof(XIMStr) * number);

           for (listofStr_p = listofStr, i = 0; i < number; i++) {
              CARD8 str_length;
              str_length = (CARD8)(*listofStr_p++);
              enc_nego->encodinginfo[i].length = str_length;
              enc_nego->encodinginfo[i].name = malloc(str_length + 1);
              memmove(enc_nego->encodinginfo[i].name,
                     listofStr_p, str_length);
              enc_nego->encodinginfo[i].name[str_length] = (char)0;
              listofStr_p += str_length;
           }
       }
    }

    enc_nego->enc_index = ChooseEncoding(i18n_core, enc_nego);
    enc_nego->category = 0;

#ifdef IM_PROTO_HANDLER
    CALL_PROTO_HANDLER;
#else
    /* nothing to do here */
#endif

    /* free FrameMgr */
    FrameMgrFree(fm);

    /* create FrameMgr */
    fm = FrameMgrInit(encoding_negotiation_reply_fr, NULL,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    total_size = FrameMgrGetTotalSize(fm);
    reply = (unsigned char *)malloc(total_size);
    if (!reply) {
       _Xi18nSendMessage(ims, connect_id, XIM_ERROR, 0, 0, 0);
       return;
    }
    memset(reply, 0, total_size);
    FrameMgrSetBuffer(fm, reply);

    FrameMgrPutToken(fm, input_method_ID);
    FrameMgrPutToken(fm, enc_nego->category);
    FrameMgrPutToken(fm, enc_nego->enc_index);

    _Xi18nSendMessage(ims, connect_id,
                    XIM_ENCODING_NEGOTIATION_REPLY, 0, reply, total_size);
    XFree(reply);

    /* free data for encoding list */
    if (enc_nego->encoding != NULL) {
       for (i = 0; i < (int)enc_nego->encoding_number; i++) {
           XFree(enc_nego->encoding[i].name);
       }
       XFree(enc_nego->encoding);
    }
    if (enc_nego->encodinginfo != NULL) {
       for (i = 0; i < (int)enc_nego->encoding_info_number; i++) {
           XFree(enc_nego->encodinginfo[i].name);
       }
       XFree(enc_nego->encodinginfo);
    }
    /* free FrameMgr */
    FrameMgrFree(fm);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void ExtensionMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
) [static]

Definition at line 1113 of file i18nPtHdr.c.

{
    switch (call_data->any.minor_code) {
      case XIM_EXT_FORWARD_KEYEVENT:
       ExtForwardKeyEventMessageProc(ims, call_data, p);
       break;
      case XIM_EXT_MOVE:
       ExtMoveMessageProc(ims, call_data, p);
       break;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void ExtForwardKeyEventMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
) [static]

Definition at line 1021 of file i18nPtHdr.c.

{
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    extern XimFrameRec ext_forward_keyevent_fr[];
    CARD8 type, keycode;
    CARD16 state;
    CARD32 ev_time, window;
    IMForwardEventStruct *forward =
      (IMForwardEventStruct*)&call_data->forwardevent;
    XEvent *ev = (XEvent *)&forward->event;
    CARD16 connect_id = call_data->any.connect_id;
    CARD16 input_method_ID;

    /* create FrameMgr */
    fm = FrameMgrInit(ext_forward_keyevent_fr, (char *)p,
                    _Xi18nNeedSwap(i18n_core, connect_id));
    /* get data */
    FrameMgrGetToken(fm, input_method_ID);
    FrameMgrGetToken(fm, forward->icid);
    FrameMgrGetToken(fm, forward->sync_bit);
    FrameMgrGetToken(fm, forward->serial_number);
    FrameMgrGetToken(fm, type);
    FrameMgrGetToken(fm, keycode);
    FrameMgrGetToken(fm, state);
    FrameMgrGetToken(fm, ev_time);
    FrameMgrGetToken(fm, window);

    /* free FrameMgr */
    FrameMgrFree(fm);

    if (type != KeyPress) {
       _Xi18nSendMessage(ims, connect_id, XIM_ERROR, 0, 0, 0);
       return;
    }
    /* make a faked keypress event */
    ev->type = (int)type;
    ev->xany.send_event = True;
    ev->xany.display = i18n_core->address.dpy;
    ev->xany.serial = (unsigned long)forward->serial_number;
    ((XKeyEvent *)ev)->keycode = (unsigned int)keycode;
    ((XKeyEvent *)ev)->state = (unsigned int)state;
    ((XKeyEvent *)ev)->time = (Time)ev_time;
    ((XKeyEvent *)ev)->window = (Window)window;
    ((XKeyEvent *)ev)->root = DefaultRootWindow(ev->xany.display);
    ((XKeyEvent *)ev)->x = 0;
    ((XKeyEvent *)ev)->y = 0;
    ((XKeyEvent *)ev)->x_root = 0;
    ((XKeyEvent *)ev)->y_root = 0;

#ifdef IM_PROTO_HANDLER
    CALL_PROTO_HANDLER;
#else
    FilterEvent(forward->icid, ev);
#endif
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void ExtMoveMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
) [static]

Definition at line 1081 of file i18nPtHdr.c.

{
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    extern XimFrameRec ext_move_fr[];
    IMMoveStruct *extmove =
      (IMMoveStruct*)&call_data->extmove;
    CARD16 connect_id = call_data->any.connect_id;
    CARD16 input_method_ID;

    /* create FrameMgr */
    fm = FrameMgrInit(ext_move_fr, (char *)p,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    /* get data */
    FrameMgrGetToken(fm, input_method_ID);
    FrameMgrGetToken(fm, extmove->icid);
    FrameMgrGetToken(fm, extmove->x);
    FrameMgrGetToken(fm, extmove->y);

    /* free FrameMgr */
    FrameMgrFree(fm);

#ifdef IM_PROTO_HANDLER
    CALL_PROTO_HANDLER;
#else
    MoveSpot(extmove->icid, extmove->x, extmove->y);
#endif
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void FilterEvent ( int  icid,
XEvent *  event 
)

Definition at line 662 of file R6IMProtocol.cpp.

                                            {
    XInputContext *ic =(XInputContext*)&(xic_list.getItem(icid));

    if (ic) ic->filter_event(event);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static void ForwardEventMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
) [static]

Definition at line 954 of file i18nPtHdr.c.

{
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    extern XimFrameRec forward_event_fr[];
    xEvent wire_event;
    IMForwardEventStruct *forward =
      (IMForwardEventStruct*)&call_data->forwardevent;
    CARD16 connect_id = call_data->any.connect_id;
    CARD16 input_method_ID;
#ifdef FULL_SYNC_MODE
    unsigned char *reply = NULL;
    extern XimFrameRec sync_reply_fr[];
    register int total_size;
#endif

    /* create FrameMgr */
    fm = FrameMgrInit(forward_event_fr, (char *)p,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    /* get data */
    FrameMgrGetToken(fm, input_method_ID);
    FrameMgrGetToken(fm, forward->icid);
    FrameMgrGetToken(fm, forward->sync_bit);
    FrameMgrGetToken(fm, forward->serial_number);
    p += sizeof(CARD16) * 4;
    memmove(&wire_event, p, sizeof(xEvent));

    /* free FrameMgr */
    FrameMgrFree(fm);

    if (WireEventToEvent(i18n_core, &wire_event,
                      forward->serial_number, &forward->event) == True) {
#ifdef IM_PROTO_HANDLER
      CALL_PROTO_HANDLER;
#else
      FilterEvent(forward->icid, &forward->event);
#endif
    }

#ifdef FULL_SYNC_MODE
    /* XIM_SYNC_REPLY needs to be sent to IM library */
    fm = FrameMgrInit(sync_reply_fr, NULL,
                      _Xi18nNeedSwap(i18n_core, connect_id));

    total_size = FrameMgrGetTotalSize(fm);
    reply = (unsigned char *)malloc(total_size);
    if (!reply) {
        _Xi18nSendMessage(ims, connect_id, XIM_ERROR, 0, 0, 0);
        return;
    }
    memset(reply, 0, total_size);
    FrameMgrSetBuffer(fm, reply);

    FrameMgrPutToken(fm, input_method_ID);
    FrameMgrPutToken(fm, forward->icid);

    _Xi18nSendMessage(ims, connect_id, XIM_SYNC_REPLY, 0,
                          reply, total_size);

    FrameMgrFree(fm);
    XFree(reply);
#endif
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void GetICValuesMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
) [static]

Definition at line 706 of file i18nPtHdr.c.

{
    _Xi18nGetIC(ims, call_data, p);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void GetIMValueFromName ( Xi18n  i18n_core,
CARD16  connect_id,
char *  buf,
const char *  name,
int *  length 
) [static]

Definition at line 484 of file i18nPtHdr.c.

                                                           {
    register int i;
    
    if (!strcmp(name, XNQueryInputStyle)) {
       XIMStyles *styles = (XIMStyles*)&i18n_core->address.input_styles;

       *length = sizeof(CARD16) * 2;      /* count_styles, unused */
       *length += styles->count_styles * sizeof(CARD32);

       if (buf != NULL) {
           FrameMgr fm;
           extern XimFrameRec ximstyles_fr[];
           unsigned char *data = NULL;
           int total_size;
           /* create FrameMgr */
           fm = FrameMgrInit(ximstyles_fr, NULL,
                           _Xi18nNeedSwap(i18n_core, connect_id));

           /* set iteration count for list of input_style */
           FrameMgrSetIterCount(fm, styles->count_styles);

           total_size = FrameMgrGetTotalSize(fm);
           data = (unsigned char *)malloc(total_size);
           if (!data) {
              return;
           }
           memset(data, 0, total_size);
           FrameMgrSetBuffer(fm, data);

           FrameMgrPutToken(fm, styles->count_styles);
           for (i = 0; i < (int)styles->count_styles; i++) {
              FrameMgrPutToken(fm, styles->supported_styles[i]);
           }
           memmove(buf, data, total_size);

           XFree(data);
           /* free FrameMgr */
           FrameMgrFree(fm);
       }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void GetIMValuesMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
) [static]

Definition at line 583 of file i18nPtHdr.c.

                                       {
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    FmStatus status;
    extern XimFrameRec get_im_values_fr[], get_im_values_reply_fr[];
    CARD16 byte_length;
    int list_len, total_size;
    unsigned char *reply = NULL;
    int iter_count;
    register int i, j;
    int number;
    CARD16 *im_attrID_list;
    char **name_list;
    CARD16 name_number;
    XIMAttribute *im_attribute_list;
    IMGetIMValuesStruct *getim =
      (IMGetIMValuesStruct *)&call_data->getim;
    CARD16 connect_id = call_data->any.connect_id;
    CARD16 input_method_ID;

    /* create FrameMgr */
    fm = FrameMgrInit(get_im_values_fr, (char *)p,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    FrameMgrGetToken(fm, input_method_ID);
    FrameMgrGetToken(fm, byte_length);
    im_attrID_list = (CARD16 *)malloc(sizeof(CARD16) * 20);
    memset(im_attrID_list, 0, sizeof(CARD16) * 20);
    name_list = (char **)malloc(sizeof(char *) * 20);
    memset(name_list, 0, sizeof(char *) * 20);
    number = 0;
    while (FrameMgrIsIterLoopEnd(fm, &status) == False) {
       FrameMgrGetToken(fm, im_attrID_list[number]);
       number++;
    }
    /* free FrameMgr */
    FrameMgrFree(fm);

    name_number = 0;
    for (i = 0; i < number; i++) {
       for (j = 0; j < i18n_core->address.im_attr_num; j++)
         if (i18n_core->address.xim_attr[j].attribute_id == im_attrID_list[i]) {
             name_list[name_number++] = (char*)i18n_core->address.xim_attr[j].name;
             break;
         }
    }

    getim->number = name_number;
    getim->im_attr_list = name_list;

#ifdef IM_PROTO_HANDLER
    CALL_PROTO_HANDLER;
#endif

    XFree(name_list);

    im_attribute_list = MakeIMAttributeList(i18n_core, connect_id,
                                       im_attrID_list,
                                       &number, &list_len);
    if (im_attrID_list)
      XFree(im_attrID_list);

    /* create FrameMgr */
    fm = FrameMgrInit(get_im_values_reply_fr, NULL,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    iter_count = number;

    /* set iteration count for list of im_attribute */
    FrameMgrSetIterCount(fm, iter_count);

    /* set length of BARRAY item in ximattribute_fr */
    for (i = 0; i < iter_count; i++) {
       FrameMgrSetSize(fm, im_attribute_list[i].value_length);
    }

    total_size = FrameMgrGetTotalSize(fm);
    reply = (unsigned char *)malloc(total_size);
    if (!reply) {
       _Xi18nSendMessage(ims, connect_id, XIM_ERROR, 0, 0, 0);
       return;
    }
    memset(reply, 0, total_size);
    FrameMgrSetBuffer(fm, reply);

    FrameMgrPutToken(fm, input_method_ID);

    for (i = 0; i < iter_count; i++) {
       FrameMgrPutToken(fm, im_attribute_list[i].attribute_id);
       FrameMgrPutToken(fm, im_attribute_list[i].value_length);
       FrameMgrPutToken(fm, im_attribute_list[i].value);
    }
    _Xi18nSendMessage(ims, connect_id,
                    XIM_GET_IM_VALUES_REPLY, 0, reply, total_size);
    XFree(reply);
    /* free FrameMgr */
    FrameMgrFree(fm);

    for (i = 0; i < iter_count; i++) {
       if (im_attribute_list[i].value_length && im_attribute_list[i].value) {
           XFree(im_attribute_list[i].value);
       }
    }
    XFree(im_attribute_list);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GetProtocolVersion ( CARD16  client_major,
CARD16  client_minor,
CARD16 server_major,
CARD16 server_minor 
)

Definition at line 53 of file i18nPtHdr.c.

{
    *server_major = client_major;
    *server_minor = client_minor;
}

Here is the caller graph for this function:

static XIMExt* MakeExtensionList ( Xi18n  i18n_core,
XIMStr lib_extension,
int  number,
int *  reply_number 
) [static]

Definition at line 285 of file i18nPtHdr.c.

                                               {
    XIMExt *ext_list;
    XIMExt *im_ext = (XIMExt *)i18n_core->address.extension;
    int im_ext_len = i18n_core->address.ext_num;
    int i, j;

    *reply_number = 0;

    if (number == 0) {             /* query all extensions */
       *reply_number = im_ext_len;
    } else {
       for (i = 0; i < im_ext_len; i++) {
           for (j = 0; j < (int)number; j++) 
             if (!strcmp(lib_extension[j].name, im_ext[i].name)) {
                (*reply_number)++;
                break;
             }
       }
    }

    if (!(*reply_number))
      return NULL;

    ext_list = (XIMExt *)malloc(sizeof(XIMExt) * (*reply_number));
    if (!ext_list)
      return NULL;
    memset(ext_list, 0, sizeof(XIMExt) * (*reply_number));

    if (number == 0) {             /* query all extensions */
       for (i = 0; i < im_ext_len; i++) {
           ext_list[i].major_opcode = im_ext[i].major_opcode;
           ext_list[i].minor_opcode = im_ext[i].minor_opcode;
           ext_list[i].length = im_ext[i].length;
           ext_list[i].name = malloc(im_ext[i].length + 1);
           strcpy(ext_list[i].name, im_ext[i].name);
       }
    } else {
       int n = 0;
       for (i = 0; i < im_ext_len; i++) {
           for (j = 0; j < (int)number; j++)
             if (!strcmp(lib_extension[j].name, im_ext[i].name)) {
                ext_list[n].major_opcode = im_ext[i].major_opcode;
                ext_list[n].minor_opcode = im_ext[i].minor_opcode;
                ext_list[n].length = im_ext[i].length;
                ext_list[n].name = malloc(im_ext[i].length + 1);
                strcpy(ext_list[n].name, im_ext[i].name);
                n++;
                break;
           }
       }
    }
    return ext_list;
}

Here is the caller graph for this function:

static XIMAttribute* MakeIMAttributeList ( Xi18n  i18n_core,
CARD16  connect_id,
CARD16 list,
int *  number,
int *  length 
) [static]

Definition at line 528 of file i18nPtHdr.c.

                                                          {
    XIMAttribute *attrib_list;
    int list_num;
    XIMAttr *attr = i18n_core->address.xim_attr;
    int list_len = i18n_core->address.im_attr_num;
    register int i, j;
    int value_length;
    int number_ret = 0;

    *length = 0;
    list_num = 0;
    for (i = 0; i < *number; i++) {
       for (j = 0; j < list_len; j++) {
           if (attr[j].attribute_id == list[i]) {
              list_num++;
              break;
           }
       }
    }
    attrib_list = (XIMAttribute *)malloc(sizeof(XIMAttribute) * list_num);
    if (!attrib_list)
      return NULL;
    memset(attrib_list, 0, sizeof(XIMAttribute) * list_num);
    number_ret = list_num;
    list_num = 0;
    for (i = 0; i < *number; i++) {
       for (j = 0; j < list_len; j++) {
           if (attr[j].attribute_id == list[i]) {
              attrib_list[list_num].attribute_id = attr[j].attribute_id;
              attrib_list[list_num].name_length = attr[j].length;
              attrib_list[list_num].name = attr[j].name;
              attrib_list[list_num].type = attr[j].type;
              GetIMValueFromName(i18n_core, connect_id,
                               NULL,
                               attr[j].name, &value_length);
              attrib_list[list_num].value_length = value_length;
              attrib_list[list_num].value = (void *)malloc(value_length);
              memset(attrib_list[list_num].value, 0, value_length);
              GetIMValueFromName(i18n_core, connect_id,
                               attrib_list[list_num].value,
                               attr[j].name, &value_length);
              *length += sizeof(CARD16) * 2;
              *length += value_length;
              *length += IMPAD(value_length);
              list_num++;
              break;
           }
       }
    }
    *number = number_ret;
    return attrib_list;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void OpenMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
) [static]

Definition at line 137 of file i18nPtHdr.c.

                                                                       {
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    extern XimFrameRec open_fr[], open_reply_fr[];
    unsigned char *reply = NULL;
    int str_size;
    register int i, total_size;
    CARD16 connect_id = call_data->any.connect_id;
    int str_length;
    char *name;
    IMOpenStruct *imopen =
      (IMOpenStruct *)&call_data->imopen;

    /* create FrameMgr */
    fm = FrameMgrInit(open_fr, (char *)p,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    /* get data */
    FrameMgrGetToken(fm, str_length);
    FrameMgrSetSize(fm, str_length);
    FrameMgrGetToken(fm, name);
    imopen->lang.length = str_length;
    imopen->lang.name = malloc(str_length + 1);
    strncpy(imopen->lang.name, name, str_length);
    imopen->lang.name[str_length] = (char)0;

    /* free FrameMgr */
    FrameMgrFree(fm);

#ifdef IM_PROTO_HANDLER
    CALL_PROTO_HANDLER;
#else
    /* nothing to do here */
#endif

    if ((i18n_core->address.imvalue_mask & I18N_ON_KEYS) ||
       (i18n_core->address.imvalue_mask & I18N_OFF_KEYS)) {
       _Xi18nSendTriggerKey(ims, connect_id);
    }
    XFree(imopen->lang.name);

    /* create FrameMgr */
    fm = FrameMgrInit(open_reply_fr, NULL,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    /* set iteration count for list of imattr */
    FrameMgrSetIterCount(fm, i18n_core->address.im_attr_num);

    /* set length of BARRAY item in ximattr_fr */
    for (i = 0; i < i18n_core->address.im_attr_num; i++) {
       str_size = strlen(i18n_core->address.xim_attr[i].name);
       FrameMgrSetSize(fm, str_size);
    }
    /* set iteration count for list of icattr */
    FrameMgrSetIterCount(fm, i18n_core->address.ic_attr_num);
    /* set length of BARRAY item in xicattr_fr */
    for (i = 0; i < i18n_core->address.ic_attr_num; i++) {
       str_size = strlen(i18n_core->address.xic_attr[i].name);
       FrameMgrSetSize(fm, str_size);
    }

    total_size = FrameMgrGetTotalSize(fm);
    reply = (unsigned char *)malloc(total_size);
    if (!reply) {
       _Xi18nSendMessage(ims, connect_id, XIM_ERROR, 0, 0, 0);
       return;
    }
    memset(reply, 0, total_size);
    FrameMgrSetBuffer(fm, reply);

    /* input input-method ID */
    FrameMgrPutToken(fm, connect_id);

    for (i = 0; i < i18n_core->address.im_attr_num; i++) {
       str_size = FrameMgrGetSize(fm);
       FrameMgrPutToken(fm, i18n_core->address.xim_attr[i].attribute_id);
       FrameMgrPutToken(fm, i18n_core->address.xim_attr[i].type);
       FrameMgrPutToken(fm, str_size);
       FrameMgrPutToken(fm, i18n_core->address.xim_attr[i].name);
    }
    for (i = 0; i < i18n_core->address.ic_attr_num; i++) {
       str_size = FrameMgrGetSize(fm);
       FrameMgrPutToken(fm, i18n_core->address.xic_attr[i].attribute_id);
       FrameMgrPutToken(fm, i18n_core->address.xic_attr[i].type);
       FrameMgrPutToken(fm, str_size);
       FrameMgrPutToken(fm, i18n_core->address.xic_attr[i].name);
    }

    _Xi18nSendMessage(ims, connect_id, XIM_OPEN_REPLY,
                    0, reply, total_size);

    XFree(reply);
    /* free FrameMgr */
    FrameMgrFree(fm);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PreeditCaretReplyMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
)

Definition at line 1420 of file i18nPtHdr.c.

{
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    extern XimFrameRec preedit_caret_reply_fr[];
    IMPreeditCBStruct *preedit_CB =
      (IMPreeditCBStruct*)&call_data->preedit_callback;
    XIMPreeditCaretCallbackStruct *caret =
      (XIMPreeditCaretCallbackStruct *)&preedit_CB->todo.caret;
    CARD16 connect_id = call_data->any.connect_id;
    CARD16 input_method_ID;

    /* create FrameMgr */
    fm = FrameMgrInit(preedit_caret_reply_fr, (char *)p,
                    _Xi18nNeedSwap(i18n_core, connect_id));
    /* get data */
    FrameMgrGetToken(fm, input_method_ID);
    FrameMgrGetToken(fm, preedit_CB->icid);
    FrameMgrGetToken(fm, caret->position);

    /* free FrameMgr */
    FrameMgrFree(fm);

#ifdef IM_PROTO_HANDLER
    CALL_PROTO_HANDLER;
#endif

    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PreeditStartReplyMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
)

Definition at line 1390 of file i18nPtHdr.c.

{
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    extern XimFrameRec preedit_start_reply_fr[];
    IMPreeditCBStruct *preedit_CB =
      (IMPreeditCBStruct*)&call_data->preedit_callback;
    CARD16 connect_id = call_data->any.connect_id;
    CARD16 input_method_ID;

    /* create FrameMgr */
    fm = FrameMgrInit(preedit_start_reply_fr, (char *)p,
                    _Xi18nNeedSwap(i18n_core, connect_id));
    /* get data */
    FrameMgrGetToken(fm, input_method_ID);
    FrameMgrGetToken(fm, preedit_CB->icid);
    FrameMgrGetToken(fm, preedit_CB->todo.return_value);

    /* free FrameMgr */
    FrameMgrFree(fm);

#ifdef IM_PROTO_HANDLER
    CALL_PROTO_HANDLER;
#endif

    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void ProcessQueue ( XIMS  ims,
CARD16  connect_id 
) [static]

Definition at line 1476 of file i18nPtHdr.c.

                                          {
    Xi18n i18n_core = ims->protocol;
    Xi18nClient *client = (Xi18nClient *)_Xi18nFindClient(i18n_core,
                                                   connect_id);

    while (client->sync == False && client->pending != NULL) {
       XimProtoHdr *hdr = (XimProtoHdr *)client->pending->p;
       unsigned char *p1 = (unsigned char *)(hdr + 1);
       X11R6IMProtocolStruct call_data;

       call_data.major_code = hdr->major_opcode;
       call_data.any.minor_code = hdr->minor_opcode;
       call_data.any.connect_id = connect_id;

       switch (hdr->major_opcode) {
         case XIM_FORWARD_EVENT:
           ForwardEventMessageProc(ims, &call_data, p1);
           break;
         default:
           break;
       }
       XFree(hdr);
       {
           XIMPending *old = client->pending;
           client->pending = old->next;
           XFree(old);
       }
    }
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void QueryExtensionMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
) [static]

Definition at line 341 of file i18nPtHdr.c.

                                         {
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    FmStatus status;
    extern XimFrameRec query_extension_fr[], query_extension_reply_fr[];
    unsigned char *reply = NULL;
    int str_size;
    register int i, number, total_size;
    int byte_length;
    int reply_number = 0;
    XIMExt *ext_list;
    CARD16 connect_id = call_data->any.connect_id;
    CARD16 input_method_ID;
    IMQueryExtensionStruct *query_ext =
      (IMQueryExtensionStruct *)&call_data->queryext;
    XPointer listofStr = NULL;
    XPointer listofStr_p = NULL;

    /* create FrameMgr */
    fm = FrameMgrInit(query_extension_fr, (char *)p,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    FrameMgrGetToken(fm, input_method_ID);
    FrameMgrGetToken(fm, byte_length);
    if (byte_length > 0) {
       listofStr = (XPointer)malloc(byte_length);
       memset(listofStr, 0, byte_length);
       listofStr_p = listofStr;
    }
    number = 0;
    while (FrameMgrIsIterLoopEnd(fm, &status) == False) {
       char *name;
       CARD8 str_length;
       FrameMgrGetToken(fm, str_length);
       FrameMgrSetSize(fm, str_length);
       memmove(listofStr_p++, &str_length, 1);
       FrameMgrGetToken(fm, name);
       strncpy(listofStr_p, name, str_length);
       listofStr_p += str_length;
       number++;
    }
    query_ext->extension = (XIMStr *)malloc(sizeof(XIMStr) * number);
    memset(query_ext->extension, 0, sizeof(XIMStr) * number);
    query_ext->number = number;
    for (listofStr_p = listofStr,i = 0; i < number; i++) {
       CARD8 str_length;
       str_length = (CARD8)(*listofStr_p++);
       query_ext->extension[i].length = str_length;
       query_ext->extension[i].name = malloc(str_length + 1);
       memmove(query_ext->extension[i].name, listofStr_p, str_length);
       query_ext->extension[i].name[str_length] = (char)0;
       listofStr_p += str_length;
    }

    if (listofStr) XFree(listofStr);

#ifdef IM_PROTO_HANDLER
    CALL_PROTO_HANDLER;
#else
    /* nothing to do here  */
#endif

    /* free FrameMgr */
    FrameMgrFree(fm);

    ext_list = MakeExtensionList(i18n_core, query_ext->extension, number,
                             &reply_number);

    for (i = 0; i < number; i++) {
       XFree(query_ext->extension[i].name);
    }
    XFree(query_ext->extension);

    /* create FrameMgr */
    fm = FrameMgrInit(query_extension_reply_fr, NULL,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    /* set iteration count for list of extensions */
    FrameMgrSetIterCount(fm, reply_number);

    /* set length of BARRAY item in ext_fr */
    for (i = 0; i < reply_number; i++) {
       str_size = strlen(ext_list[i].name);
       FrameMgrSetSize(fm, str_size);
    }

    total_size = FrameMgrGetTotalSize(fm);
    reply = (unsigned char *)malloc(total_size);
    if (!reply) {
       _Xi18nSendMessage(ims, connect_id, XIM_ERROR,
                       0, 0, 0);
       return;
    }
    memset(reply, 0, total_size);
    FrameMgrSetBuffer(fm, reply);

    FrameMgrPutToken(fm, input_method_ID);

    for (i = 0; i < reply_number; i++) {
       str_size = FrameMgrGetSize(fm);
       FrameMgrPutToken(fm, ext_list[i].major_opcode);
       FrameMgrPutToken(fm, ext_list[i].minor_opcode);
       FrameMgrPutToken(fm, str_size);
       FrameMgrPutToken(fm, ext_list[i].name);
    }
    _Xi18nSendMessage(ims, connect_id,
                    XIM_QUERY_EXTENSION_REPLY, 0, reply, total_size);
    XFree(reply);
    /* free FrameMgr */
    FrameMgrFree(fm);

    for (i = 0; i < reply_number; i++) {
       XFree(ext_list[i].name);
    }
    XFree((char *)ext_list);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void ResetICMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
) [static]

Definition at line 841 of file i18nPtHdr.c.

{
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    extern XimFrameRec reset_ic_fr[], reset_ic_reply_fr[];
    register int total_size;
    unsigned char *reply = NULL;
    IMResetICStruct *resetic =
      (IMResetICStruct*)&call_data->resetic;
    CARD16 connect_id = call_data->any.connect_id;
    CARD16 input_method_ID;
    char *mb_data = 0;

    /* create FrameMgr */
    fm = FrameMgrInit(reset_ic_fr, (char *)p,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    /* get data */
    FrameMgrGetToken(fm, input_method_ID);
    FrameMgrGetToken(fm, resetic->icid);

    /* free FrameMgr */
    FrameMgrFree(fm);

#ifdef IM_PROTO_HANDLER
    CALL_PROTO_HANDLER;
#else
    mb_data = ResetIC(resetic->icid);
    if (mb_data) {
      /* mb_data is native encoding, so need to convert to CT */
      XTextProperty prop;
      XmbTextListToTextProperty(i18n_core->address.dpy, &mb_data,
                            1, XCompoundTextStyle, &prop);
      resetic->length = (int)prop.nitems;
      resetic->commit_string = (char*)prop.value;
    } else {
      /* call conversion end */
      /* get it from the results of commit_string */
    }
#endif
    
    /* create FrameMgr */
    fm = FrameMgrInit(reset_ic_reply_fr, NULL,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    /* set length of STRING8 */
    FrameMgrSetSize(fm, resetic->length);

    total_size = FrameMgrGetTotalSize(fm);
    reply = (unsigned char *)malloc(total_size);
    if (!reply) {
       _Xi18nSendMessage(ims, connect_id, XIM_ERROR, 0, 0, 0);
       return;
    }
    memset(reply, 0, total_size);
    FrameMgrSetBuffer(fm, reply);

    FrameMgrPutToken(fm, input_method_ID);
    FrameMgrPutToken(fm, resetic->icid);
    FrameMgrPutToken(fm, resetic->length);
    if (resetic->commit_string && *(resetic->commit_string))
      FrameMgrPutToken(fm, resetic->commit_string);

    _Xi18nSendMessage(ims, connect_id,
                    XIM_RESET_IC_REPLY, 0, reply, total_size);
    /* execute set/unset focus function to redraw status text */
    if (IsFocused(resetic->icid)) {
      SetICFocus(resetic->icid);
    }
    else {
      UnsetICFocus(resetic->icid);
    }
    /* free FrameMgr */
    FrameMgrFree(fm);
    XFree(reply);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void SetICFocusMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
) [static]

Definition at line 713 of file i18nPtHdr.c.

{
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    extern XimFrameRec set_ic_focus_fr[];
    IMChangeFocusStruct *setfocus =
      (IMChangeFocusStruct*)&call_data->changefocus;
    CARD16 connect_id = call_data->any.connect_id;
    CARD16 input_method_ID;
    Xi18nClient *client = (Xi18nClient *)_Xi18nFindClient(i18n_core,
                                                   connect_id);

    while (client->pending_commit != NULL) {
      unsigned char *reply = client->pending_commit;
      int total_size = client->pending_commit_size;
      
      _Xi18nSendMessage(ims, connect_id,
                     XIM_COMMIT, 0, reply, total_size);
      XFree(client->pending_commit);
      client->pending_commit = NULL;
    }

    /* create FrameMgr */
    fm = FrameMgrInit(set_ic_focus_fr, (char *)p,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    /* get data */
    FrameMgrGetToken(fm, input_method_ID);
    FrameMgrGetToken(fm, setfocus->icid);

    /* free FrameMgr */
    FrameMgrFree(fm);

#ifdef IM_PROTO_HANDLER
    CALL_PROTO_HANDLER;
#else
    SetICFocus(setfocus->icid);
#endif

    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void SetICValuesMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
) [static]

Definition at line 699 of file i18nPtHdr.c.

{
    _Xi18nChangeIC(ims, call_data, p, False);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void StrConvReplyMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
)

Definition at line 1452 of file i18nPtHdr.c.

{
    return;
}

Here is the caller graph for this function:

static void SyncReplyMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
) [static]

Definition at line 461 of file i18nPtHdr.c.

                                     {
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    extern XimFrameRec sync_reply_fr[];
    CARD16 connect_id = call_data->any.connect_id;
    Xi18nClient *client = (Xi18nClient *)_Xi18nFindClient(i18n_core,
                                                   connect_id);
    CARD16 input_method_ID, input_context_ID;

    /* create FrameMgr */
    fm = FrameMgrInit(sync_reply_fr, (char *)p,
                    _Xi18nNeedSwap(i18n_core, connect_id));
    FrameMgrGetToken(fm, input_method_ID);
    FrameMgrGetToken(fm, input_context_ID);
    /* free FrameMgr */
    FrameMgrFree(fm);

    client->sync = False;
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void TriggerNotifyMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
) [static]

Definition at line 1126 of file i18nPtHdr.c.

{
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    extern XimFrameRec trigger_notify_fr[], trigger_notify_reply_fr[];
    register int total_size;
    unsigned char *reply = NULL;
    IMTriggerNotifyStruct *trigger =
      (IMTriggerNotifyStruct *)&call_data->triggernotify;
    CARD16 connect_id = call_data->any.connect_id;
    CARD16 input_method_ID;
    CARD32 flag;

    /* create FrameMgr */
    fm = FrameMgrInit(trigger_notify_fr, (char *)p,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    /* get data */
    FrameMgrGetToken(fm, input_method_ID);
    FrameMgrGetToken(fm, trigger->icid);
    FrameMgrGetToken(fm, trigger->flag);
    FrameMgrGetToken(fm, trigger->key_index);
    FrameMgrGetToken(fm, trigger->event_mask);
    /*
      In order to support Front End Method, this event_mask must be saved
      per clients so that it should be restored by an XIM_EXT_SET_EVENT_MASK
      call when preediting mode is reset to off.
     */

    flag = trigger->flag;

    /* free FrameMgr */
    FrameMgrFree(fm);

    /* create FrameMgr */
    fm = FrameMgrInit(trigger_notify_reply_fr, NULL,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    total_size = FrameMgrGetTotalSize(fm);
    reply = (unsigned char *)malloc(total_size);
    if (!reply) {
       _Xi18nSendMessage(ims, connect_id, XIM_ERROR, 0, 0, 0);
       return;
    }
    memset(reply, 0, total_size);
    FrameMgrSetBuffer(fm, reply);

    FrameMgrPutToken(fm, input_method_ID);
    FrameMgrPutToken(fm, trigger->icid);

    if (flag == 0) { /* on key */
#ifndef  FIX_APPLIXWARE_TURBOLINUX42
       /* Applixware will not forward key event when XIM_TRIGGER_NOTIFY_REPLY
          is sent before SET_MASK */
       _Xi18nSendMessage(ims, connect_id, XIM_TRIGGER_NOTIFY_REPLY, 0,
                       reply, total_size);
#endif
       (ims->methods->preeditStart)(ims, call_data);
    }

#ifdef IM_PROTO_HANDLER
    CALL_PROTO_HANDLER;
#else
    if (flag == 0) {
      ConversionStart(trigger->icid);
    } else {
      ConversionEnd(trigger->icid);
    }
#endif
    if (flag == 1) { /* off key */
        (ims->methods->preeditEnd)(ims, call_data);
       _Xi18nSendMessage(ims, connect_id, XIM_TRIGGER_NOTIFY_REPLY, 0,
                       reply, total_size);
    }
#ifdef  FIX_APPLIXWARE_TURBOLINUX42
    if (flag == 0) { /* on key */
       _Xi18nSendMessage(ims, connect_id, XIM_TRIGGER_NOTIFY_REPLY, 0,
                       reply, total_size);
    }
#endif

    /* free FrameMgr */
    FrameMgrFree(fm);
    XFree(reply);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void UnsetICFocusMessageProc ( XIMS  ims,
X11R6IMProtocol  call_data,
unsigned char *  p 
) [static]

Definition at line 756 of file i18nPtHdr.c.

{
    Xi18n i18n_core = ims->protocol;
    FrameMgr fm;
    extern XimFrameRec unset_ic_focus_fr[];
    IMChangeFocusStruct *unsetfocus =
      (IMChangeFocusStruct*)&call_data->changefocus;
    CARD16 connect_id = call_data->any.connect_id;
    CARD16 input_method_ID;

    /* create FrameMgr */
    fm = FrameMgrInit(unset_ic_focus_fr, (char *)p,
                    _Xi18nNeedSwap(i18n_core, connect_id));

    /* get data */
    FrameMgrGetToken(fm, input_method_ID);
    FrameMgrGetToken(fm, unsetfocus->icid);

    /* free FrameMgr */
    FrameMgrFree(fm);

#ifdef IM_PROTO_HANDLER
    CALL_PROTO_HANDLER;
#else
    UnsetICFocus(unsetfocus->icid);
#endif

    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int WireEventToEvent ( Xi18n  i18n_core,
xEvent *  event,
CARD16  serial,
XEvent *  ev 
) [static]

Definition at line 920 of file i18nPtHdr.c.

{
    ev->xany.serial = event->u.u.sequenceNumber & ((unsigned long) 0xffff);
    ev->xany.serial |= serial << 16;
    ev->xany.send_event = False;
    ev->xany.display = i18n_core->address.dpy;
    switch (ev->type = event->u.u.type & 0x7f) {
      case KeyPress:
      case KeyRelease:
       ((XKeyEvent *)ev)->keycode = event->u.u.detail;
       ((XKeyEvent *)ev)->window = event->u.keyButtonPointer.event;
       /* hack */
       if (event->u.keyButtonPointer.state > Mod5Mask) {
         /* linux client */
         ((XKeyEvent *)ev)->state = event->u.keyButtonPointer.state >> 8;
       } else {
         /* Solaris client */
         ((XKeyEvent *)ev)->state = event->u.keyButtonPointer.state;
       }
       ((XKeyEvent *)ev)->time = event->u.keyButtonPointer.time;
       ((XKeyEvent *)ev)->root = event->u.keyButtonPointer.root;
       ((XKeyEvent *)ev)->x = event->u.keyButtonPointer.eventX;
       ((XKeyEvent *)ev)->y = event->u.keyButtonPointer.eventY;
       ((XKeyEvent *)ev)->x_root = 0;
       ((XKeyEvent *)ev)->y_root = 0;
       return True;
      default:
       break;
    }
    return False;
}

Here is the caller graph for this function: