Back to index

im-sdk  12.3.91
Classes | Defines | Typedefs | Enumerations | Functions
iiimpIM.h File Reference
#include <iiimcf.h>
#include "commonIM.h"
#include "xiiimp.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _im_locale_pair
struct  _XIMIIimpIMRec
struct  _XICKeyEventList
struct  _XICIIimpIMRec
struct  XICAttribute
struct  _IIIMObject

Defines

#define IsConversionMode(ic)   (XIM_IS_IIIMP(ic->core.im) && XIC_IIIMP(ic, filtered))
#define IIIMP_CLIENT_TYPE   "XIM IIIMP ADAPTOR"

Typedefs

typedef struct _im_locale_pair im_locale_pair
typedef struct _XIMIIimpIMRec XIMIIimpIMRec
typedef struct _XICKeyEventList XICKeyEventListRec
typedef struct _XICIIimpIMRec XICIIimpIMRec
typedef struct _IIIMObject IIIMObjectRec

Enumerations

enum  XICConversionMode { CONV_OFF = 0, CONV_ON = 1 }
enum  XICSetMode { CREATE_IC = 0, SET_IC = 1 }
enum  ICAttributeID { INPUT_LANGUAGE = 1, CHARACTER_SUBSETS = 2, INPUT_METHOD = 3 }
enum  IMObjectCategory {
  IM_GUI_OBJECT = 0, IM_LWE_OBJECT = 1, IM_SYNTAX_RULE_OBJECT = 2, IM_MANAGER_RULE_OBJECT = 3,
  IM_PRELOADING_LWE_OBJECT = 4, IM_GUI_OBJECT = 0, IM_LWE_OBJECT = 1, IM_SYNTAX_RULE_OBJECT = 2,
  IM_MANAGER_RULE_OBJECT = 3, IM_PRELOADING_LWE_OBJECT = 4, IM_GUI_OBJECT = 0, IM_LWE_OBJECT = 1,
  IM_SYNTAX_RULE_OBJECT = 2, IM_MANAGER_RULE_OBJECT = 3, IM_PRELOADING_LWE_OBJECT = 4, IM_GUI_OBJECT = 0,
  IM_LWE_OBJECT = 1, IM_SYNTAX_RULE_OBJECT = 2, IM_MANAGER_RULE_OBJECT = 3, IM_PRELOADING_LWE_OBJECT = 4,
  IM_GUI_OBJECT = 0, IM_LWE_OBJECT = 1, IM_SYNTAX_RULE_OBJECT = 2, IM_MANAGER_RULE_OBJECT = 3,
  IM_PRELOADING_LWE_OBJECT = 4, IM_GUI_OBJECT = 0, IM_LWE_OBJECT = 1, IM_SYNTAX_RULE_OBJECT = 2,
  IM_MANAGER_RULE_OBJECT = 3, IM_PRELOADING_LWE_OBJECT = 4, IM_GUI_OBJECT = 0, IM_LWE_OBJECT = 1,
  IM_SYNTAX_RULE_OBJECT = 2, IM_MANAGER_RULE_OBJECT = 3, IM_PRELOADING_LWE_OBJECT = 4
}
enum  IMAttributeID {
  INPUTMETHOD_LIST = 0x1001, OBJECT_DESCRIPTER_LIST = 0x1010, CLIENT_DESCRIPTER = 0x1011, CCDEF = 0x1030,
  GUI_OBJECT = 0x1033, LWE_OBJECT = 0x1034, OS_VERSION = 0x2001, OS_NAME = 0x2002,
  OS_ARCH = 0x2003
}

Functions

XIM _IIIMP_OpenIM (XLCd lcd, Display *dpy, XrmDatabase rdb, char *res_name, char *res_class)
void ChangePreeditState (XicCommon)
void SetConversionMode (XicCommon, int)
void PutBackXKeyEvent (XicCommon)
void HoldXKeyEvent (XicCommon, XEvent *)
char * IIIMP_GetIMValues (XIM xim, XIMArg *arg)
char * IIIMP_SetIMValues (XIM xim, XIMArg *arg)
Status IIIMP_OpenIM_SWITCH (XIM xim, XLCd lcd, Display *dpy)
Status IIIMP_CreateIC_SWITCH (XIC xic, XIMArg *arg)
IIIMCF_language get_IM_language (XimCommon im)
Bool IMGetICValues (XicCommon ic, XICAttribute *ic_attr, int attr_count)
Bool IMSetICValues (XicCommon ic, XICAttribute *ic_attr, int attr_count)
Bool IMCheckIMWindow (XicCommon ic, Window window)
Bool IMForwardEvent (XicCommon xic, XEvent *ev)
Bool IMTriggerNotify (XicCommon ic, XICConversionMode conv_mode)
Bool IMSetIMValues (XimCommon im)
Bool IMGetIMValue (XimCommon im, int attr_id)
Bool IMAuxSetValues (XicCommon ic, IIIMCF_event ev)
Bool IMAuxGetValues (XicCommon ic, IIIMCF_event ev)
IIIMF_status IMCreateIC (XimCommon im, IIIMCF_context *pc)
Bool IMSetPrimaryLocale (XicCommon ic, char *input_locale)
IIIMF_status IMChangeFocus (XicCommon ic, int flag)
Bool IMChangeClientType (XimCommon im, char *client_type)
void IM_free_langlist (XimCommon im)
int IMConvertFromUTF8ToUTF16 (char *from_buf, size_t from_left, char **to_buf, size_t *to_left)
int IMConvertFromUTF8 (char *from_buf, size_t from_left, char **to_buf, size_t *to_left)
int IIimpConvertToUTF16 (char *from_buf, size_t from_left, char **to_buf, size_t *to_left)
int IIimpConvertFromUTF16 (const char *from_buf, size_t from_left, char **to_buf, size_t *to_left)
int IMConvertToUTF8 (char *from_buf, size_t from_left, char **to_buf, size_t *to_left)
int IIimpWcstoMbs (XimCommon im, wchar_t *from, int from_len, char *to, int to_len, Status *state)
int IIimpMbstoWcs (XimCommon im, char *from, int from_len, wchar_t *to, int to_len, Status *state)
void SwitchKeyEventFilter (XicCommon ic, Window old_focus)
void IIIMPKeyEventFilter (XicCommon ic, Window old_focus)
void makeClientDescripter (Display *dpy, char *client_name, XICAttribute *ic_attr, int icid)
void ic_change_conversion_mode (XicCommon ic, char *conv_mode)
void ic_initialize_with_input_language (XicCommon ic, char *new_lang)

Class Documentation

struct _im_locale_pair

Definition at line 53 of file iiimpIM.h.

Class Members
char * alias
char * canonical
struct _XIMIIimpIMRec

Definition at line 58 of file iiimpIM.h.

Collaboration diagram for _XIMIIimpIMRec:
Class Members
Window cb_window
char * client_type
int count_languages
int counter
XIC current_ic
char * default_font_name
char * engine_name
IIIMCF_handle handle
Bool inited
im_locale_pair * lang_alias
int off_keys_num
int on_keys_num
IIIMCF_keyevent * pkev_off
IIIMCF_keyevent * pkev_on
char * primary_locale
XIMText * supported_languages
XIMMethods switch_methods
struct _XICKeyEventList

Definition at line 93 of file iiimpIM.h.

Collaboration diagram for _XICKeyEventList:
Class Members
XKeyEvent key_event
struct _XICKeyEventList * next
struct _XICIIimpIMRec

Definition at line 98 of file iiimpIM.h.

Collaboration diagram for _XICIIimpIMRec:
Class Members
struct _aux * aux
Bool committed_text_consumed
IIIMCF_context context
Bool filtered
Bool has_keyevent_return
int id
int key_event_forwarded
XICKeyEventListRec * key_event_list
int key_event_num
XKeyEvent keyevent_return
KeySym keysym_return
int preedit_prev_len
XICMethods switch_methods
struct XICAttribute

Definition at line 141 of file X11R6IMProtoData.h.

Class Members
int attribute_id
ICAttributeID attribute_id
char * name
CARD16 name_length
int type
void * value
XPointer value
int value_length
struct _IIIMObject

Definition at line 172 of file iiimpIM.h.

Collaboration diagram for _IIIMObject:
Class Members
char * basepath
char * domain
char * encoding
IMAttributeID id
unsigned int id_dyn
CARD16 * name
int name_length
struct _IIIMObject * next
IMObjectCategory obj_cat
unsigned int obj_size
char * path
char * scope
char * signature

Define Documentation

#define IIIMP_CLIENT_TYPE   "XIM IIIMP ADAPTOR"

Definition at line 144 of file iiimpIM.h.

#define IsConversionMode (   ic)    (XIM_IS_IIIMP(ic->core.im) && XIC_IIIMP(ic, filtered))

Definition at line 90 of file iiimpIM.h.


Typedef Documentation

typedef struct _IIIMObject IIIMObjectRec
typedef struct _XICIIimpIMRec XICIIimpIMRec
typedef struct _XIMIIimpIMRec XIMIIimpIMRec

Enumeration Type Documentation

Enumerator:
INPUT_LANGUAGE 
CHARACTER_SUBSETS 
INPUT_METHOD 

Definition at line 138 of file iiimpIM.h.

Enumerator:
INPUTMETHOD_LIST 
OBJECT_DESCRIPTER_LIST 
CLIENT_DESCRIPTER 
CCDEF 
GUI_OBJECT 
LWE_OBJECT 
OS_VERSION 
OS_NAME 
OS_ARCH 

Definition at line 154 of file iiimpIM.h.

             {
  INPUTMETHOD_LIST = 0x1001,
  OBJECT_DESCRIPTER_LIST = 0x1010,
  CLIENT_DESCRIPTER = 0x1011,
  CCDEF = 0x1030,
  GUI_OBJECT = 0x1033,
  LWE_OBJECT = 0x1034,
  OS_VERSION  = 0x2001,
  OS_NAME     = 0x2002,
  OS_ARCH     = 0x2003
} IMAttributeID;
Enumerator:
IM_GUI_OBJECT 
IM_LWE_OBJECT 
IM_SYNTAX_RULE_OBJECT 
IM_MANAGER_RULE_OBJECT 
IM_PRELOADING_LWE_OBJECT 
IM_GUI_OBJECT 
IM_LWE_OBJECT 
IM_SYNTAX_RULE_OBJECT 
IM_MANAGER_RULE_OBJECT 
IM_PRELOADING_LWE_OBJECT 
IM_GUI_OBJECT 
IM_LWE_OBJECT 
IM_SYNTAX_RULE_OBJECT 
IM_MANAGER_RULE_OBJECT 
IM_PRELOADING_LWE_OBJECT 
IM_GUI_OBJECT 
IM_LWE_OBJECT 
IM_SYNTAX_RULE_OBJECT 
IM_MANAGER_RULE_OBJECT 
IM_PRELOADING_LWE_OBJECT 
IM_GUI_OBJECT 
IM_LWE_OBJECT 
IM_SYNTAX_RULE_OBJECT 
IM_MANAGER_RULE_OBJECT 
IM_PRELOADING_LWE_OBJECT 
IM_GUI_OBJECT 
IM_LWE_OBJECT 
IM_SYNTAX_RULE_OBJECT 
IM_MANAGER_RULE_OBJECT 
IM_PRELOADING_LWE_OBJECT 
IM_GUI_OBJECT 
IM_LWE_OBJECT 
IM_SYNTAX_RULE_OBJECT 
IM_MANAGER_RULE_OBJECT 
IM_PRELOADING_LWE_OBJECT 

Definition at line 146 of file iiimpIM.h.

Enumerator:
CONV_OFF 
CONV_ON 

Definition at line 128 of file iiimpIM.h.

enum XICSetMode
Enumerator:
CREATE_IC 
SET_IC 

Definition at line 133 of file iiimpIM.h.

             {
  CREATE_IC = 0,
  SET_IC = 1
} XICSetMode;

Function Documentation

XIM _IIIMP_OpenIM ( XLCd  lcd,
Display *  dpy,
XrmDatabase  rdb,
char *  res_name,
char *  res_class 
)

Definition at line 593 of file iiimpIM.c.

{
    XimCommon im = 0;

    im = Xmalloc(sizeof(XimCommonRec));
    if (!im) goto Set_Error;
    memset(im, 0, sizeof(XimCommonRec));

    if (!CommonOpenIM((XIM)im, lcd, dpy, rdb, res_name, res_class))
       goto Set_Error;

    im->methods = get_iiimp_im_methods();

    if (!IIIMP_OpenIM_SWITCH((XIM)im, lcd, dpy)) goto Set_Error;
    return (XIM)im;

Set_Error:
    if (im) Xfree(im);
    return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 156 of file iiimpIC.c.

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

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 354 of file iiimpIM.c.

{
    int i, n;
    const char *ll;
    char *lang;
    char *p;
    IIIMCF_language *plangs;
    IIIMF_status st;

    if (XIM_IIIMP(im, primary_locale)) {
       lang = strdup(XIM_IIIMP(im, primary_locale));
    } else {
       lang = im_canonicalize_langname(im);
    }

    if (!lang) return NULL;

    if (iiimcf_get_supported_languages(XIM_IIIMP(im, handle), &n, &plangs)
       != IIIMF_STATUS_SUCCESS)
       return NULL;
    for (i = 0; i < n; i++) {
       st = iiimcf_get_language_id(plangs[i], &ll);
       if (st != IIIMF_STATUS_SUCCESS)
           continue;
       if (strcmp(lang, ll) == 0) {
           free(lang);
           return plangs[i];
       }
    }
    /* try to find the supported language again with no charset locale. */
    p = strchr (lang, '@');
    if (p)
       *p = 0;
    p = strchr (lang, '.');
    if (p)
       *p = 0;

    for (i = 0; i < n; i++) {
       st = iiimcf_get_language_id(plangs[i], &ll);
       if (st != IIIMF_STATUS_SUCCESS)
           continue;
       if (strcmp(lang, ll) == 0) {
           free(lang);
           return plangs[i];
       }
    }
    /* finally try to take care of the locale, such as en */
    p = strchr (lang, '_');
    if (p)
       *p = 0;

    for (i = 0; i < n; i++) {
       st = iiimcf_get_language_id(plangs[i], &ll);
       if (st != IIIMF_STATUS_SUCCESS)
           continue;
       if (strcmp(lang, ll) == 0) {
           free(lang);
           return plangs[i];
       }
    }
    free(lang);

      /*
       still cannot find a match. Just take one for "en" as
       a default.
      */
    for (i = 0; i < n; i++) {
       st = iiimcf_get_language_id (plangs[i], &ll);
       if (st != IIIMF_STATUS_SUCCESS)
           continue;
       if (strncmp (ll, "en", 2) == 0)
           return plangs[i];
    }

    return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void HoldXKeyEvent ( XicCommon  ,
XEvent *   
)

Definition at line 748 of file iiimpIC.c.

{
    XICKeyEventListRec *    kel;

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

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

    return;
}

Here is the caller graph for this function:

void ic_change_conversion_mode ( XicCommon  ic,
char *  conv_mode 
)

Definition at line 946 of file iiimcfFun.c.

{
  IIIMCF_event ev;
  if (conv_mode && !strcmp ((char*)conv_mode, "on"))
    {
      IIIMF_status st;
      st = iiimcf_create_trigger_notify_event (CONV_ON, &ev);
      if (st != IIIMF_STATUS_SUCCESS)
       return;
    }
  else if (conv_mode && !strcmp ((char*)conv_mode, "off"))
    {
      IIIMF_status st;
      st = iiimcf_create_trigger_notify_event (CONV_OFF, &ev);
      if (st != IIIMF_STATUS_SUCCESS)
       return;
    }
  if (iiimcf_forward_event(XIC_IIIMP(ic, context), ev) != IIIMF_STATUS_SUCCESS)
    return;
  IMProcessIncomingEvent(ic);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void ic_initialize_with_input_language ( XicCommon  ic,
char *  new_lang 
)

Definition at line 1041 of file iiimcfFun.c.

{
  IIIMCF_language iiim_lang = NULL;
  IIIMF_status st;
  IIIMCF_attr attr;
  IIIMCF_event ev;
  int conversion_mode = CONV_OFF;
  char *le_name = NULL;
  int i = 0, n;
  const IIIMP_card16 *u16idname, *u16hrn, *u16domain;
  Bool found_le = False;
  IIIMCF_input_method *pims;
  XimCommon im = (XimCommon)ic->core.im;

  if (XIC_IIIMP(ic, context) == NULL)
    return;

  if (new_lang)
    {
      /* FIXME just a workaround, to be modified later */
      char *p = strchr(new_lang, ':');
      if (p) 
       {
         *p = '\0';
         le_name = ++p;
       }

      iiim_lang = get_input_language (ic, new_lang, True);
      if (iiim_lang != NULL)
       {
         Xfree (ic->current_language);
         ic->current_language = strdup (new_lang);
       }
      else
       /* invalid new lang */
       return;
    }
  else
    iiim_lang = get_input_language (ic, ic->current_language, False);

  if (le_name != NULL)
    {
      char *idname = NULL;
      /* probably le_name consists of 'lename' and 'imename' which are 
       * separated by '-'.
       */
      const char *ime_delimiter = "-";
      char **le_ime = my_strsplit (le_name, ime_delimiter);
      char *lename = le_ime[0], *imename = le_ime[1];

      st = iiimcf_get_supported_input_methods (XIM_IIIMP (im, handle), &n, &pims);
      if (st != IIIMF_STATUS_SUCCESS)
       return;

      for (i = 0; i < n; i++)
       {
         st = iiimcf_get_input_method_desc (pims[i], &u16idname, &u16hrn,
                                        &u16domain);
         if (st != IIIMF_STATUS_SUCCESS)
           return;

         idname = format_iiimcf_string (u16hrn);
         if (idname != NULL && strcmp (lename, idname) == 0)
           {
             /* update the pims[i]->imname with the new imname that
              * consists imename.
              */
             if (imename)
              {
                IIIMP_card16 *imname = format_utf8_string (le_name);
                iiimcf_set_input_method_name (pims[i], imname);
              }

             free (idname);
             found_le = True;
             break;
           }
         if (idname != NULL)
           {
             free (idname);
             idname = NULL;
           }
       }
      if (lename) free (lename);
      if (le_ime) free (le_ime);
    }

  /* save conversion mode to restore this after switching */
  st = iiimcf_get_current_conversion_mode (XIC_IIIMP(ic, context),
                                      &conversion_mode);

  st = iiimcf_create_attr (&attr);
  if (st != IIIMF_STATUS_SUCCESS) 
    return;
  if (found_le)
      iiimcf_attr_put_ptr_value (attr, IIIMCF_ATTR_INPUT_METHOD,
                             pims[i]);
  if (iiim_lang)
      iiimcf_attr_put_ptr_value (attr, IIIMCF_ATTR_INPUT_LANGUAGE,
                             iiim_lang);
  st = iiimcf_context_set_attr(XIC_IIIMP(ic, context), attr);
  iiimcf_destroy_attr (attr);
  if (st != IIIMF_STATUS_SUCCESS)
    return; 

  /* NOTE: need to support the change of input language here.
   * and don't call ic_switcher_set_input_language here too.
   * it causes the infinite loop of PropertyNotify event
   * between xiiimp.so and gimlet.
   */
  /* ic_switcher_set_input_language(ic, NULL); */
  st = iiimcf_create_seticfocus_event (&ev);

  if (st != IIIMF_STATUS_SUCCESS)
    return;

  iiimcf_forward_event(XIC_IIIMP(ic, context), ev);
  if (conversion_mode)
    {
      st = iiimcf_create_trigger_notify_event (CONV_ON, &ev);
      if (st != IIIMF_STATUS_SUCCESS)
       return;
      iiimcf_forward_event(XIC_IIIMP(ic, context), ev);
    }
  IMProcessIncomingEvent(ic);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Status IIIMP_CreateIC_SWITCH ( XIC  xic,
XIMArg arg 
)

Definition at line 304 of file iiimpIC.c.

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

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

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

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

    return True;
Error:
    if (ic->iiimp_icpart)
       Xfree(ic->iiimp_icpart);
    return False;
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* IIIMP_GetIMValues ( XIM  xim,
XIMArg arg 
)

Definition at line 514 of file iiimpIM.c.

{
    XIMArg *p;
    int i;
    XimCommon im = (XimCommon)xim;

    if (!xim) return arg->name;    /* nothing to do */

    for (p = arg; p->name != NULL; p++) {
       TRACE_MESSAGE('v', ("  %s\n", p->name));
       if (!strcmp(p->name, XNQueryInputStyle)) {
           XIMStyles **value;
           XIMStyles *styles;
           size_t count = sizeof(im_styles)/sizeof(im_styles[0]);
           if ((styles = (XIMStyles*)
               Xmalloc(sizeof(XIMStyles) +
                      sizeof(XIMStyle) * count)) == NULL) {
              break;
           }
           styles->count_styles = count;
           styles->supported_styles = (XIMStyle *)(&styles[1]);

           for (i = 0; i < (int)(styles->count_styles); i++) {
              styles->supported_styles[i] = im_styles[i];
           }
           value = (XIMStyles **)p->value;
           *value = styles;
       } else if (!strcmp(p->name, XNMultiLingualInput)) {
           *((Bool*)(p->value)) = ((XimCommon)xim)->isUnicode;
       } else if (!strcmp(p->name, XNQueryExtensionVersion)) {
           *((int*)(p->value)) = XIIIMP_MULTILINGUAL_EXTENSION_VERSION;
       } else if (!strcmp(p->name, XNQueryUnicodeCharacterSubset)) {
           XIMUnicodeCharacterSubsets **value;
           XIMUnicodeCharacterSubsets *sub_sets;
           XIMUnicodeCharacterSubsets *im_subset;
           size_t count = 0;

           /* 
              when GIMLET is present, we don't let applications
              have their own choice windows, based on XLC_LOCALE
           */
           if (im_switcher_active(im))
             return p->name;

           /* RECONSIDER!!! */
           UpdateIMCharacterSubset(im);

           if (!im->unicode_char_subsets) break;

           im_subset = im->unicode_char_subsets;

           count = im_subset->count_subsets;

           if ((sub_sets = (XIMUnicodeCharacterSubsets*)
               Xmalloc(sizeof(XIMUnicodeCharacterSubsets) +
                      sizeof(XIMUnicodeCharacterSubset) * count)) == NULL) {
              break;
           }
           sub_sets->count_subsets = count;
           sub_sets->supported_subsets =
              (XIMUnicodeCharacterSubset*)(&sub_sets[1]);

           for (i = 0; i < (int)(sub_sets->count_subsets); i++) {
              sub_sets->supported_subsets[i] = im_subset->supported_subsets[i];
           }
           value = (XIMUnicodeCharacterSubsets **)p->value;
           *value = sub_sets;
      
       } else {
           break;
       }
    }
    return p->name;
}
Status IIIMP_OpenIM_SWITCH ( XIM  xim,
XLCd  lcd,
Display *  dpy 
)

Definition at line 621 of file iiimpIM.c.

{
    XimCommon im = (XimCommon)xim;
    XIMIIimpIM im_private = 0;
    char *mod, buf[BUFSIZE];
    int mod_len;

    initialize();

    im_private = Xmalloc(sizeof(XIMIIimpIMRec));
    if (!im_private) goto Set_Error;
    memset(im_private, 0, sizeof (XIMIIimpIMRec));
    im->iiimp_impart = im_private;

    XIM_IIIMP(im, cb_window) = None;
    XIM_IIIMP(im, switch_methods) = get_switch_im_methods();

    buf[0] = '\0';
    mod_len = 0;

    im->core.im_name = 0;
    if ((lcd->core->modifiers) && (*lcd->core->modifiers)) {
#define       MODIFIER "@im="
       mod = strstr(lcd->core->modifiers, MODIFIER);
       if (mod) {
           mod += strlen(MODIFIER);

           if (!strncmp(mod, "iiimp/", 6) || !strncmp(mod, "IIIMP/", 6)) {
              mod += 6;

              if (index(mod, ':')) {
                  while (*mod && *mod != '@' && mod_len < BUFSIZE - 1) {
                     buf[mod_len++] = *mod++;
                  }
                  buf[mod_len] = '\0';
                  im->core.im_name = Xmalloc(mod_len+1);
                  if (!im->core.im_name) goto Set_Error;

                  strcpy(im->core.im_name, buf);
              }
           }
       }
#undef MODIFIER
    }

    if (IMCreateHandle(im) != IIIMF_STATUS_SUCCESS)
       goto Set_Error;


#if 0 /* The following is required for asych. message handling.  */
    XIM_IIIMP(im, cb_window) =
       XCreateSimpleWindow(im->core.display,
                         DefaultRootWindow(im->core.display),
                         0, 0, 1, 1, 0, 0, 0);
    if (None != XIM_IIIMP(im, cb_window)) {
       _XRegisterFilterByType(im->core.display, XIM_IIIMP(im, cb_window),
                            ClientMessage, ClientMessage,
                            IMCBFilter, (XPointer)im);
    }
#endif

    return True;

Set_Error:
    if (im_private) {
       Xfree(im_private);
       im->iiimp_impart = NULL;
    }
    IIIMP_CloseIM((XIM)im);
    return False;
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* IIIMP_SetIMValues ( XIM  xim,
XIMArg arg 
)

Definition at line 477 of file iiimpIM.c.

{
    XIMArg *p;
    char *return_name = NULL;
    XimCommon im = (XimCommon)xim;

    if (!xim) return arg->name;    /* nothing to do */

    for (p = arg; p->name != NULL; p++) {
       if (!strcmp(p->name, "engineInterfaceName")) {
           XIM_IIIMP(im, engine_name) = (char*)p->value;
       } else if (!strcmp(p->name, "applicationType")) {
           IMChangeClientType(im, (char*) p->value);
       } else if (!strcmp(p->name, "defaultFontName")) {
           XIM_IIIMP(im, default_font_name) = (char*)p->value;
       } else if (!strcmp(p->name, "primaryLocale")) {
           XIM_IIIMP(im, primary_locale) = (char*)p->value;
       } else if (!strcmp(p->name, XNDestroyCallback)) {
           im->core.destroy_callback.client_data = 
              ((XIMCallback *)p->value)->client_data;
           im->core.destroy_callback.callback = 
              ((XIMCallback *)p->value)->callback;
       } else {
           return_name = arg->name;
           break;
       }
    }

    return return_name;
}
int IIimpConvertFromUTF16 ( const char *  from_buf,
size_t  from_left,
char **  to_buf,
size_t *  to_left 
)

Definition at line 418 of file iiimpConv.c.

{
    size_t src_len, dst_len;
    char *src, *dst;
#ifndef USE_CSCONV
    const char *ip;
    size_t ileft;
    char *op;
    size_t oleft;
    char buffer[UTF16_STRLEN];     /* Fix me! */
#endif /* !USE_CSCONV */
    const size_t buf_len = UTF16_STRLEN;
    size_t ret = 0;

#ifdef USE_CSCONV
    static csconv_t csconv_cd = NULL;
#endif

#ifdef USE_CSCONV
    if (current_locale == NULL){
       current_locale = (char*)strdup(setlocale(LC_CTYPE, NULL));
    }
    do {
       if (((void *)(-1) == csc_handle) ||
           ((csconv_t)(-1) == csconv_cd)) {
           continue;
       }
       if (NULL == csc_handle) {
           dlopen_csconv();
           if ((void *)(-1) == csc_handle) {
              continue;
           }
       }
       if (NULL == csconv_cd) {

           csconv_cd = (csc_open_locale)(current_locale, "MultiByte", "UTF-16");
      
           if ((csconv_t)(-1) == csconv_cd) {
              continue;
           }
       }

       dst = *((char **)to_buf);

       ret = csc_conv(csconv_cd,
                     &from_buf, &from_left, &dst, to_left);
       return ret;
    } while (0);
#endif

#ifdef USE_ICONV
    if (i_conv1_FromUTF16 == (iconv_t)-1 ||
       i_conv2_FromUTF16 == (iconv_t)-1) {
       goto done;
    }

    if (i_conv2_FromUTF16 == NULL && !skip_native_to_utf8_conv) {
       char *encoding = nl_langinfo(CODESET);
       if (!strcmp(encoding, "UTF-8")) {
           skip_native_to_utf8_conv = True;
       } else {
           if ((i_conv2_FromUTF16 = iconv_open(encoding, "UTF-8"))
              == (iconv_t) - 1) {
              /* fallback */
              encoding = "646";
              if ((i_conv2_FromUTF16 = iconv_open(encoding, "UTF-8"))
                  == (iconv_t) - 1)
                  goto done;
           }
       }
    }
    if (i_conv1_FromUTF16 == NULL) {
       if ((i_conv1_FromUTF16 = iconv_open("UTF-8", "UTF-16"))
           == (iconv_t) - 1) {
           goto done;
       }
    }

    if (skip_native_to_utf8_conv) {
       src = from_buf;
       src_len = from_left; /* don't stop at '\0' in case of ascii */
       dst = *((char **) to_buf);

       ret = iconv(i_conv1_FromUTF16, (const char**)&src, &src_len,
                  (char**)&dst, to_left);
    } else {
       ip = (const char *)from_buf;
       ileft = from_left;

       op = *((char **)to_buf);
       oleft = *to_left;

       while ((0 < ileft) && (0 < oleft)) {
           dst = buffer;
           dst_len = buf_len;
           ret = iconv(i_conv1_FromUTF16, &ip, &ileft, (char**)&dst, &dst_len);
           if ((ret != 0) && (E2BIG != errno)) {
              goto done;
           }

           src = buffer;
           src_len = buf_len - dst_len;

           ret = iconv(i_conv2_FromUTF16, (const char**)&src, &src_len,
                     &op, &oleft);
           if (ret != 0) goto done;
       }

       *to_left = oleft;
    }
done:
#endif /* USE_ICONV */
    return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int IIimpConvertToUTF16 ( char *  from_buf,
size_t  from_left,
char **  to_buf,
size_t *  to_left 
)

Definition at line 393 of file iiimpConv.c.

{
#ifdef USE_CSCONV
    if (current_locale == NULL){
       current_locale = (char*)strdup(setlocale(LC_CTYPE, NULL));
    }
    return ConvertToUTF16(current_locale,
                       from_buf, from_left,
                       to_buf, to_left);
#else
    char *encoding = nl_langinfo(CODESET);
    return ConvertToUTF16(encoding,
                       from_buf, from_left,
                       to_buf, to_left);
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

void IIIMPKeyEventFilter ( XicCommon  ic,
Window  old_focus 
)

Definition at line 804 of file iiimpIC.c.

{
    _XUnregisterFilter(ic->core.im->core.display, old_focus,
                     IIIMP_Local_KeyFilter, (XPointer)ic);
    _XRegisterFilterByType(ic->core.im->core.display, ic->core.focus_window,
                        KeyPress, KeyRelease,
                        IIIMP_Local_KeyFilter, (XPointer)ic);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int IIimpMbstoWcs ( XimCommon  im,
char *  from,
int  from_len,
wchar_t *  to,
int  to_len,
Status *  state 
)

Definition at line 806 of file iiimpConv.c.

                                                     {
  XlcConv conv = im->mtow_conv;
  int from_left;
  int to_left;
  int from_savelen;
  int to_savelen;
  int from_cnvlen;
  int to_cnvlen;
  char *from_buf;
  wchar_t *to_buf, *tmp_buf;
  Status tmp_state;

  if (!state)
    state = &tmp_state;

  /* Change to_len as to_len * sizeof(wchar_t)  - byte length */
  to_len = to_len * sizeof(wchar_t); 
  if (!conv || !from || !from_len) {
    *state = XLookupNone;
    return 0;
  }

  if (to && to_len) {
    from_left = from_len;
    to_left = to_len;
    from_cnvlen = 0;
    to_cnvlen = 0;
    for (;;) {
      from_savelen = from_left;
      to_savelen = to_left;
      from_buf = &from[from_cnvlen];
      to_buf = &to[to_cnvlen];
      if (_XlcConvert(conv, (XPointer *)&from_buf, &from_left,
                    (XPointer *)&to_buf, &to_left, NULL, 0) < 0) {
       *state = XLookupNone;
       return 0;
      }
      from_cnvlen += (from_savelen - from_left);
      to_cnvlen += (to_savelen - to_left);
      if (from_left == 0) {
       if (to_cnvlen > 0) {
         *state = XLookupChars;
       } else {
         *state = XLookupNone;
       }
       return to_cnvlen;
      }
      if (to_left == 0)
       break;
      /* Overflow : the to_left length is so small that it cannot
         accomodate the first mb character in the next conversion block */
      if (to_left < sizeof(wchar_t)) {
         break;
      }
    }
  }
  from_left = from_len;
  from_cnvlen = 0;
  to_cnvlen = 0;
  /* BugId : 4253988. In case the from_buf is bigger than the to_buffer,
       we need to return the required buffer size and status as XBufferOverflow.
       We create a tmp buffer equals 8 times the from_len and do conversion.
  */
  to_left = from_len ;
  tmp_buf = (wchar_t *)malloc(to_left * sizeof(wchar_t));
  for (;;) {
    from_savelen = from_left;
    from_buf = &from[from_cnvlen];
    to_savelen = to_left;
    to_buf = &tmp_buf[to_cnvlen];
    from_buf = &from[from_cnvlen];
    if (_XlcConvert(conv, (XPointer *)&from_buf, &from_left,
                  (XPointer *)&to_buf, &to_left, NULL, 0) < 0) {
      *state = XLookupNone;
      return 0;
    }
    from_cnvlen += (from_savelen - from_left);
    to_cnvlen += (to_savelen - to_left);
    if (from_left == 0) {
      if (to_cnvlen > 0)
       *state = XBufferOverflow;
      else
       *state = XLookupNone;
      break;
    }
  }
  free(tmp_buf);
  return to_cnvlen;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int IIimpWcstoMbs ( XimCommon  im,
wchar_t *  from,
int  from_len,
char *  to,
int  to_len,
Status *  state 
)

Definition at line 713 of file iiimpConv.c.

                                                  {
  XlcConv conv = im->wtom_conv;
  int from_left;
  int to_left;
  int from_savelen;
  int to_savelen;
  int from_cnvlen;
  int to_cnvlen;
  wchar_t *from_buf;
  char *to_buf, *tmp_buf;
  Status tmp_state;

  if (!state)
    state = &tmp_state;

  if (!conv || !from || !from_len) {
    *state = XLookupNone;
    return 0;
  }

  if (*from == (wchar_t)0) {
    to[0] = (char)0;
    return 0;
  }
  if (to && to_len) {
    from_left = from_len;
    to_left = to_len;
    from_cnvlen = 0;
    to_cnvlen = 0;
    for (;;) {
      from_savelen = from_left;
      to_savelen = to_left;
      from_buf = &from[from_cnvlen];
      to_buf = &to[to_cnvlen];
      if (_XlcConvert(conv, (XPointer *)&from_buf, &from_left,
                    (XPointer *)&to_buf, &to_left, NULL, 0) < 0) {
       *state = XLookupNone;
       return 0;
      }
      from_cnvlen += (from_savelen - from_left);
      to_cnvlen += (to_savelen - to_left);
      if (from_left == 0) {
       if (to_cnvlen > 0) {
         *state = XLookupChars;
       } else {
         *state = XLookupNone;
       }
       return to_cnvlen;
      }
      if (to_left == 0)
       break;
      /* Overflow : the to_left length is so small that it cannot
         accomodate the first mb character in the next conversion block */
      if (to_left < MB_CUR_MAX)
         break;
    }
  }

  from_left = from_len;
  from_cnvlen = 0;
  to_cnvlen = 0;
  /* BugId : 4253988. In case the from_buf is bigger than the to_buffer,
       we need to return the required buffer size and status as XBufferOverflow.
       We create a tmp buffer equals 8 times the from_len and do conversion.
  */
  to_left = (sizeof(wchar_t) * from_len) ;
  tmp_buf = (char *)malloc(to_left);
  for (;;) {
    from_savelen = from_left;
    from_buf = &from[from_cnvlen];
    to_savelen = to_left;
    to_buf = &tmp_buf[to_cnvlen];
    if (_XlcConvert(conv, (XPointer *)&from_buf, &from_left,
                  (XPointer *)&to_buf, &to_left, NULL, 0) < 0) {
      *state = XLookupNone;
      return 0;
    }
    from_cnvlen += (from_savelen - from_left);
    to_cnvlen += (to_savelen - to_left);
    if (from_left == 0) {
      if (to_cnvlen > 0)
       *state = XBufferOverflow;
      else
       *state = XLookupNone;
      break;
    }
  }
  free(tmp_buf);
  return to_cnvlen;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 626 of file iiimcfFun.c.

{
    int i;
    int n = XIM_IIIMP(im, count_languages);
    XIMText *language_list = XIM_IIIMP(im, supported_languages);
    char *str;

    if (language_list) {
       for (i = 0; i < n; i++) {
           str = language_list[i].string.multi_byte;
           if (str) free(str);
       }
       free(language_list);
    }
    XIM_IIIMP(im, count_languages) = 0;
    XIM_IIIMP(im, supported_languages) = NULL;
}

Here is the caller graph for this function:

Definition at line 931 of file iiimcfFun.c.

{
    if (!ic) return False;

    if (iiimcf_forward_event(XIC_IIIMP(ic, context), ev)
       != IIIMF_STATUS_SUCCESS) return False;
    IMProcessIncomingEvent(ic);

    return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 916 of file iiimcfFun.c.

{
    if (!ic) return False;

    if (iiimcf_forward_event(XIC_IIIMP(ic, context), ev)
       != IIIMF_STATUS_SUCCESS) return False;
    IMProcessIncomingEvent(ic);

    return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool IMChangeClientType ( XimCommon  im,
char *  client_type 
)

Definition at line 845 of file iiimcfFun.c.

{
    IIIMCF_handle h;

    XIM_IIIMP(im, client_type) = client_type;
    if (XIM_IIIMP(im, inited)) {
       /* im has already had context,
          so we cannot reset handle. */
       return False;
    }
    h = XIM_IIIMP(im, handle);
    if (IMCreateHandle(im) != IIIMF_STATUS_SUCCESS)
       return False;
    iiimcf_destroy_handle(h);

    return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

IIIMF_status IMChangeFocus ( XicCommon  ic,
int  flag 
)

Definition at line 602 of file iiimcfFun.c.

{
    IIIMF_status st;
    IIIMCF_event event;

    if (flag) {
       st = iiimcf_create_seticfocus_event(&event);
       IIimpAuxSetICFocus(ic);
    } else {
       st = iiimcf_create_unseticfocus_event(&event);
       IIimpAuxUnsetICFocus(ic);
    }
    if (st != IIIMF_STATUS_SUCCESS) return st;

    st = iiimcf_forward_event(XIC_IIIMP(ic, context), event);
    IMProcessIncomingEvent(ic);

    return st;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool IMCheckIMWindow ( XicCommon  ic,
Window  window 
)

Definition at line 871 of file iiimpIC.c.

{
    return (XIM_IS_IIIMP(ic->core.im)
           && XIM_IIIMP(ic->core.im, handle)
           && XFactoryCheckIMWindow(ic->core.im->core.display, window));
}

Here is the call graph for this function:

Here is the caller graph for this function:

int IMConvertFromUTF8 ( char *  from_buf,
size_t  from_left,
char **  to_buf,
size_t *  to_left 
)

Definition at line 290 of file iiimpConv.c.

{
    size_t ret = 0;
#ifdef USE_CSCONV
    static csconv_t csconv_cd = NULL;
#endif

#ifdef USE_ICONV
    if (skip_native_to_utf8_conv)
       return -1;

    if (i_conv2_FromUTF16 == (iconv_t)-1)
       /* already failed */
       return -1;

    if (i_conv2_FromUTF16 == NULL) {
       char *encoding = nl_langinfo(CODESET);

       if (!strcmp(encoding, "UTF-8")) {
           skip_native_to_utf8_conv = True;
           return -1;
       } else {
           if ((i_conv2_FromUTF16 = iconv_open(encoding, "UTF-8"))
              == (iconv_t) - 1) {
              /* fallback */
              encoding = "646";
              if ((i_conv2_FromUTF16 = iconv_open(encoding, "UTF-8"))
                  == (iconv_t) - 1)
                  goto done;
           }
       }
    }

    ret = iconv(i_conv2_FromUTF16, (const char**)&from_buf, &from_left,
              to_buf, to_left);
done:
#endif /* USE_ICONV */

    return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int IMConvertFromUTF8ToUTF16 ( char *  from_buf,
size_t  from_left,
char **  to_buf,
size_t *  to_left 
)

Definition at line 255 of file iiimpConv.c.

{
    char *encoding;
    int ret;
#ifdef USE_CSCONV
    encoding = "en_US.UTF-8";
#else
    int restore = False;
    encoding = "UTF-8";
    if (!skip_native_to_utf8_conv) {
       restore = True;
       skip_native_to_utf8_conv = True;
    }
#endif
    ret = ConvertToUTF16(encoding,
                      from_buf, from_left,
                      to_buf, to_left);
#ifndef USE_CSCONV
    if (restore)
       skip_native_to_utf8_conv = False;
#endif

    return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int IMConvertToUTF8 ( char *  from_buf,
size_t  from_left,
char **  to_buf,
size_t *  to_left 
)

Definition at line 341 of file iiimpConv.c.

{
  size_t ret = 0;
#ifdef USE_CSCONV
  static csconv_t csconv_cd = NULL;
#endif

#ifdef USE_ICONV
  if (skip_native_to_utf8_conv) {
    strcpy (to_buf, from_buf);
    *to_left -= from_left;
    return ret;
  }

  if (i_conv_ToUTF8 == (iconv_t)-1)
    /* already failed */
    return -1;

  if (i_conv_ToUTF8 == NULL) {
    char *encoding = nl_langinfo(CODESET);

    if (!strcmp(encoding, "UTF-8")) {
      skip_native_to_utf8_conv = True;
      strcpy (to_buf, from_buf);
      *to_left -= from_left;
      return ret;
    } else {
      if ((i_conv_ToUTF8 = iconv_open("UTF-8", encoding))
         == (iconv_t) - 1) {
       /* fallback */
       encoding = "646";
       if ((i_conv_ToUTF8 = iconv_open("UTF-8", encoding))
           == (iconv_t) - 1)
         goto done;
      }
    }
  }

  ret = iconv(i_conv_ToUTF8, (const char**)&from_buf, &from_left,
             to_buf, to_left);
 done:
#endif /* USE_ICONV */

  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 781 of file iiimcfFun.c.

{
    IIIMF_status st;
    IIIMCF_attr attr;
    IIIMCF_language lang;
    
    st = iiimcf_create_attr(&attr); 
    if (st != IIIMF_STATUS_SUCCESS) return st;
    lang = get_IM_language(im);
    if (lang) {
       st = iiimcf_attr_put_ptr_value(attr,
                                   IIIMCF_ATTR_INPUT_LANGUAGE,
                                   lang);
       if (st != IIIMF_STATUS_SUCCESS) goto exit;
    }

    if (XIM_IIIMP(im, engine_name)) {
       st = iiimcf_attr_put_string_value(attr,
                                     IIIMCF_ATTR_INPUT_METHOD_NAME,
                                     XIM_IIIMP(im, engine_name));
       if (st != IIIMF_STATUS_SUCCESS) goto exit;
    }

    st = iiimcf_create_context(XIM_IIIMP(im, handle), attr, pc);
    if (XIM_IIIMP(im, inited) == False) {
#ifdef linux
       if (0 == strcmp(XIM_IIIMP(im, client_type), "IIIMX XIM Server")) {
           CreateKanaWindow(im->core.display);
       }
#endif /* linux */
       XIM_IIIMP(im, inited) = True;
    }

exit:
    iiimcf_destroy_attr(attr);
    return st;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool IMForwardEvent ( XicCommon  xic,
XEvent *  ev 
)

Definition at line 571 of file iiimcfFun.c.

{
    IIIMF_status st;
    IIIMCF_keyevent kev;
    IIIMCF_event event;

    if (!XKeyEvent_To_IIIMCF_keyevent((XKeyEvent*) ev, &kev))
       return True;

#if 0 /* SHOULD BE REMOVED */
    fprintf(stderr, "(%d, %d)->(%d, %d, %d)\n",
           ev->xkey.keycode, ev->xkey.state,
           kev.keycode, kev.keychar, kev.modifier);
#endif

    st = iiimcf_create_keyevent(&kev, &event);
    if (st != IIIMF_STATUS_SUCCESS) return False;

    st = iiimcf_forward_event(XIC_IIIMP(ic, context), event);

    IMProcessIncomingEvent(ic);

    if (st != IIIMF_STATUS_SUCCESS) return False;

    return True;
}

Here is the call graph for this function:

Bool IMGetICValues ( XicCommon  ic,
XICAttribute ic_attr,
int  attr_count 
)

Definition at line 860 of file iiimpIC.c.

{
    /* nothing to do from X client */
    return True;
}

Here is the caller graph for this function:

Bool IMGetIMValue ( XimCommon  im,
int  attr_id 
)
Bool IMSetICValues ( XicCommon  ic,
XICAttribute ic_attr,
int  attr_count 
)
Bool IMSetPrimaryLocale ( XicCommon  ic,
char *  input_locale 
)

Definition at line 823 of file iiimcfFun.c.

{
    IIIMCF_context c;
    char *orig;
    XimCommon im = (XimCommon)ic->core.im;

    orig = XIM_IIIMP(im, primary_locale);
    XIM_IIIMP(im, primary_locale) = input_locale;
    if (IMCreateIC(im, &c) != IIIMF_STATUS_SUCCESS) {
       XIM_IIIMP(im, primary_locale) = orig;
       return False;
    }
    iiimcf_destroy_context(XIC_IIIMP(ic, context));
    XIC_IIIMP(ic, context) = c;

    return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 548 of file iiimcfFun.c.

{
    IIIMCF_event ev;
    if (!ic) return False;

    if (conv_mode == CONV_OFF) {
      end_lookup_choice(ic);
    }

    if (iiimcf_create_trigger_notify_event(conv_mode, &ev)
       != IIIMF_STATUS_SUCCESS) return False;

    if (iiimcf_forward_event(XIC_IIIMP(ic, context), ev)
       != IIIMF_STATUS_SUCCESS) return False;
    IMProcessIncomingEvent(ic);

    return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void makeClientDescripter ( Display *  dpy,
char *  client_name,
XICAttribute ic_attr,
int  icid 
)

Definition at line 768 of file iiimpIC.c.

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

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

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

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

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

    return;
}

Here is the caller graph for this function:

void SetConversionMode ( XicCommon  ,
int   
)

Definition at line 174 of file iiimpIC.c.

{
    XIC_IIIMP(ic, filtered) = mode;

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

Here is the call graph for this function:

Here is the caller graph for this function:

void SwitchKeyEventFilter ( XicCommon  ic,
Window  old_focus 
)

Definition at line 450 of file switchIM.c.

{
    _XUnregisterFilter(ic->core.im->core.display, old_focus,
                     Switch_KeyFilter, (XPointer)ic);
    _XRegisterFilterByType(ic->core.im->core.display, ic->core.focus_window,
                        KeyPress, KeyRelease,
                        Switch_KeyFilter, (XPointer)ic);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function: