Back to index

im-sdk  12.3.91
Functions
XIC_Interface.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int CreateXIC (XIMS ims, CARD16 connect_id, CARD16 preedit_attr_num, CARD16 status_attr_num, CARD16 ic_attr_num, XICAttribute *preedit_attr, XICAttribute *status_attr, XICAttribute *ic_attr)
char * SetICValues (int icid, CARD16 preedit_attr_num, CARD16 status_attr_num, CARD16 ic_attr_num, XICAttribute *preedit_attr, XICAttribute *status_attr, XICAttribute *ic_attr)
char * GetICValues (int icid, CARD16 preedit_attr_num, CARD16 status_attr_num, CARD16 ic_attr_num, XICAttribute *preedit_attr, XICAttribute *status_attr, XICAttribute *ic_attr)
void SetICFocus (int icid)
void UnsetICFocus (int icid)
Bool IsFocused (int icid)
void DestroyIC (int icid)
char * ResetIC (int icid)
void MoveSpot (int icid, int x, int y)
void ConversionStart (int icid)
void ConversionEnd (int icid)

Function Documentation

void ConversionEnd ( int  icid)

Definition at line 692 of file R6IMProtocol.cpp.

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

    if (ic) ic->conversion_end(True);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void ConversionStart ( int  icid)

Definition at line 687 of file R6IMProtocol.cpp.

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

    if (ic) ic->conversion_start(True);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int CreateXIC ( XIMS  ims,
CARD16  connect_id,
CARD16  preedit_attr_num,
CARD16  status_attr_num,
CARD16  ic_attr_num,
XICAttribute preedit_attr,
XICAttribute status_attr,
XICAttribute ic_attr 
)

Definition at line 268 of file R6IMProtocol.cpp.

                                  {
    int id = ims->id;
    XIMPublic *ximp = &(ximp_list.getItem(id));
    char *ret = NULL;

    CARD32 input_style = 0;
    // get input_style from ic_attr
    XICAttribute *icp;
    for (icp = ic_attr; icp < &ic_attr[ic_attr_num]; icp++) {
      if (!strcmp(icp->name, XNInputStyle)) {
       input_style = (*(CARD32*)icp->value);
       break;
      }
    }
    if (input_style == 0) {
      // something is wrong
      return -1;
    }
    XInputContext *ic = new XInputContext((XIMPublic*)ximp,
                                     connect_id,
                                     input_style);
    xic_list.addItem(ic);
    int ic_id = xic_list.getIndex(ic);

    ret = SetICValues(ic_id,
                    preedit_attr_num, status_attr_num, ic_attr_num,
                    preedit_attr, status_attr, ic_attr);
    return ic_id;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void DestroyIC ( int  icid)

Definition at line 667 of file R6IMProtocol.cpp.

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

    if (ic) ic->destroy();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

char* GetICValues ( int  icid,
CARD16  preedit_attr_num,
CARD16  status_attr_num,
CARD16  ic_attr_num,
XICAttribute preedit_attr,
XICAttribute status_attr,
XICAttribute ic_attr 
)

Definition at line 304 of file R6IMProtocol.cpp.

                                         {
    XInputContext *ic =(XInputContext*)&(xic_list.getItem(icid));
  
    // set ic_attr
    XICAttribute *icp;
    for (icp = ic_attr; icp < &ic_attr[ic_attr_num]; icp++) {
      // tcl/tk ja patch requires XNInputStyle in XGetICValues()
      if (!strcmp(icp->name, XNInputStyle)) {
       icp->value = new CARD32;
       ic->get_input_style((*(CARD32*)icp->value));
       icp->value_length = sizeof(CARD32);
      }
      if (!strcmp(icp->name, XNClientWindow)) {
       Window tmp;
       icp->value = new CARD32;
       ic->get_client_window(tmp);
       *(CARD32*)icp->value = (CARD32)tmp;
       icp->value_length = sizeof(CARD32);
      }
      else if (!strcmp(icp->name, XNFocusWindow)) {
       Window tmp;
       icp->value = new CARD32;
       ic->get_focus_window(tmp);
       *(CARD32*)icp->value = (CARD32)tmp;
       icp->value_length = sizeof(CARD32);
      }
      else if (!strcmp(icp->name, XNFilterEvents)) {
       icp->value = new CARD32;
       ic->get_fwin_select_mask((*(CARD32*)icp->value));

       /* This hack is to let gtk+ based client to filter key release event to
        * the XIM server (gnome bugzilla #81759)
        */
       if (!(*(CARD32*)icp->value & KeyReleaseMask))
         *(CARD32*)icp->value |= KeyReleaseMask;

       icp->value_length = sizeof(CARD32);
      }
      else if (!strcmp(icp->name, XNPreeditState)) {
       icp->value = new CARD32;
       (*(CARD32*)icp->value) = (ic->is_conv_state()) ?
         XIMPreeditEnable : XIMPreeditDisable;
       icp->value_length = sizeof(CARD32);
      }
    }
    // get preedit_attr
    for (icp = preedit_attr; icp < &preedit_attr[preedit_attr_num]; icp++) {
      if (!strcmp(icp->name, XNFontSet)) {
       char *ret = 0;
       ic->get_preedit_fontset(ret);
       icp->value = strdup(ret);
       icp->value_length = strlen(ret);
      }
      else if (!strcmp(icp->name, XNPreeditState)) {
       icp->value = new CARD32;
       (*(CARD32*)icp->value) = (ic->is_conv_state()) ?
         XIMPreeditEnable : XIMPreeditDisable;
       icp->value_length = sizeof(CARD32);
      }
      else if (!strcmp(icp->name, XNArea)) {
       icp->value = new XRectangle;
       long x = 0, y = 0;
       unsigned long width = 0, height = 0;
       ic->get_preedit_area(x, y, width, height);
       XRectangle rect;
       rect.x = x; rect.y = y; rect.width = width;
       rect.height = height;
       (*(XRectangle*)icp->value) = rect;
       icp->value_length = sizeof(XRectangle);
      }
      else if (!strcmp(icp->name, XNAreaNeeded)) {
       icp->value = new XRectangle;
       long x = 0, y = 0;
       unsigned long width = 0, height = 0;
       ic->get_preedit_area_needed(x, y, width, height);
       XRectangle rect;
       rect.x = x; rect.y = y; rect.width = width;
       rect.height = height;
       (*(XRectangle*)icp->value) = rect;
       icp->value_length = sizeof(XRectangle);
      }
      else if (!strcmp(icp->name, XNSpotLocation)) {
       icp->value = new XPoint;
       long x = 0, y = 0;
       ic->get_preedit_spot_location(x, y);
       XPoint point;
       point.x = x; point.y = y;
       (*(XPoint*)icp->value) = point;
       icp->value_length = sizeof(XPoint);
      }
      else if (!strcmp(icp->name, XNForeground)) {
       icp->value = new CARD32;
       ic->get_preedit_fg(*(CARD32*)icp->value);
       icp->value_length = sizeof(CARD32);
      }
      else if (!strcmp(icp->name, XNBackground)) {
       icp->value = new CARD32;
       ic->get_preedit_bg(*(CARD32*)icp->value);
       icp->value_length = sizeof(CARD32);
      }
      else if (!strcmp(icp->name, XNBackgroundPixmap)) {
       icp->value = new Pixmap;
       ic->get_preedit_bg_pixmap(*(Pixmap*)icp->value);
       icp->value_length = sizeof(Pixmap);
      }
      else if (!strcmp(icp->name, XNLineSpace)) {
       icp->value = new CARD32;
       ic->get_preedit_line_spacing(*(CARD32*)icp->value);
       icp->value_length = sizeof(CARD32);
      }
      else if (!strcmp(icp->name, XNCursor)) {
       icp->value = new Cursor;
       ic->get_preedit_cursor(*(Cursor*)icp->value);
       icp->value_length = sizeof(Cursor);
      }
      else if (!strcmp(icp->name, XNColormap)) {
       icp->value = new Colormap;
       ic->get_preedit_colormap(*(Colormap*)icp->value);
       icp->value_length = sizeof(Colormap);
      }
    }
    // get status_attr
    for (icp = status_attr; icp < &status_attr[status_attr_num]; icp++) {
      if (!strcmp(icp->name, XNFontSet)) {
       char *ret = 0;
       ic->get_status_fontset(ret);
       icp->value = strdup(ret);
       icp->value_length = strlen(ret);
      }
      else if (!strcmp(icp->name, XNArea)) {
       icp->value = new XRectangle;
       long x = 0, y = 0;
       unsigned long width = 0, height = 0;
       ic->get_status_area(x, y, width, height);
       XRectangle rect;
       rect.x = x; rect.y = y; rect.width = width;
       rect.height = height;
       (*(XRectangle*)icp->value) = rect;
       icp->value_length = sizeof(XRectangle);
      }
      else if (!strcmp(icp->name, XNAreaNeeded)) {
       icp->value = new XRectangle;
       long x = 0, y = 0;
       unsigned long width = 0, height = 0;
       ic->get_status_area_needed(x, y, width, height);
       XRectangle rect;
       rect.x = x; rect.y = y; rect.width = width;
       rect.height = height;
       (*(XRectangle*)icp->value) = rect;
       icp->value_length = sizeof(XRectangle);
      }
      else if (!strcmp(icp->name, XNForeground)) {
       icp->value = new CARD32;
       ic->get_status_fg(*(CARD32*)icp->value);
       icp->value_length = sizeof(CARD32);
      }
      else if (!strcmp(icp->name, XNBackground)) {
       icp->value = new CARD32;
       ic->get_status_bg(*(CARD32*)icp->value);
       icp->value_length = sizeof(CARD32);
      }
      else if (!strcmp(icp->name, XNBackgroundPixmap)) {
       icp->value = new Pixmap;
       ic->get_status_bg_pixmap(*(Pixmap*)icp->value);
       icp->value_length = sizeof(Pixmap);
      }
      else if (!strcmp(icp->name, XNLineSpace)) {
       icp->value = new CARD32;
       ic->get_status_line_spacing(*(CARD32*)icp->value);
       icp->value_length = sizeof(CARD32);
      }
      else if (!strcmp(icp->name, XNCursor)) {
       icp->value = new Cursor;
       ic->get_status_cursor(*(Cursor*)icp->value);
       icp->value_length = sizeof(Cursor);
      }
      else if (!strcmp(icp->name, XNColormap)) {
       icp->value = new Colormap;
       ic->get_status_colormap(*(Colormap*)icp->value);
       icp->value_length = sizeof(Colormap);
      }
    }
    return (char*)0;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Bool IsFocused ( int  icid)

Definition at line 656 of file R6IMProtocol.cpp.

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

    if (ic) return ic->is_focused();
    return False;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void MoveSpot ( int  icid,
int  x,
int  y 
)

Definition at line 682 of file R6IMProtocol.cpp.

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

    if (ic) ic->set_preedit_spot_location(x, y);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

char* ResetIC ( int  icid)

Definition at line 672 of file R6IMProtocol.cpp.

                          {
    XInputContext *ic =(XInputContext*)&(xic_list.getItem(icid));
    char *mb_data = 0;
    if (ic) {
      mb_data = ic->reset();
    }
    /* should reset to False */
    ic->being_reset = False;
    return mb_data;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void SetICFocus ( int  icid)

Definition at line 646 of file R6IMProtocol.cpp.

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

    if (ic) ic->set_focus();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

char* SetICValues ( int  icid,
CARD16  preedit_attr_num,
CARD16  status_attr_num,
CARD16  ic_attr_num,
XICAttribute preedit_attr,
XICAttribute status_attr,
XICAttribute ic_attr 
)

Definition at line 536 of file R6IMProtocol.cpp.

                                         {
    XInputContext *ic =(XInputContext*)&(xic_list.getItem(icid));
  
    // set ic_attr
    XICAttribute *icp;
    for (icp = ic_attr; icp < &ic_attr[ic_attr_num]; icp++) {
      if (!strcmp(icp->name, XNClientWindow)) {
       ic->set_client_window((*(Window*)icp->value));
      }
      else if (!strcmp(icp->name, XNFocusWindow)) {
       ic->set_focus_window((*(Window*)icp->value));
      }
      else if (!strcmp(icp->name, XNFilterEvents)) {
       ic->set_fwin_select_mask(*(CARD32*)icp->value);
      }
      else if (!strcmp(icp->name, XNPreeditState)) {
        int *state=(int*)icp->value;
       if (*state == XIMPreeditEnable) {
         ic->conversion_start(True);
       }
       if (*state == XIMPreeditDisable) {
         ic->conversion_end(True);
       }
      }
    }
    // set preedit_attr
    for (icp = preedit_attr; icp < &preedit_attr[preedit_attr_num]; icp++) {
      if (!strcmp(icp->name, XNFontSet)) {
       ic->set_preedit_fontset((char*)icp->value);
      }
      else if (!strcmp(icp->name, XNPreeditState)) {
        int *state=(int*)icp->value;
       if (*state == XIMPreeditEnable) {
         ic->conversion_start(True);
       }
       if (*state == XIMPreeditDisable) {
         ic->conversion_end(True);
       }
      }
      else if (!strcmp(icp->name, XNArea)) {
       XRectangle *rect = (XRectangle*)icp->value;
       ic->set_preedit_area(rect->x, rect->y, rect->width, rect->height);
      }
      else if (!strcmp(icp->name, XNAreaNeeded)) {
       XRectangle *rect = (XRectangle*)icp->value;
       ic->set_preedit_area_needed(rect->width, rect->height);
      }
      else if (!strcmp(icp->name, XNSpotLocation)) {
       XPoint *point = (XPoint*)icp->value;
       ic->set_preedit_spot_location(point->x, point->y);
      }
      else if (!strcmp(icp->name, XNForeground)) {
       ic->set_preedit_fg((*(CARD32*)icp->value));
      }
      else if (!strcmp(icp->name, XNBackground)) {
       ic->set_preedit_bg((*(CARD32*)icp->value));
      }
      else if (!strcmp(icp->name, XNBackgroundPixmap)) {
       ic->set_preedit_bg_pixmap((*(Pixmap*)icp->value));
      }
      else if (!strcmp(icp->name, XNLineSpace)) {
       ic->set_preedit_line_spacing((*(CARD32*)icp->value));
      }
      else if (!strcmp(icp->name, XNCursor)) {
       ic->set_preedit_cursor((*(Cursor*)icp->value));
      }
      else if (!strcmp(icp->name, XNColormap)) {
       ic->set_preedit_colormap((*(Colormap*)icp->value));
      }
    }
    // set status_attr
    for (icp = status_attr; icp < &status_attr[status_attr_num]; icp++) {
      if (!strcmp(icp->name, XNFontSet)) {
       ic->set_status_fontset((char*)icp->value);
      }
      else if (!strcmp(icp->name, XNArea)) {
       XRectangle *rect = (XRectangle*)icp->value;
       ic->set_status_area(rect->x, rect->y, rect->width, rect->height);
      }
      else if (!strcmp(icp->name, XNAreaNeeded)) {
       XRectangle *rect = (XRectangle*)icp->value;
       ic->set_status_area_needed(rect->width, rect->height);
      }
      else if (!strcmp(icp->name, XNForeground)) {
       ic->set_status_fg((*(CARD32*)icp->value));
      }
      else if (!strcmp(icp->name, XNBackground)) {
       ic->set_status_bg((*(CARD32*)icp->value));
      }
      else if (!strcmp(icp->name, XNBackgroundPixmap)) {
       ic->set_status_bg_pixmap((*(Pixmap*)icp->value));
      }
      else if (!strcmp(icp->name, XNLineSpace)) {
       ic->set_status_line_spacing((*(CARD32*)icp->value));
      }
      else if (!strcmp(icp->name, XNCursor)) {
       ic->set_status_cursor((*(Cursor*)icp->value));
      }
      else if (!strcmp(icp->name, XNColormap)) {
       ic->set_status_colormap((*(Colormap*)icp->value));
      }
    }
    return (char*)0;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void UnsetICFocus ( int  icid)

Definition at line 651 of file R6IMProtocol.cpp.

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

    if (ic) ic->unset_focus();
  }

Here is the call graph for this function:

Here is the caller graph for this function: