Back to index

im-sdk  12.3.91
Classes | Defines | Typedefs | Enumerations | Functions
commonIM.h File Reference
#include <X11/Xlibint.h>
#include "Xlcint.h"
#include "XlcPublic.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _XimCommon
struct  _SwitchFilter
struct  _XicCommon

Defines

#define _commonIM_h
#define __XLIBINT_HH
#define XIM_COMPOSE_KEYCODE   0
#define XIM_POPUP(im, field)   ((XimCommon)im)->popup_impart->field
#define XIM_IIIMP(im, field)   ((XimCommon)im)->iiimp_impart->field
#define XIM_COMPOSE(im, field)   ((XimCommon)im)->local_impart->field
#define XIM_GUI(im, field)   ((XimCommon)im)->gui_impart->field
#define XIM_IS_IIIMP(im)   ((XimCommon)im)->iiimp_impart
#define XIM_IS_COMPOSE(im)   ((XimCommon)im)->local_impart
#define XIM_IS_SWITCH(im)   (XIM_IS_IIIMP(im) && XIM_IS_COMPOSE(im))
#define XIC_POPUP(ic, field)   ((XicCommon)ic)->popup_icpart->field
#define XIC_IIIMP(ic, field)   ((XicCommon)ic)->iiimp_icpart->field
#define XIC_COMPOSE(ic, field)   ((XicCommon)ic)->local_icpart->field
#define XIC_GUI(ic, field)   ((XicCommon)ic)->gui_icpart->field

Typedefs

typedef struct _XimCommonXimCommon
typedef struct _XicCommonXicCommon
typedef struct _XIMXimpRecXIMXimp
typedef struct _XIMPopupRecXIMPopup
typedef struct _XIMGUIRec * XIMGUI
typedef struct _XIMDLRecXIMDL
typedef struct _XIMComposeIMRecXIMComposeIM
typedef struct _XIMIIimpIMRecXIMIIimpIM
typedef struct _XICXimpRecXICXimp
typedef struct _XICPopupRecXICPopup
typedef struct _XICGUIRecXICGUI
typedef struct _XICComposeIMRecXICComposeIM
typedef struct _XICIIimpIMRecXICIIIMP
typedef struct _XimCommon XimCommonRec
typedef SwitchMode(* SwitchKeyEventProc )(XicCommon, XEvent *)
typedef struct _SwitchFilter SwitchFilterEventRec
typedef struct _SwitchFilterSwitchFilterEventList
typedef struct _XicCommon XicCommonRec

Enumerations

enum  SwitchMode {
  Switch_ON = 1, Switch_OFF = 2, Switch_NOP = 3, Switch_ON = 1,
  Switch_OFF = 2, Switch_NOP = 3, Switch_ON = 1, Switch_OFF = 2,
  Switch_NOP = 3, Switch_ON = 1, Switch_OFF = 2, Switch_NOP = 3
}

Functions

Status CommonOpenIM (XIM xim, XLCd lcd, Display *dpy, XrmDatabase rdb, char *res_name, char *res_class)
Status CommonCreateIC (XIC xic, XIMArg *arg)
Status CommonDestroyIC (XIC xic)
Status CommonCloseIM (XIM xim)

Class Documentation

struct _XimCommon

Definition at line 81 of file commonIM.h.

Collaboration diagram for _XimCommon:
Class Members
XIMCoreRec core
XIMDL dl_impart
XIMGUI gui_impart
XIMIIimpIM iiimp_impart
Bool isUnicode
XIMComposeIM local_impart
XIMMethods methods
XlcConv mtow_conv
XIMPopup popup_impart
SwitcherInfo * switcher_info
XIMUnicodeCharacterSubsets * unicode_char_subsets
XlcConv wtom_conv
XIMXimp ximp_impart
struct _SwitchFilter

Definition at line 122 of file commonIM.h.

Collaboration diagram for _SwitchFilter:
Class Members
XICMethods ic_methods
SwitchKeyEventProc is_switch_key
XFilterEventProc key_filter
struct _SwitchFilter * next

Define Documentation

#define __XLIBINT_HH

Definition at line 50 of file commonIM.h.

#define _commonIM_h

Definition at line 47 of file commonIM.h.

#define XIC_COMPOSE (   ic,
  field 
)    ((XicCommon)ic)->local_icpart->field

Definition at line 136 of file commonIM.h.

#define XIC_GUI (   ic,
  field 
)    ((XicCommon)ic)->gui_icpart->field

Definition at line 137 of file commonIM.h.

#define XIC_IIIMP (   ic,
  field 
)    ((XicCommon)ic)->iiimp_icpart->field

Definition at line 135 of file commonIM.h.

#define XIC_POPUP (   ic,
  field 
)    ((XicCommon)ic)->popup_icpart->field

Definition at line 134 of file commonIM.h.

#define XIM_COMPOSE (   im,
  field 
)    ((XimCommon)im)->local_impart->field

Definition at line 95 of file commonIM.h.

#define XIM_COMPOSE_KEYCODE   0

Definition at line 56 of file commonIM.h.

#define XIM_GUI (   im,
  field 
)    ((XimCommon)im)->gui_impart->field

Definition at line 96 of file commonIM.h.

#define XIM_IIIMP (   im,
  field 
)    ((XimCommon)im)->iiimp_impart->field

Definition at line 94 of file commonIM.h.

#define XIM_IS_COMPOSE (   im)    ((XimCommon)im)->local_impart

Definition at line 99 of file commonIM.h.

#define XIM_IS_IIIMP (   im)    ((XimCommon)im)->iiimp_impart

Definition at line 98 of file commonIM.h.

#define XIM_IS_SWITCH (   im)    (XIM_IS_IIIMP(im) && XIM_IS_COMPOSE(im))

Definition at line 100 of file commonIM.h.

#define XIM_POPUP (   im,
  field 
)    ((XimCommon)im)->popup_impart->field

Definition at line 93 of file commonIM.h.


Typedef Documentation

typedef SwitchMode(* SwitchKeyEventProc)(XicCommon, XEvent *)

Definition at line 108 of file commonIM.h.

typedef struct _XicCommon* XicCommon

Definition at line 60 of file commonIM.h.

typedef struct _XicCommon XicCommonRec
typedef struct _XICComposeIMRec* XICComposeIM

Definition at line 72 of file commonIM.h.

typedef struct _XICGUIRec* XICGUI

Definition at line 71 of file commonIM.h.

typedef struct _XICIIimpIMRec* XICIIIMP

Definition at line 73 of file commonIM.h.

typedef struct _XICPopupRec* XICPopup

Definition at line 70 of file commonIM.h.

typedef struct _XICXimpRec* XICXimp

Definition at line 69 of file commonIM.h.

typedef struct _XimCommon* XimCommon

Definition at line 59 of file commonIM.h.

typedef struct _XimCommon XimCommonRec
typedef struct _XIMComposeIMRec* XIMComposeIM

Definition at line 66 of file commonIM.h.

typedef struct _XIMDLRec* XIMDL

Definition at line 65 of file commonIM.h.

typedef struct _XIMGUIRec* XIMGUI

Definition at line 64 of file commonIM.h.

typedef struct _XIMIIimpIMRec* XIMIIimpIM

Definition at line 67 of file commonIM.h.

typedef struct _XIMPopupRec* XIMPopup

Definition at line 63 of file commonIM.h.

typedef struct _XIMXimpRec* XIMXimp

Definition at line 62 of file commonIM.h.


Enumeration Type Documentation

enum SwitchMode
Enumerator:
Switch_ON 
Switch_OFF 
Switch_NOP 
Switch_ON 
Switch_OFF 
Switch_NOP 
Switch_ON 
Switch_OFF 
Switch_NOP 
Switch_ON 
Switch_OFF 
Switch_NOP 

Definition at line 102 of file commonIM.h.


Function Documentation

Status CommonCloseIM ( XIM  xim)

Definition at line 187 of file commonIM.c.

{
    XimCommon im = (XimCommon)xim;

#if 0
    XIC ic;
    for (ic = xim->core.ic_chain; ic; ic = ic->core.next)
       XDestroyIC(ic);
#endif

    if (im->mtow_conv)
       _XlcCloseConverter(im->mtow_conv);

    if (im->wtom_conv)
       _XlcCloseConverter(im->wtom_conv);

    if (im->ximp_impart) {
       Ximp_CloseIM(im->ximp_impart);
    }

    if (im->popup_impart) ClosePopupIM(im);

    if (im->dl_impart) {
       CloseDynamicObject(im->dl_impart);
    }
    if (im->core.res_name) Xfree(im->core.res_name);
    if (im->core.res_class) Xfree(im->core.res_class);

    return True;
}
Status CommonCreateIC ( XIC  xic,
XIMArg arg 
)

Definition at line 221 of file commonIM.c.

{
    XicCommon ic = (XicCommon)xic;

    /* ximp icpart */
    if (!ic->ximp_icpart) {
       ic->ximp_icpart = (XICXimp)Xmalloc(sizeof(XICXimpRec));
       if (!ic->ximp_icpart) goto Error;;
       memset(ic->ximp_icpart, 0, sizeof(XICXimpRec));
    }
    if (!ic->gui_icpart) {
       if (!(ic->gui_icpart = CreateGUI(ic, arg))) goto Error;
    }
    return True;
Error:
    CommonDestroyIC((XIC)ic);
    return False;
}
Status CommonDestroyIC ( XIC  xic)

Definition at line 244 of file commonIM.c.

{
    XicCommon ic = (XicCommon)xic;
    if (ic->ximp_icpart) Xfree(ic->ximp_icpart);
    ic->ximp_icpart = 0;
    if (ic->gui_icpart) DestroyGUI(ic); /* destroy gui */
    ic->gui_icpart = 0;
    return True;
}
Status CommonOpenIM ( XIM  xim,
XLCd  lcd,
Display *  dpy,
XrmDatabase  rdb,
char *  res_name,
char *  res_class 
)

Definition at line 127 of file commonIM.c.

{
    XimCommon im = (XimCommon)xim;

    TRACE_MESSAGE_INIT(NULL);

    /* Open mbs->wcs and wcs->mbs converters */
    if (!(im->wtom_conv = _XlcOpenConverter(lcd, XlcNWideChar,
                                       lcd, XlcNMultiByte))) {
       goto Set_Error;
    }
    if (!(im->mtow_conv = _XlcOpenConverter(lcd, XlcNMultiByte,
                                       lcd, XlcNWideChar))) {
       goto Set_Error;
    }
    im->core.lcd       = lcd;
    im->core.ic_chain  = (XIC)NULL;
    im->core.display   = dpy;
    im->core.rdb       = rdb;
    im->core.res_name  = NULL;
    im->core.res_class = NULL;
    im->core.im_name   = NULL;

    if ((res_name != NULL) && (*res_name != '\0')){
       im->core.res_name  = (char *)Xmalloc(strlen(res_name)+1);
       strcpy(im->core.res_name,res_name);
    }
    if ((res_class != NULL) && (*res_class != '\0')){
       im->core.res_class = (char *)Xmalloc(strlen(res_class)+1);
       strcpy(im->core.res_class,res_class);
    }

    /* set XIMP-dependent data */
    im->ximp_impart = (XIMXimp)Ximp_OpenIM(lcd);

    /* set dynamic loadble object data */
    im->dl_impart = OpenDynamicObject(lcd);

#if 1
    /* set error handler only once */
    if (appl_error_handler == (XErrorHandler)NULL)
       appl_error_handler = XSetErrorHandler(CommonIM_Error_Handler);
#endif

    return True;

Set_Error:
    if (im)
       CommonCloseIM((XIM)im);
    return False;
}