Back to index

im-sdk  12.3.91
Classes | Defines | Typedefs | Functions | Variables
iiimpAux.c File Reference
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <dlfcn.h>
#include <string.h>
#include <strings.h>
#include <ctype.h>
#include <sys/param.h>
#include <X11/Xmd.h>
#include <X11/Xlib.h>
#include "Xlcint.h"
#include "iiimpIM.h"
#include "iiimpAux.h"
#include "iiimpAuxP.h"
#include "guiIMPre.h"
#include "iiimpConv.h"
#include "XimpIm.h"
#include "trace_message.h"

Go to the source code of this file.

Classes

struct  _aux_entry
struct  _aux_handle
struct  _aux_im_data
struct  _aux_ic_info
struct  AUXComposed

Defines

#define AUX_BASE_DIR   IIIMLEDIR
#define AUX_DIR_SYMBOL   "aux_dir"
#define AUX_CONF_MAGIC   "# IIIM X auxiliary"
#define AUX_INFO_SYMBOL   "aux_info"
#define IS_SPACE(len, ptr)
#define IS_EOL(len, ptr)   (((len) <= 0) || ('\n' == *(p)))
#define IS_NOT_EOL(len, ptr)   ((0 < (len)) && ('\n' != *(p)))
#define IS_PREEDIT_POSITION(ic)
#define ROUNDUP(n)   ((n + sizeof(int) - 1) / sizeof(int) * sizeof(int))
#define ROUNDUP(n)   ((n + sizeof(int) - 1) / sizeof(int) * sizeof(int))

Typedefs

typedef struct _aux_entry aux_entry_t
typedef struct _aux_handle aux_handle_t
typedef struct _aux_ic_info aux_ic_info_t

Functions

static aux_handle_taux_load (char *aux_file_name)
static aux_handle_taux_conf_load (char *aux_file_name)
static aux_handle_taux_so_load (char *aux_file_name)
static aux_taux_get (XicCommon ic, IIIMCF_event ev, const IIIMP_card16 *aux_name)
static aux_entry_taux_entry_get (const IIIMP_card16 *name)
static aux_im_data_t * aux_im_get (XicCommon, int)
static int aux_string_length (const IIIMP_card16 *str)
static void service_aux_setvalue (aux_t *, const unsigned char *, int)
static void service_aux_getvalue (aux_t *, const unsigned char *, int)
static int service_im_id (aux_t *)
static int service_ic_id (aux_t *)
static void service_data_set (aux_t *, int, void *)
static void * service_data_get (aux_t *, int)
static Display * service_display (aux_t *)
static Window service_window (aux_t *)
static XPoint * service_point (aux_t *, XPoint *)
static XPoint * service_point_caret (aux_t *, XPoint *)
static size_t service_utf16_mb (const char **, size_t *, char **, size_t *)
static size_t service_mb_utf16 (const char **, size_t *, char **, size_t *)
static unsigned char * service_compose (const aux_data_t *, int *)
static int service_compose_size (aux_data_type_t, const unsigned char *)
static aux_data_tservice_decompose (aux_data_type_t, const unsigned char *)
static void service_decompose_free (aux_data_t *)
static void service_register_X_filter (Display *, Window, int, int, Bool(*filter)(Display *, Window, XEvent *, XPointer), XPointer)
static void service_unregister_X_filter (Display *, Window, Bool(*filter)(Display *, Window, XEvent *, XPointer), XPointer)
static Bool service_server (aux_t *)
static Window service_client_window (aux_t *)
static Window service_focus_window (aux_t *)
static int service_screen_number (aux_t *)
static int service_point_screen (aux_t *, XPoint *)
static int service_point_caret_screen (aux_t *, XPoint *)
static Bool service_get_conversion_mode (aux_t *)
static void service_set_conversion_mode (aux_t *, int)
static aux_tservice_aux_get_from_id (int im_id, int ic_id, CARD16 *aux_name, int aux_name_length)
void IIimpAuxDownload (IIIMCF_downloaded_object obj)
static AUXComposedcreate_composed_from_event (aux_t *aux, IIIMCF_event ev)
static AUXComposedcreate_composed_from_aux_data (const aux_data_t *pad1)
void IIimpAuxStart (XicCommon ic, IIIMCF_event ev)
void IIimpAuxDraw (XicCommon ic, IIIMCF_event ev)
void IIimpAuxDone (XicCommon ic, IIIMCF_event ev)
void IIimpAuxGetValuesReply (XicCommon ic, IIIMCF_event ev)
void IIimpAuxSetICFocus (XicCommon ic)
void IIimpAuxUnsetICFocus (XicCommon ic)
static void delete_aux_ic (XicCommon ic)
void IIimpDestroryAuxData (XicCommon ic)
void IIimpFreeAllAuxData ()
static aux_dir_tget_aux_dir_from_aux_info (void *handle, unsigned int *ifversion)
static int auxname_strncmp (const IIIMP_card16 *s1, const IIIMP_card16 *s2, int len)
static aux_im_data_t * create_aux_im_data (aux_t *aux, int id, const IIIMP_card16 *auxname)

Variables

static aux_service_t aux_service
static aux_handle_taux_handle
static aux_ic_info_taux_ic_info = NULL

Class Documentation

struct _aux_entry

Definition at line 176 of file imaux-int.h.

Collaboration diagram for _aux_entry:
Class Members
int created
aux_dir_t dir
unsigned int if_version
struct _aux_entry * next
struct _aux_handle

Definition at line 183 of file imaux-int.h.

Collaboration diagram for _aux_handle:
Class Members
aux_entry_t * ae
int ae_num
aux_name_t aux_name
char * file_name
void * handle
struct _aux_handle * next
struct _aux_im_data

Definition at line 192 of file imaux-int.h.

Collaboration diagram for _aux_im_data:
Class Members
aux_entry_t * ae
void * data
int ic_id
int im_id
aux_im_data_t * next
struct _aux_ic_info

Definition at line 200 of file imaux-int.h.

Collaboration diagram for _aux_ic_info:
Class Members
XicCommon ic_common
aux_ic_data_t * ic_data
int ic_id
int im_id
struct _aux_ic_info * next
struct AUXComposed

Definition at line 58 of file imaux.c.

Collaboration diagram for AUXComposed:
Class Members
aux_t * aux
IIIMCF_event ev
int len
aux_data_t * pad

Define Documentation

#define AUX_BASE_DIR   IIIMLEDIR

Definition at line 82 of file iiimpAux.c.

#define AUX_CONF_MAGIC   "# IIIM X auxiliary"

Definition at line 123 of file iiimpAux.c.

#define AUX_DIR_SYMBOL   "aux_dir"

Definition at line 122 of file iiimpAux.c.

#define AUX_INFO_SYMBOL   "aux_info"

Definition at line 125 of file iiimpAux.c.

#define IS_EOL (   len,
  ptr 
)    (((len) <= 0) || ('\n' == *(p)))

Definition at line 130 of file iiimpAux.c.

#define IS_NOT_EOL (   len,
  ptr 
)    ((0 < (len)) && ('\n' != *(p)))

Definition at line 131 of file iiimpAux.c.

#define IS_PREEDIT_POSITION (   ic)
Value:
(XIMP_CHK_PRESPOTLMASK(ic) &&                     \
                      (!((ic)->core.input_style & XIMPreeditArea)) && \
                      ((ic->core.input_style & XIMPreeditPosition) || \
                      (ic->core.input_style & XIMPreeditCallbacks)) )

Definition at line 133 of file iiimpAux.c.

#define IS_SPACE (   len,
  ptr 
)
Value:
((0 < (len)) &&                           \
                             (('\t' == *(p)) || (' ' == *(p))))

Definition at line 128 of file iiimpAux.c.

#define ROUNDUP (   n)    ((n + sizeof(int) - 1) / sizeof(int) * sizeof(int))
#define ROUNDUP (   n)    ((n + sizeof(int) - 1) / sizeof(int) * sizeof(int))

Typedef Documentation

typedef struct _aux_entry aux_entry_t
typedef struct _aux_handle aux_handle_t
typedef struct _aux_ic_info aux_ic_info_t

Function Documentation

static aux_handle_t * aux_conf_load ( char *  aux_file_name) [static]

Definition at line 946 of file iiimpAux.c.

{
    int              fd;
    struct stat      st_buf;
    void *           addr;
    char *           p;
    char *           aux_name;
    int              aux_name_len;
    char *           aux_so;
    int              aux_so_len;
    aux_handle_t *   ah;
    int              len;
    char *           inbuf;
    size_t           inbytesleft;
    char *           outbuf;
    size_t           outbytesleft;
    int              dir_name_len;
    char *           dir_name_last;

    dir_name_last = strrchr(aux_file_name, '/');
    if (NULL == dir_name_last) {
       return NULL;
    }
    dir_name_len = ((dir_name_last - aux_file_name) + 1);

    if (-1 == (fd = open(aux_file_name, O_RDONLY, 0))) {
       return NULL;
    }

    if (0 != fstat(fd, &st_buf)) {
       close(fd);
       return NULL;
    }

    addr = mmap(0, st_buf.st_size,
              PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);

    close(fd);

    if (MAP_FAILED == addr) {
       return NULL;
    }

    ah = NULL;
       
    for (p = addr, len = st_buf.st_size; 0 < len; ) {
       if ('#' == *p) {
           while (IS_NOT_EOL(len, p)) {
              p++;
              --len;
           }
           if (IS_EOL(len, p)) {
              p++;
              --len;
           }
           continue;
       }

       while (IS_SPACE(len, p)) {
           p++;
           --len;
       }
       if (IS_EOL(len, p)) {
           p++;
           --len;
           continue;
       }

       aux_name = p;
       while ((!(IS_SPACE(len, p))) && IS_NOT_EOL(len, p)) {
           p++;
           --len;
       }
       if (IS_EOL(len, p)) {
           p++;
           --len;
           continue;
       }

       aux_name_len = (p - aux_name);

       while (IS_SPACE(len, p)) {
           p++;
           --len;
       }
       if (IS_EOL(len, p)) {
           p++;
           --len;
           continue;
       }

       aux_so = p;
       while ((!(IS_SPACE(len, p))) && IS_NOT_EOL(len, p)) {
           p++;
           --len;
       }
       aux_so_len = (p - aux_so);

       ah = (aux_handle_t *)Xmalloc(sizeof (aux_handle_t));
       if (NULL == ah) {
           break;
       }

       ah->aux_name.len = (aux_name_len * (sizeof (CARD16)));
       ah->aux_name.ptr = Xmalloc(ah->aux_name.len);
       if (NULL == ah->aux_name.ptr) {
           XFree(ah);
           break;
       }

       inbuf = aux_name;
       inbytesleft = aux_name_len;
       outbuf = (char *)(ah->aux_name.ptr);
       outbytesleft = ah->aux_name.len;
       IIimpConvertToUTF16(inbuf, inbytesleft,
                         &outbuf, &outbytesleft);

       if ('/' == *aux_so) {
           ah->file_name = Xmalloc(aux_so_len + 1);
       } else {
           ah->file_name = Xmalloc(dir_name_len + aux_so_len + 1);
       }
       if (NULL == ah->file_name) {
           Xfree(ah->aux_name.ptr);
           Xfree(ah);
           break;
       }
       if ('/' == *aux_so) {
           memcpy(ah->file_name, aux_so, aux_so_len);
           *(ah->file_name + aux_so_len) = '\0';
       } else {
           memcpy(ah->file_name, aux_file_name, dir_name_len);
           memcpy(ah->file_name + dir_name_len, aux_so, aux_so_len);
           *(ah->file_name + dir_name_len + aux_so_len) = '\0';
       }
       ah->handle = NULL;
       ah->ae = NULL;
       ah->ae_num = 0;
       ah->next = aux_handle;
       aux_handle = ah;
    }

    munmap(addr, st_buf.st_size);

    return ah;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static aux_entry_t * aux_entry_get ( const IIIMP_card16 name) [static]

Definition at line 1368 of file iiimpAux.c.

{
    aux_handle_t *ah;
    aux_handle_t *ah0;
    aux_entry_t *ae;
    int       i;

    TRACE_MESSAGE('H', ("iiimpAux: aux_entry_get\n"));

    if (!name) return NULL;

    for (ah = aux_handle; NULL != ah; ah = ah->next) {
       if ((ah->aux_name.len > 0)
           && (!auxname_strncmp(name, ah->aux_name.ptr, ah->aux_name.len))) {
           /* This handle is created from a configuration file.
              Load SO now.  */
           ah0 = aux_so_load(ah->file_name);
           if (!ah0) continue;
           ah = ah0;
       }
       for (ae = ah->ae, i = ah->ae_num; 0 < i; ae += 1, --i) {
           if (!auxname_strncmp(name, ae->dir.name.ptr, ae->dir.name.len)) {
              return ae;
           }
       }
    }

    return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static aux_t * aux_get ( XicCommon  ic,
IIIMCF_event  ev,
const IIIMP_card16 aux_name 
) [static]

Definition at line 1276 of file iiimpAux.c.

{
    IIIMF_status st;
    aux_t *aux;
    aux_im_data_t *aux_im;
    aux_ic_info_t *aux_ic;
    XimCommon im;
    IIIMCF_handle handle;

    TRACE_MESSAGE('A', ("iiimpAux: aux_get\n"));

    if (aux_name == NULL) {
       st = iiimcf_get_aux_event_value(ev, &aux_name,
                                   NULL, NULL, NULL, NULL, NULL);
       if (st != IIIMF_STATUS_SUCCESS) return NULL;
    }

#if defined(ENABLE_TRACE)
    if (TRACE_P('s')) {
       const IIIMP_card16 *pu;
       TRACE_MESSAGE('s', ("iiimpAux: aux_get: "));
       for (pu = aux_name; *pu; pu++) {
           TRACE_MESSAGE('s', ("%04x ", *pu));
       }
       TRACE_MESSAGE('s', ("\n"));
    }
#endif /* ENABLE_TRACE */

    /*
     * create aux object if it is not created
     */

    aux = XIC_IIIMP(ic, aux);
    if (!aux) {
       aux = (aux_t *) Xmalloc(sizeof(*aux));
       if (!aux) return NULL;
       memset(aux, 0, sizeof(*aux));
       aux->ic = ic;
       aux->service = &aux_service;
       XIC_IIIMP(ic, aux) = aux;

       aux_ic = Xmalloc(sizeof(*aux_ic));
       if (!aux_ic) return NULL;
       memset(aux_ic, 0, sizeof(*aux_ic));
       im = (XimCommon)ic->core.im;
       handle = XIM_IIIMP(im, handle);
       st = iiimcf_get_im_id(handle, &aux_ic->im_id);
       if (st != IIIMF_STATUS_SUCCESS) {
           XFree(aux_ic);
           return NULL;
       }
       aux_ic->ic_id = XIC_IIIMP(ic, id);
       aux_ic->ic_common = ic;
       aux_ic->next = aux_ic_info;
       aux_ic_info = aux_ic;
    }

    if (aux) {
       /*
        * search for aux_im_data corresponding to aux_name.
        */
       for (aux_im = aux->im_list; aux_im; aux_im = aux_im->next) {
           if (!auxname_strncmp(aux_name,
                             aux_im->ae->dir.name.ptr,
                             aux_im->ae->dir.name.len)) {
              aux->im = aux_im;
              return aux;
           }
       }
    } else {
       if (NULL == (aux = (aux_t *)Xmalloc(sizeof (aux_t)))) {
           return NULL;
       }
       aux->ic = ic;
       aux->service = &aux_service;
       aux->im = NULL;
       aux->im_list = NULL;
       XIC_IIIMP(ic, aux) = aux;
    }

    aux_im = create_aux_im_data(aux, XIC_IIIMP(ic, id), aux_name);

    if (!aux_im) return NULL;

    return aux;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static aux_im_data_t * aux_im_get ( XicCommon  ic,
int  im_id 
) [static]

Definition at line 1405 of file iiimpAux.c.

{
    aux_im_data_t *  im;
    aux_t *          aux;

    TRACE_MESSAGE('I', ("iiimpAux: aux_im_get\n"));
       
    aux = XIC_IIIMP(ic, aux);

    for (im = aux->im_list; NULL != im; im = im->next) {
       if (im_id == im->im_id) {
           aux->im = im;
           return im;
       }
    }

    if (NULL == (im = (aux_im_data_t *)Xmalloc(sizeof (aux_im_data_t)))) {
       return NULL;
    }

    im->ae = NULL;
    im->data = NULL;
    im->next = aux->im_list;
    aux->im_list = im;
    aux->im = im;

    return im;
}
static aux_handle_t * aux_load ( char *  aux_file_name) [static]

Definition at line 910 of file iiimpAux.c.

{
    int              fd;
    char             buf[64];
    int              magic_len;
    int              len;

    TRACE_MESSAGE('A', ("iiimpAux: aux_load\n"));

    if (-1 == (fd = open(aux_file_name, O_RDONLY, 0))) {
       TRACE_MESSAGE('A', ("iiimpAux: aux_load: can not open %s\n",
                         aux_file_name));
       return NULL;
    }

    magic_len = strlen(AUX_CONF_MAGIC);

    len = read(fd, buf, magic_len);

    close(fd);

    if ((len == magic_len) &&
       (0 == memcmp(buf, AUX_CONF_MAGIC, len))) {
       return aux_conf_load(aux_file_name);
    } else {
       return aux_so_load(aux_file_name);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static aux_handle_t * aux_so_load ( char *  aux_file_name) [static]

Definition at line 1121 of file iiimpAux.c.

{
    void *           handle = (void *)NULL;
    aux_dir_t *      aux_dir;
    aux_dir_t *      ad;
    int              adn;
    aux_handle_t *   ah;
    aux_handle_t *   ah_free;
    int              i;
    unsigned int ifversion;

    TRACE_MESSAGE('A', ("iiimpAux: aux_so_load\n"));

    /*
     * check whether the object is already loaded
     */
    for (ah = aux_handle; NULL != ah; ah = ah->next) {
       if ((0 == strcmp(aux_file_name, ah->file_name)) &&
           (NULL != ah->handle)) {
           return ah;
       }
    }

    /*
     * load the object and construct aux_handle_t structure for it
     */
    handle = dlopen(aux_file_name, RTLD_LAZY);
    if (NULL == handle) {
       TRACE_MESSAGE('A',
                    ("iiimpAux: aux_so_load: failed to dlopen %s (%s)\n",
                     aux_file_name, dlerror()));
       return NULL;
    }


    aux_dir = get_aux_dir_from_aux_info (handle, &ifversion);
    if (NULL == aux_dir) {
       aux_dir = (aux_dir_t *)dlsym(handle, AUX_DIR_SYMBOL);
       if (NULL == aux_dir) {
           dlclose(handle);
           return NULL;
       }
       ifversion = 0;
    }

    for (adn = 0, ad = aux_dir; 0 < ad->name.len; ad += 1, adn += 1);

    if (NULL == ah) {
       ah = (aux_handle_t *)Xmalloc(sizeof (aux_handle_t));
       if (NULL == ah) {
           dlclose(handle);
           return NULL;
       }
       memset(ah, 0, sizeof (aux_handle_t));

       ah_free = ah;
    } else {
       ah_free = NULL;
    }

    if (NULL == ah->file_name) {
       ah->file_name = strdup(aux_file_name);
       if (NULL == ah->file_name) {
           Xfree(ah);
           dlclose(handle);
           return NULL;
       }
    }
    ah->handle = handle;
    ah->ae_num = adn;
    ah->ae = Xmalloc(adn * (sizeof (aux_entry_t)));
    if (NULL == ah->ae) {
       if (NULL != ah_free) {
           Xfree(ah->file_name);
           Xfree(ah);
       }
       dlclose(handle);
       return NULL;
    }
    memset(ah->ae, 0, adn * (sizeof (aux_entry_t)));
    for (i = 0; i < adn; i++) {
       (ah->ae + i)->created = 0;
       memcpy(&((ah->ae + i)->dir), aux_dir + i, sizeof (aux_dir_t));
       (ah->ae + i)->if_version = ifversion;
    }

    ah->next = aux_handle;
    aux_handle = ah;

    return ah;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int aux_string_length ( const IIIMP_card16 str) [static]

Definition at line 1438 of file iiimpAux.c.

{
    int n;
    for (n = 0; *str; str++, n++);
    return n;
}

Here is the caller graph for this function:

static int auxname_strncmp ( const IIIMP_card16 s1,
const IIIMP_card16 s2,
int  len 
) [static]

Definition at line 1216 of file iiimpAux.c.

{
    len /= sizeof(IIIMP_card16);
    for (;len > 0; len--, s1++, s2++) {
       if (*s1 > *s2) return 1;
       if (*s1 < *s2) return -1;
       if (!*s1) return 0;
    }
    if (!*s1) return 0;
    return 2;
}

Here is the caller graph for this function:

static aux_im_data_t* create_aux_im_data ( aux_t aux,
int  id,
const IIIMP_card16 auxname 
) [static]

Definition at line 1233 of file iiimpAux.c.

{
    aux_entry_t *ae;
    aux_im_data_t *aux_im;
    XicCommon ic;
    XimCommon im;
    IIIMCF_handle handle;
    IIIMF_status st;

    ae = aux_entry_get(auxname);
    if (!ae) return NULL;
    aux_im = (aux_im_data_t *) Xmalloc(sizeof(*aux_im));
    if (!aux_im) return NULL;
    memset(aux_im, 0, sizeof(*aux_im));
    ic = (XicCommon)aux->ic;
    im = (XimCommon)ic->core.im;
    handle = XIM_IIIMP(im, handle);
    st = iiimcf_get_im_id(handle, &aux_im->im_id);
    if (st != IIIMF_STATUS_SUCCESS) {
       XFree(aux_im);
       return NULL;
    }
    /* The following members are only for fake. */
    aux_im->ic_id = id;
    /* end */
    aux_im->ae = ae;

    aux_im->next = aux->im_list;
    aux->im_list = aux_im;
    aux->im = aux_im;
    if (!ae->created) {
       if (!ae->dir.method->create(aux)) return NULL;
       ae->created = 1;
    }

    return aux_im;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static AUXComposed* create_composed_from_aux_data ( const aux_data_t pad1) [static]

Definition at line 540 of file iiimpAux.c.

{
    unsigned char *p;
    AUXComposed *pac;
    aux_data_t *pad2;

    int i, n;
    int aux_data_t_n;
    int aux_name_n;
    int integer_list_n, string_list_n;
    int string_n;

#define ROUNDUP(n) ((n + sizeof(int) - 1) / sizeof(int) * sizeof(int))

    /* first of all, caliculate size. */
    n = ROUNDUP(sizeof(AUXComposed));
    aux_data_t_n = n;
    n += sizeof(aux_data_t);
    aux_name_n = n = ROUNDUP(n);
    n += pad1->aux_name_length + sizeof(IIIMP_card16);
    integer_list_n = n = ROUNDUP(n);
    n += pad1->integer_count * sizeof(int);
    string_list_n = n = ROUNDUP(n);
    n += pad1->string_count * sizeof(aux_string_t);
    string_n = n = ROUNDUP(n);
    for (i = 0; i < pad1->string_count; i++) {
       n += pad1->string_list[i].length + sizeof(IIIMP_card16);
    }

    p = (unsigned char*) malloc(n);
    if (!p) return NULL;
    memset(p, 0, n);

    pac = (AUXComposed*) p;
    pac->len = n;
    pad2 = (aux_data_t*)(p + aux_data_t_n);
    pac->pad = pad2;

    *pad2 = *pad1;
    pad2->aux_name = p + aux_name_n;
    memcpy(pad2->aux_name, pad1->aux_name, pad1->aux_name_length);

    if (pad1->integer_count > 0) {
       pad2->integer_list = (int*)(p + integer_list_n);
       memcpy(pad2->integer_list, pad1->integer_list,
              sizeof(int) * pad1->integer_count);
    } else {
       pad2->integer_list = NULL;
    }

    pad2->string_ptr = p;
    if (pad1->string_count > 0) {
       aux_string_t *pas1, *pas2;

       pas1= pad1->string_list;
       pad2->string_list = pas2 = (aux_string_t*)(p + string_list_n);
       p += string_n;
       for (i = 0; i < pad1->string_count; i++, pas1++, pas2++) {
           pas2->length = pas1->length;
           pas2->ptr = p;
           memcpy(p, pas1->ptr, pas2->length);
           p += pas2->length + sizeof(IIIMP_card16);
       }
    } else {
       pad2->string_list = NULL;
    }

    return pac;

#undef ROUNDUP
}

Here is the caller graph for this function:

static AUXComposed* create_composed_from_event ( aux_t aux,
IIIMCF_event  ev 
) [static]

Definition at line 433 of file iiimpAux.c.

{
    unsigned char *p;
    AUXComposed *pac;
    IIIMF_status st;
    const IIIMP_card16 *aux_name;
    IIIMP_card32 class_idx;
    int num_intvals;
    const IIIMP_card32 *pintvals;
    int num_strvals;
    const IIIMP_card16 **pstrs;
    aux_data_t *pad;

    int i, n;
    int aux_data_t_n;
    int aux_name_len, aux_name_n;
    int integer_list_n = 0, string_list_n = 0;
    int string_n = 0;
    int *pstring_len;

#define ROUNDUP(n) ((n + sizeof(int) - 1) / sizeof(int) * sizeof(int))

    st = iiimcf_get_aux_event_value(ev, &aux_name, &class_idx,
                                &num_intvals, &pintvals,
                                &num_strvals, &pstrs);
    if (st != IIIMF_STATUS_SUCCESS) return NULL;

    /* first of all, caliculate size. */
    n = ROUNDUP(sizeof(AUXComposed));
    aux_data_t_n = n;
    n += sizeof(aux_data_t);
    aux_name_n = n = ROUNDUP(n);
    aux_name_len = aux_string_length(aux_name);
    n += (aux_name_len + 1) * sizeof(IIIMP_card16);
    if (num_intvals > 0) {
       integer_list_n = n = ROUNDUP(n);
       n += num_intvals * sizeof(int);
    }
    pstring_len = NULL;
    if (num_strvals > 0) {
       pstring_len = (int*) malloc(sizeof(int) * num_strvals);
       if (!pstring_len) return NULL;
       string_list_n = n = ROUNDUP(n);
       n += num_strvals * sizeof(aux_string_t);
       string_n = n = ROUNDUP(n);
       for (i = 0; i < num_strvals; i++) {
           pstring_len[i] = aux_string_length(pstrs[i]);
           n += (pstring_len[i] + 1) * sizeof(IIIMP_card16);
       }
    }
    p = (unsigned char*) malloc(n);
    if (!p) {
       if (pstring_len) free(pstring_len);
       return NULL;
    }
    memset(p, 0, n);

    pac = (AUXComposed*) p;
    pac->len = n;
    pac->ev = ev;
    pad = (aux_data_t*)(p + aux_data_t_n);
    pac->pad = pad;

    if (aux) {
       pac->aux = aux;
       pad->im = aux->im->im_id;
       pad->ic = aux->im->ic_id;
    }

    pad->aux_index = class_idx;
    pad->aux_name = p + aux_name_n;
    memcpy(pad->aux_name, aux_name, (aux_name_len + 1) * sizeof(IIIMP_card16));
    pad->aux_name_length = aux_name_len * sizeof(IIIMP_card16);

    pad->integer_count = num_intvals;
    if (num_intvals > 0) {
       pad->integer_list = (int*)(p + integer_list_n);
       for (i = 0; i < num_intvals; i++) {
           pad->integer_list[i] = pintvals[i];
       }
    }
    pad->string_count = num_strvals;
    pad->string_ptr = p;
    if (num_strvals > 0) {
       aux_string_t *pas;

       pad->string_list = pas = (aux_string_t*)(p + string_list_n);
       p += string_n;
       for (i = 0; i < num_strvals; i++, pas++) {
           pas->length = pstring_len[i] * sizeof(IIIMP_card16);
           pas->ptr = p;
           n = (pstring_len[i] + 1) * sizeof(IIIMP_card16);
           memcpy(p, pstrs[i], n);
           p += n;
       }
    }

    if (pstring_len) free(pstring_len);
    return pac;

#undef ROUNDUP
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void delete_aux_ic ( XicCommon  ic) [static]

Definition at line 816 of file iiimpAux.c.

{
    aux_t *aux;
    aux_im_data_t *aux_im;
    aux_ic_info_t *aux_ic;
    aux_ic_info_t *prev_aux_ic;

    aux = XIC_IIIMP(ic, aux);
    if (!aux)
       return;

    for (aux_im = aux->im_list; aux_im; aux_im = aux_im->next) {
       if (aux_im->ae->if_version >= AUX_IF_VERSION_2 &&
           aux_im->ae->dir.method->destroy_ic != NULL) {
           aux->im = aux_im;
           aux_im->ae->dir.method->destroy_ic(aux);
       }
    }

    prev_aux_ic = NULL;
    for (aux_ic = aux_ic_info; aux_ic != NULL; aux_ic = aux_ic->next) {
       if (aux_ic->ic_common == ic) {
           if (prev_aux_ic == NULL)
              aux_ic_info = aux_ic->next;
           else
              prev_aux_ic->next = aux_ic->next;
           Xfree(aux_ic);
           break;
       }
       prev_aux_ic = aux_ic;
    }
}

Here is the caller graph for this function:

static aux_dir_t* get_aux_dir_from_aux_info ( void *  handle,
unsigned int *  ifversion 
) [static]

Definition at line 1100 of file iiimpAux.c.

{
    aux_info_t       *aux_info;

    aux_info = (aux_info_t*)dlsym(handle, AUX_INFO_SYMBOL);

    if(aux_info && aux_info->if_version >= AUX_IF_VERSION_2 &&
       aux_info->register_service != NULL) {
       aux_info->register_service (AUX_IF_VERSION_2, &aux_service);
       *ifversion = aux_info->if_version;
       return aux_info->dir;
    }

       return NULL;
}

Here is the caller graph for this function:

void IIimpAuxDone ( XicCommon  ic,
IIIMCF_event  ev 
)

Definition at line 683 of file iiimpAux.c.

{
    aux_t *aux;
    AUXComposed ac;

    TRACE_MESSAGE('A', ("iiimpAux: done\n"));

    aux = aux_get(ic, ev, NULL);
    if (!aux) {
       TRACE_MESSAGE('A', ("iiimpAux: done: failed to get aux\n"));
       return;
    }

    memset(&ac, 0, sizeof(ac));
    ac.aux = aux;
    ac.ev = ev;

    aux->im->ae->dir.method->done(aux,
                              (XPointer) &ac,
                              /* Always set 0! */
                              0);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 281 of file iiimpAux.c.

{
    char *aux_file_name;
    char *aux_file_name_buf;
    int       aux_file_name_len;
    char file_name[MAXPATHLEN];
    char *dir_name;
    int       dir_name_len;
    Bool useUnicode = False; /* default */
    IIIMF_status st;
    const IIIMP_card16 *u16filename;

    TRACE_MESSAGE('A', ("iiimpAux: download\n"));

    aux_file_name = NULL;
    aux_file_name_buf = NULL;

    st = iiimcf_get_downloaded_object_filename(obj, &u16filename);
    if (st != IIIMF_STATUS_SUCCESS) return;
    st = IIimpUTF16ToString(u16filename, useUnicode, &aux_file_name);
    if (st != IIIMF_STATUS_SUCCESS) return;
    aux_file_name_buf = aux_file_name;

#if defined(IIIM_AUX_SO_PATH_ENV)
    p = getenv(IIIM_AUX_SO_PATH_ENV);

    if (NULL != p) {
       aux_file_name = p;
    }

    if (NULL == aux_file_name) {
       aux_file_name = "./aux.so";
    }
#endif /* IIIM_AUX_SO_PATH_ENV */

    if (NULL == aux_file_name) {
       return;
    }

    aux_file_name_len = strlen(aux_file_name);

    /*
     * may not start with "/"
     * may not start with "../"
     * may not contain "/../"
     * may not end with "/"
     * may not end with "/."
     * may not end with "/.."
     * may not be ".."
     */

    if (((1 <= aux_file_name_len) &&
        ('/' == *(aux_file_name + 0))) ||
       ((3 <= aux_file_name_len) &&
        ('.' == *(aux_file_name + 0)) &&
        ('.' == *(aux_file_name + 1)) &&
        ('/' == *(aux_file_name + 2))) ||
       (NULL != strstr(aux_file_name, "/../")) ||
       ((1 <= aux_file_name_len) &&
        ('/' == *(aux_file_name + aux_file_name_len - 1))) ||
       ((2 <= aux_file_name_len) &&
        ('/' == *(aux_file_name + aux_file_name_len - 2)) &&
        ('.' == *(aux_file_name + aux_file_name_len - 1))) ||
       ((3 <= aux_file_name_len) &&
        ('/' == *(aux_file_name + aux_file_name_len - 3)) &&
        ('.' == *(aux_file_name + aux_file_name_len - 2)) &&
        ('.' == *(aux_file_name + aux_file_name_len - 1))) ||
       ((2 == aux_file_name_len) &&
        ('.' == *(aux_file_name + 0)) &&
        ('.' == *(aux_file_name + 1)))) {

       Xfree (aux_file_name_buf);
       return;
    }

    /*
     * eliminate leading "./"
     */
    if ((2 <= aux_file_name_len) &&
       ('.' == *(aux_file_name + 0)) &&
       ('/' == *(aux_file_name + 1))) {
       aux_file_name += 2;
       aux_file_name_len -= 2;
    }

    dir_name = AUX_BASE_DIR;

#if defined(IIIM_AUX_SO_BASE_ENV)
    {
       char * p;
       if (NULL != (p = getenv(IIIM_AUX_SO_BASE_ENV))) {
           dir_name = p;
       }
    }
#endif /* IIIM_AUX_SO_BASE_ENV */

    dir_name_len = strlen(dir_name);

#if defined(__sparcv9)
    if (MAXPATHLEN <
       (dir_name_len + 1 + aux_file_name_len + SPARCV9_DIR_LEN + 1)) {
       Xfree (aux_file_name_buf);
       return;
    }
    p = strrchr(aux_file_name, '/');
    if (NULL == p) {
       p = aux_file_name;
    } else {
       p += 1;
    }
    memcpy(file_name, dir_name, dir_name_len);
    len = (p - aux_file_name);
    if (dir_name_len > 0 && dir_name[dir_name_len-1] == '/') {
       memcpy(file_name + dir_name_len, aux_file_name, len);
       len += dir_name_len;
    } else {
       file_name[dir_name_len] = '/';
       memcpy(file_name + dir_name_len + 1, aux_file_name, len);
       len += (dir_name_len + 1);
    }
    memcpy(file_name + len, SPARCV9_DIR, SPARCV9_DIR_LEN);
    len += SPARCV9_DIR_LEN;
    memcpy(file_name + len, p, aux_file_name_len - (p - aux_file_name) + 1);

#else /* !__sparcv9 */

    if (MAXPATHLEN <= (dir_name_len + 1 + aux_file_name_len + 1)) {
       Xfree (aux_file_name_buf);
       return;
    }

    memcpy(file_name, dir_name, dir_name_len + 1);
    if (dir_name_len > 0 && dir_name[dir_name_len-1] == '/') {
       memcpy(file_name + dir_name_len,
              aux_file_name, aux_file_name_len + 1);
    } else {
       file_name[dir_name_len] = '/';
       memcpy(file_name + dir_name_len + 1,
              aux_file_name, aux_file_name_len + 1);
    }
#endif /* !__sparcv9 */

    (void)aux_load(file_name);

    Xfree (aux_file_name_buf);

    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void IIimpAuxDraw ( XicCommon  ic,
IIIMCF_event  ev 
)

Definition at line 651 of file iiimpAux.c.

{
    aux_t *aux;
    AUXComposed ac;

    TRACE_MESSAGE('A', ("iiimpAux: draw\n"));

    aux = aux_get(ic, ev, NULL);
    if (!aux) {
       TRACE_MESSAGE('A', ("iiimpAux: draw: failed to get aux\n"));
       return;
    }

    memset(&ac, 0, sizeof(ac));
    ac.aux = aux;
    ac.ev = ev;

    aux->im->ae->dir.method->draw(aux,
                              (XPointer) &ac,
                              /* Always set 0! */
                              0);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 714 of file iiimpAux.c.

{
    aux_t *aux;
    AUXComposed ac;

    TRACE_MESSAGE('A', ("iiimpAux: getvalues reply\n"));

    aux = aux_get(ic, ev, NULL);
    if (!aux) {
       TRACE_MESSAGE('A', ("iiimpAux: getvalues reply: failed to get aux\n"));
       return;
    }

    memset(&ac, 0, sizeof(ac));
    ac.aux = aux;
    ac.ev = ev;

    if (aux->im->ae->dir.method->getvalues_reply)
       aux->im->ae->dir.method->getvalues_reply(aux,
                                           (XPointer) &ac,
                                           /* Always set 0! */
                                           0);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 774 of file iiimpAux.c.

{
    aux_t *aux;
    aux_im_data_t *aux_im;

    aux = XIC_IIIMP(ic, aux);
    if (!aux)
       return;

    for (aux_im = aux->im_list; aux_im; aux_im = aux_im->next) {
       if (aux_im->ae->if_version >= AUX_IF_VERSION_2 &&
           aux_im->ae->dir.method->set_icforcus != NULL) {
           aux->im = aux_im;
           aux_im->ae->dir.method->set_icforcus(aux);
       }
    }
}

Here is the caller graph for this function:

void IIimpAuxStart ( XicCommon  ic,
IIIMCF_event  ev 
)

Definition at line 618 of file iiimpAux.c.

{
    aux_t *aux;
    AUXComposed ac;

    TRACE_MESSAGE('A', ("iiimpAux: start\n"));

    aux = aux_get(ic, ev, NULL);
    if (!aux) {
       TRACE_MESSAGE('A', ("iiimpAux: start: failed to get aux\n"));
       return;
    }

    memset(&ac, 0, sizeof(ac));
    ac.aux = aux;
    ac.ev = ev;

    aux->im->ae->dir.method->start(aux, 
                               (XPointer) &ac,
                               /* Always set 0! */
                               0);

    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 795 of file iiimpAux.c.

{
    aux_t *aux;
    aux_im_data_t *aux_im;

    aux = XIC_IIIMP(ic, aux);
    if (!aux)
       return;

    for (aux_im = aux->im_list; aux_im; aux_im = aux_im->next) {
       if (aux_im->ae->if_version >= AUX_IF_VERSION_2 &&
           aux_im->ae->dir.method->unset_icforcus != NULL) {
           aux->im = aux_im;
           aux_im->ae->dir.method->unset_icforcus(aux);
       }
    }
}

Here is the caller graph for this function:

Definition at line 852 of file iiimpAux.c.

{
    aux_t *aux;
    aux_im_data_t *pai1, *pai2;

    if (!ic || !ic->iiimp_icpart) return;
    aux = XIC_IIIMP(ic, aux);
    if (!aux) return;

    delete_aux_ic(ic);

    for (pai1 = aux->im_list; pai1; ) {
       pai2 = pai1->next;
       free(pai1);
       pai1 = pai2;
    }
    aux->im_list = NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 877 of file iiimpAux.c.

{
    aux_handle_t *ah;
    aux_handle_t *ah_next;
    int       i;

    TRACE_MESSAGE('A', ("iiimpAux: destroy\n"));

    for (ah = aux_handle; NULL != ah; ah = ah_next) {
       for (i = 0; i < ah->ae_num; i++) {
           if (0 == (ah->ae + i)->created) {
              continue;
           }
           (ah->ae + i)->dir.method->destroy(NULL);
           (ah->ae + i)->created = 0;
       }
       ah_next = ah->next;
       Xfree(ah->aux_name.ptr);
       Xfree(ah->file_name);
       dlclose(ah->handle);
       Xfree(ah->ae);
       Xfree(ah);
    }

    aux_handle = NULL;

    return;
}

Here is the caller graph for this function:

static aux_t * service_aux_get_from_id ( int  im_id,
int  ic_id,
CARD16 aux_name,
int  aux_name_length 
) [static]

Definition at line 2026 of file iiimpAux.c.

{
    aux_ic_info_t *aux_ic;

    for (aux_ic = aux_ic_info; aux_ic != NULL; aux_ic = aux_ic->next) {
       if (aux_ic->im_id == im_id && aux_ic->ic_id == ic_id)
           break;
    }
    if (aux_ic == NULL)
       return NULL;

    return aux_get(aux_ic->ic_common, NULL, aux_name);
}

Here is the call graph for this function:

static void service_aux_getvalue ( aux_t aux,
const unsigned char *  p,
int  len 
) [static]

Definition at line 1514 of file iiimpAux.c.

{
    AUXComposed *pac = (AUXComposed*) p;

    if (pac->ev) {
       IMAuxGetValues(aux->ic, pac->ev);
    } else if (pac->pad) {
       int i;
       aux_data_t *pad = pac->pad;
       IIIMF_status st;
       IIIMCF_event ev;
       IIIMP_card32 *pintvals;
       const IIIMP_card16 **pstrs;

#ifdef ENABLE_TRACE
       static void show_AC(aux_data_t *pad);
       show_AC(pac->pad);
#endif
       if (pad->integer_count > 0) {
           pintvals = (IIIMP_card32*) malloc(sizeof(*pintvals) * pad->integer_count);
           if (!pintvals) return;
           for (i = 0; i < pad->integer_count; i++) {
              pintvals[i] = pad->integer_list[i];
           }
       } else {
           pintvals = NULL;
       }
       if (pad->string_count > 0) {
           pstrs = (const IIIMP_card16**) malloc(sizeof(*pstrs) * pad->string_count);
           if (!pstrs) {
              if (pintvals) free(pintvals);
              return;
           }
           for (i = 0; i < pad->string_count; i++) {
              pstrs[i] = (const IIIMP_card16*) pad->string_list[i].ptr;
           }
       } else {
           pstrs = NULL;
       }

       st = iiimcf_create_aux_getvalues_event((IIIMP_card16*) pad->aux_name,
                                          pad->aux_index,
                                          pad->integer_count,
                                          pintvals,
                                          pad->string_count,
                                          pstrs,
                                          &ev);
       if (st == IIIMF_STATUS_SUCCESS) {
           IMAuxGetValues(aux->ic, ev);
       }

       if (pintvals) free(pintvals);
       if (pstrs) free(pstrs);
    }

}

Here is the call graph for this function:

static void service_aux_setvalue ( aux_t aux,
const unsigned char *  p,
int  len 
) [static]

Definition at line 1452 of file iiimpAux.c.

{
    AUXComposed *pac = (AUXComposed*) p;

    if (pac->ev) {
       IMAuxSetValues(aux->ic, pac->ev);
    } else if (pac->pad) {
       int i;
       aux_data_t *pad = pac->pad;
       IIIMF_status st;
       IIIMCF_event ev;
       IIIMP_card32 *pintvals;
       const IIIMP_card16 **pstrs;

#ifdef ENABLE_TRACE
       static void show_AC(aux_data_t *pad);
       show_AC(pac->pad);
#endif
       if (pad->integer_count > 0) {
           pintvals = (IIIMP_card32*) malloc(sizeof(*pintvals) * pad->integer_count);
           if (!pintvals) return;
           for (i = 0; i < pad->integer_count; i++) {
              pintvals[i] = pad->integer_list[i];
           }
       } else {
           pintvals = NULL;
       }
       if (pad->string_count > 0) {
           pstrs = (const IIIMP_card16**) malloc(sizeof(*pstrs) * pad->string_count);
           if (!pstrs) {
              if (pintvals) free(pintvals);
              return;
           }
           for (i = 0; i < pad->string_count; i++) {
              pstrs[i] = (const IIIMP_card16*) pad->string_list[i].ptr;
           }
       } else {
           pstrs = NULL;
       }

       st = iiimcf_create_aux_setvalues_event((IIIMP_card16*) pad->aux_name,
                                          pad->aux_index,
                                          pad->integer_count,
                                          pintvals,
                                          pad->string_count,
                                          pstrs,
                                          &ev);
       if (st == IIIMF_STATUS_SUCCESS) {
           IMAuxSetValues(aux->ic, ev);
       }

       if (pintvals) free(pintvals);
       if (pstrs) free(pstrs);
    }

}

Here is the call graph for this function:

static Window service_client_window ( aux_t aux) [static]

Definition at line 1888 of file iiimpAux.c.

{
    /* ic is initialized to zero in CreateIC().
     * there is no need not to test
     * (aux->ic->ximp_icpart->value_mask & XIMP_CLIENT_WIN)
     */
    return aux->ic->core.client_window;
}
static unsigned char * service_compose ( const aux_data_t pad,
int *  size 
) [static]

Definition at line 1728 of file iiimpAux.c.

{
    AUXComposed *pac;

    pac = create_composed_from_aux_data(pad);
    return (unsigned char*) pac;
}

Here is the call graph for this function:

static int service_compose_size ( aux_data_type_t  type,
const unsigned char *  p 
) [static]

Definition at line 1741 of file iiimpAux.c.

{
    /* now this function is dummy... */
    return 0;
}
static void * service_data_get ( aux_t aux,
int  im_id 
) [static]

Definition at line 1613 of file iiimpAux.c.

{
    aux_im_data_t *  aux_im;

    for (aux_im = aux->im; NULL != aux_im; aux_im = aux_im->next) {
       if (im_id == aux_im->im_id) {
           return aux_im->data;
       }
    }

    return NULL;
}
static void service_data_set ( aux_t aux,
int  im_id,
void *  data 
) [static]

Definition at line 1594 of file iiimpAux.c.

{
    aux_im_data_t *  aux_im;

    for (aux_im = aux->im; NULL != aux_im; aux_im = aux_im->next) {
       if (im_id == aux_im->im_id) {
           aux_im->data = data;
       }
    }

    return;
}
static aux_data_t * service_decompose ( aux_data_type_t  type,
const unsigned char *  p 
) [static]

Definition at line 1803 of file iiimpAux.c.

{
    AUXComposed *pac = (AUXComposed*) p;

    if (pac->pad) {
       pac = create_composed_from_aux_data(pac->pad);
       if (!pac) return NULL;
       pac->pad->type = type;
#ifdef ENABLE_TRACE
       show_AC(pac->pad);
#endif
       return pac->pad;
    }

    if (pac->ev) {
       pac = create_composed_from_event(pac->aux, pac->ev);
       if (!pac) return NULL;
       pac->pad->type = type;
#ifdef ENABLE_TRACE
       show_AC(pac->pad);
#endif
       return pac->pad;
    }

    return NULL;
}

Here is the call graph for this function:

static void service_decompose_free ( aux_data_t pad) [static]

Definition at line 1835 of file iiimpAux.c.

{
    if (!pad) return;
    if (!pad->string_ptr) return;
    free(pad->string_ptr);
}
static Display * service_display ( aux_t aux) [static]

Definition at line 1631 of file iiimpAux.c.

{
    return aux->ic->core.im->core.display;
}
static Window service_focus_window ( aux_t aux) [static]

Definition at line 1901 of file iiimpAux.c.

{
    /* ic is initialized to zero in CreateIC().
     * there is no need not to test
     * XIMP_CHK_FOCUSWINMASK(aux->ic)
     */
    return aux->ic->core.focus_window;
}
static Bool service_get_conversion_mode ( aux_t aux) [static]

Definition at line 1994 of file iiimpAux.c.

{
  XIC xic = (XIC)aux->ic;
  XIMPreeditState preedit_state;

  XVaNestedList preedit_attr = XVaCreateNestedList(0,
                                             XNPreeditState, &preedit_state,
                                             0);
  XGetICValues((XIC)xic,
              XNPreeditAttributes, preedit_attr,
              0);
  XFree(preedit_attr);
  return preedit_state;
}
static int service_ic_id ( aux_t aux) [static]

Definition at line 1585 of file iiimpAux.c.

{
    return aux->im->ic_id;
}
static int service_im_id ( aux_t aux) [static]

Definition at line 1576 of file iiimpAux.c.

{
    return aux->im->im_id;
}
static size_t service_mb_utf16 ( const char **  inbuf,
size_t *  inbytesleft,
char **  outbuf,
size_t *  outbytesleft 
) [static]

Definition at line 1712 of file iiimpAux.c.

{
    int       r;

    r = IIimpConvertToUTF16((char *)(*inbuf), *inbytesleft,
                         outbuf, outbytesleft);
    return (size_t)r;
}

Here is the call graph for this function:

static XPoint * service_point ( aux_t aux,
XPoint *  point 
) [static]

Definition at line 1655 of file iiimpAux.c.

{
    if (IS_PREEDIT_POSITION(aux->ic)) {
       point->x = aux->ic->core.preedit_attr.spot_location.x;
       point->y = aux->ic->core.preedit_attr.spot_location.y;
    } else {
       point->x = -1;
       point->y = -1;
    }

    return point;
}

Here is the caller graph for this function:

static XPoint * service_point_caret ( aux_t aux,
XPoint *  point 
) [static]

Definition at line 1673 of file iiimpAux.c.

{
    point->x = -1;
    point->y = -1;

    if (!IS_PREEDIT_POSITION(aux->ic)) {
       return point;
    }

    PreeditCaretPlacementRelative(aux->ic, point);

    if ((-1 == point->x) && (-1 == point->y)) {
       return service_point(aux, point);
    }

    return point;
}

Here is the call graph for this function:

static int service_point_caret_screen ( aux_t aux,
XPoint *  point 
) [static]

Definition at line 1973 of file iiimpAux.c.

{
    point->x = -1;
    point->y = -1;

    if (IS_PREEDIT_POSITION(aux->ic)) {

       PreeditCaretPlacement(aux->ic, point);

       if ((-1 == point->x) && (-1 == point->y)) {
           return service_point_screen(aux, point);
       }
    }

    return XIC_GUI(aux->ic, screen_number);
}

Here is the call graph for this function:

static int service_point_screen ( aux_t aux,
XPoint *  point 
) [static]

Definition at line 1923 of file iiimpAux.c.

{
    Display * display;
    Window           window;
    Window           root_window;
    Window           child;
    int              screen_number;
    int              x;
    int              y;
    int              new_x;
    int              new_y;

    display = aux->ic->core.im->core.display;

    screen_number = XIC_GUI(aux->ic, screen_number);

    if (!IS_PREEDIT_POSITION(aux->ic)) {
       point->x = -1;
       point->y = -1;
       return screen_number;
    }

    if (XIMP_CHK_FOCUSWINMASK(aux->ic)) {
       window =  aux->ic->core.focus_window;
    } else if (aux->ic->ximp_icpart->value_mask & XIMP_CLIENT_WIN) {
       window = aux->ic->core.client_window;
    } else {
       return -1;
    }

    root_window = RootWindow(display, screen_number);

    x = aux->ic->core.preedit_attr.spot_location.x;
    y = aux->ic->core.preedit_attr.spot_location.y;

    XTranslateCoordinates(display, window, root_window,
                       x, y,
                       &new_x, &new_y, &child);

    point->x = new_x;
    point->y = new_y;

    return screen_number;
}

Here is the caller graph for this function:

static void service_register_X_filter ( Display *  display,
Window  window,
int  start_type,
int  end_type,
Bool(*)(Display *, Window, XEvent *, XPointer filter,
XPointer  client_data 
) [static]

Definition at line 1846 of file iiimpAux.c.

{
    _XRegisterFilterByType(display, window, start_type, end_type,
                        filter, client_data);

    return;
}

Here is the call graph for this function:

static int service_screen_number ( aux_t aux) [static]

Definition at line 1914 of file iiimpAux.c.

{
    return XIC_GUI(aux->ic, screen_number);
}
static Bool service_server ( aux_t aux) [static]

Definition at line 1875 of file iiimpAux.c.

{
    char *    client_type;

    client_type = XIM_IIIMP(aux->ic->core.im, client_type);

    return ((0 == strcmp(client_type, "IIIMX XIM Server")) ? True : False);
}
static void service_set_conversion_mode ( aux_t aux,
int  conversion_mode 
) [static]

Definition at line 2010 of file iiimpAux.c.

{
  XIC xic = (XIC)aux->ic;
  XIMPreeditState preedit_state;

  preedit_state = (conversion_mode == 1 ? XIMPreeditEnable : XIMPreeditDisable);
  XVaNestedList preedit_attr = XVaCreateNestedList(0,
                                             XNPreeditState, preedit_state,
                                             0);
  XSetICValues((XIC)xic,
              XNPreeditAttributes, preedit_attr,
              0);
  XFree(preedit_attr);
}
static void service_unregister_X_filter ( Display *  display,
Window  window,
Bool(*)(Display *, Window, XEvent *, XPointer filter,
XPointer  client_data 
) [static]

Definition at line 1863 of file iiimpAux.c.

{
    _XUnregisterFilter(display, window, filter, client_data);
}

Here is the call graph for this function:

static size_t service_utf16_mb ( const char **  inbuf,
size_t *  inbytesleft,
char **  outbuf,
size_t *  outbytesleft 
) [static]

Definition at line 1696 of file iiimpAux.c.

{
    int       r;

    r = IIimpConvertFromUTF16((char *)(*inbuf), *inbytesleft,
                           outbuf, outbytesleft);
    return (size_t)r;
}

Here is the call graph for this function:

static Window service_window ( aux_t aux) [static]

Definition at line 1640 of file iiimpAux.c.

{
    if (XIMP_CHK_FOCUSWINMASK(aux->ic)) {
       return aux->ic->core.focus_window;
    } else if (aux->ic->ximp_icpart->value_mask & XIMP_CLIENT_WIN) {
       return aux->ic->core.client_window;
    } else {
       return None;
    }
}

Variable Documentation

Definition at line 274 of file iiimpAux.c.

Definition at line 275 of file iiimpAux.c.

aux_service_t aux_service [static]