Back to index

im-sdk  12.3.91
Functions | Variables
i18nAttr.c File Reference
#include <X11/Xlib.h>
#include "X11R6IMProtoData.h"
#include "Xi18n.h"

Go to the source code of this file.

Functions

static void CountAttrList (XIMListOfAttr *attr, int *total_count)
static XIMAttrCreateAttrList (Xi18n i18n_core, XIMListOfAttr *attr, int *total_count)
void _Xi18nInitAttrList (Xi18n i18n_core)
void _Xi18nInitExtension (Xi18n i18n_core)
void _Xi18nChangeIMList (Xi18n i18n_core, XPointer value)
void _Xi18nChangeICList (Xi18n i18n_core, XPointer value)

Variables

XIMListOfAttr Default_IMattr []
XIMListOfAttr Default_ICattr []
IMExtList Default_Extension []

Function Documentation

void _Xi18nChangeICList ( Xi18n  i18n_core,
XPointer  value 
)

Definition at line 170 of file i18nAttr.c.

{
    XIMAttr *args;
    int       total_count;

    /* init ICAttr list */
    if (i18n_core->address.xic_attr)
       XFree((char *)i18n_core->address.xic_attr);
    args = CreateAttrList(i18n_core, (XIMListOfAttr*)value, &total_count);

    i18n_core->address.ic_attr_num = total_count;
    i18n_core->address.xic_attr = (XICAttr *)args;

    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _Xi18nChangeIMList ( Xi18n  i18n_core,
XPointer  value 
)

Definition at line 153 of file i18nAttr.c.

{
    XIMAttr *args;
    int       total_count;

    /* init IMAttr list */
    if (i18n_core->address.xim_attr)
       XFree((char *)i18n_core->address.xim_attr);
    args = CreateAttrList(i18n_core, (XIMListOfAttr*)value, &total_count);

    i18n_core->address.im_attr_num = total_count;
    i18n_core->address.xim_attr = (XIMAttr *)args;

    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _Xi18nInitAttrList ( Xi18n  i18n_core)

Definition at line 111 of file i18nAttr.c.

{
    XIMAttr *args;
    int       total_count;

    /* init IMAttr list */
    if (i18n_core->address.xim_attr)
      XFree((char *)i18n_core->address.xim_attr);
    args = CreateAttrList(i18n_core, Default_IMattr, &total_count);

    i18n_core->address.im_attr_num = total_count;
    i18n_core->address.xim_attr = (XIMAttr *)args;

    /* init ICAttr list */
    if (i18n_core->address.xic_attr)
      XFree((char *)i18n_core->address.xic_attr);
    args = CreateAttrList(i18n_core, Default_ICattr, &total_count);

    i18n_core->address.ic_attr_num = total_count;
    i18n_core->address.xic_attr = (XICAttr *)args;

    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _Xi18nInitExtension ( Xi18n  i18n_core)

Definition at line 136 of file i18nAttr.c.

{
    register int i;
    IMExtList *extensions = (IMExtList*)Default_Extension;
    XIMExt *ext_list = (XIMExt*)i18n_core->address.extension;
    
    for (i = 0; extensions->name != NULL; i++, ext_list++, extensions++) {
       ext_list->major_opcode = extensions->major_opcode;
       ext_list->minor_opcode = extensions->minor_opcode;
       ext_list->name = extensions->name;
       ext_list->length = strlen(ext_list->name);
    }
    i18n_core->address.ext_num = i;
    return;
}

Here is the caller graph for this function:

static void CountAttrList ( XIMListOfAttr attr,
int *  total_count 
) [static]

Definition at line 69 of file i18nAttr.c.

{
    *total_count = 0;

    while (attr->name != NULL) {
       attr++;
       ++(*total_count);
    }
}

Here is the caller graph for this function:

static XIMAttr* CreateAttrList ( Xi18n  i18n_core,
XIMListOfAttr attr,
int *  total_count 
) [static]

Definition at line 80 of file i18nAttr.c.

{
    XIMAttr *args, *p;
    unsigned int buf_size;

    CountAttrList(attr, total_count);

    buf_size = (unsigned)(*total_count + 1) * sizeof(XIMAttr);
    args = (XIMAttr *)malloc(buf_size);
    if (!args) return (XIMAttr *)NULL;

    memset(args, 0, buf_size);

    for (p = args; attr->name != NULL; attr++, p++) {
       p->name = attr->name;
       p->length = strlen(attr->name);
       p->type = (CARD16)attr->type;
       p->attribute_id = (attr->id == 0? XrmStringToQuark(p->name) : attr->id);
       if (!strcmp(p->name, XNPreeditAttributes))
         i18n_core->address.preeditAttr_id = p->attribute_id;
       else if (!strcmp(p->name, XNStatusAttributes))
         i18n_core->address.statusAttr_id = p->attribute_id;
       else if (!strcmp(p->name, XNSeparatorofNestedList))
         i18n_core->address.separatorAttr_id = p->attribute_id;
    }
    p->name = (char*)NULL;

    return args;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Initial value:
 {
    {"XIM_EXT_MOVE", XIM_EXTENSION, XIM_EXT_MOVE},
    {"XIM_EXT_SET_EVENT_MASK", XIM_EXTENSION, XIM_EXT_SET_EVENT_MASK},
    {"XIM_EXT_FORWARD_KEYEVENT", XIM_EXTENSION, XIM_EXT_FORWARD_KEYEVENT},
    {(char *)NULL, (CARD8)NULL, (CARD8)NULL}
}

Definition at line 61 of file i18nAttr.c.

Initial value:
 {
    {XNInputStyle, XimType_CARD32, 0},
    {XNClientWindow, XimType_Window, 0},
    {XNFocusWindow, XimType_Window, 0},
    {XNFilterEvents, XimType_CARD32, 0},
    {XNPreeditAttributes, XimType_NEST, 0},
    {XNStatusAttributes, XimType_NEST, 0},
    {XNFontSet, XimType_XFontSet, 0},
    {XNArea, XimType_XRectangle, 0},
    {XNAreaNeeded, XimType_XRectangle, 0},
    {XNColormap, XimType_CARD32, 0},
    {XNStdColormap, XimType_CARD32, 0},
    {XNForeground, XimType_CARD32, 0},
    {XNBackground, XimType_CARD32, 0},
    {XNBackgroundPixmap, XimType_CARD32, 0},
    {XNSpotLocation, XimType_XPoint, 0},
    {XNLineSpace, XimType_CARD32, 0},
    {XNPreeditState, XimType_CARD32, 0},
    {XNCursor, XimType_CARD32, 0},
    {XNSeparatorofNestedList, XimType_SeparatorOfNestedList, 0},
    {(char *)NULL, (CARD16)0, (CARD16)0}
}

Definition at line 38 of file i18nAttr.c.

Initial value:
 {
    {XNQueryInputStyle, XimType_XIMStyles, 0},
    {(char *)NULL, (CARD16)0, (CARD16)0}
}

Definition at line 33 of file i18nAttr.c.