Back to index

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

Go to the source code of this file.

Classes

struct  _CacheRec
struct  _XICGUIRec
struct  XIMFilterRec

Defines

#define DEFAULT_FONT_NAME   "-*-*-medium-r-normal--*-*-*-*-c-*-*-*"
#define DEFAULT_FONT_NAME_CDE   "-dt-interface user-*-*-14-*-*"
#define MAX_STATUS_CHARNUM   20
#define MAX_PREEDIT_CHARNUM   20

Typedefs

typedef struct _CacheRec CacheRec
typedef void(* ChangeStatusProc )(XIC, StatusAttr, XPointer)
typedef void(* ChangePreeditProc )(XIC, PreeditAttr, XPointer)
typedef void(* ChangeLookupProc )(XIC, LookupAttr, XPointer)
typedef void(* RegisterForwardEventProc )(XIC, Bool(*)(XIC, XEvent *))
typedef struct _PreeditWinRecPreeditWin
typedef struct _StatusWinRecStatusWin
typedef struct _LookupWinRecLookupWin
typedef struct _XICGUIRec XICGUIRec
typedef struct XIMFilterRecXIMFilter

Enumerations

enum  StatusAttr {
  STATUS_CREATE = 0, STATUS_WIN = 1, STATUS_FG = 2, STATUS_BG = 3,
  STATUS_FONT = 4, STATUS_START = 5, STATUS_DRAW = 6, STATUS_DONE = 7,
  STATUS_DESTROY = 8, STATUS_HIDE = 9
}
enum  PreeditAttr {
  PREEDIT_CREATE = 0, PREEDIT_WIN = 1, PREEDIT_FG = 2, PREEDIT_BG = 3,
  PREEDIT_FONT = 4, PREEDIT_MOVE = 5, PREEDIT_START = 6, PREEDIT_DRAW = 7,
  PREEDIT_CARET = 8, PREEDIT_DONE = 9, PREEDIT_DESTROY = 10
}
enum  LookupAttr {
  LOOKUP_CREATE = 0, LOOKUP_START = 1, LOOKUP_DRAW = 2, LOOKUP_PROCESS = 3,
  LOOKUP_DONE = 4, LOOKUP_MOVE = 5, LOOKUP_DESTROY = 6, LOOKUP_SETFOCUS = 7
}

Functions

XICGUI CreateGUI (XicCommon ic, XIMArg *arg)
void DestroyGUI (XicCommon)
void SetScreenNumber (XicCommon ic)
void ChangeStatusArea (XIC, StatusAttr, XPointer)
void ChangeStatusNothing (XIC, StatusAttr, XPointer)
void ChangePreeditArea (XIC, PreeditAttr, XPointer)
void ChangePreeditPosition (XIC, PreeditAttr, XPointer)
void ChangePreeditNothing (XIC, PreeditAttr, XPointer)
void ChangeLookup (XIC, LookupAttr, XPointer)
Bool IMForwardEvent (XicCommon, XEvent *)
int CallPreeditStartCallback (XicCommon ic, XPointer p)
Bool CallPreeditDrawCallback (XicCommon ic, XIMPreeditDrawCallbackStruct *p, IMFeedbackList *feedback_list)
Bool CallPreeditCaretCallback (XicCommon ic, XPointer p)
Bool CallPreeditDoneCallback (XicCommon ic, XPointer p)
Bool CallStatusStartCallback (XicCommon ic, XPointer p)
Bool CallStatusDrawCallback (XicCommon ic, XIMStatusDrawCallbackStruct *call_data, IMFeedbackList *feedback_list)
Bool CallStatusDoneCallback (XicCommon ic, XPointer p)
Bool IsIMEnabled ()
Bool IsIMStatusEnabled ()
Bool IsIMStatusAttached ()
Bool IsIMLookupEnabled ()

Class Documentation

struct _CacheRec

Definition at line 55 of file guiIM.h.

Class Members
unsigned long background
XFontSet font_set
unsigned long foreground
int win_height
int win_width
int win_x
int win_y
struct _XICGUIRec

Definition at line 112 of file guiIM.h.

Collaboration diagram for _XICGUIRec:
Class Members
ChangeLookupProc change_lookup
ChangePreeditProc change_preedit
ChangeStatusProc change_status
void * dl_icpart
LookupWin lookup
PreeditWin preedit
int screen_number
StatusWin status

Define Documentation

#define DEFAULT_FONT_NAME   "-*-*-medium-r-normal--*-*-*-*-c-*-*-*"

Definition at line 123 of file guiIM.h.

#define DEFAULT_FONT_NAME_CDE   "-dt-interface user-*-*-14-*-*"

Definition at line 124 of file guiIM.h.

#define MAX_PREEDIT_CHARNUM   20

Definition at line 126 of file guiIM.h.

#define MAX_STATUS_CHARNUM   20

Definition at line 125 of file guiIM.h.


Typedef Documentation

typedef struct _CacheRec CacheRec
typedef void(* ChangeLookupProc)(XIC, LookupAttr, XPointer)

Definition at line 105 of file guiIM.h.

typedef void(* ChangePreeditProc)(XIC, PreeditAttr, XPointer)

Definition at line 104 of file guiIM.h.

typedef void(* ChangeStatusProc)(XIC, StatusAttr, XPointer)

Definition at line 103 of file guiIM.h.

typedef struct _LookupWinRec* LookupWin

Definition at line 110 of file guiIM.h.

typedef struct _PreeditWinRec* PreeditWin

Definition at line 108 of file guiIM.h.

typedef void(* RegisterForwardEventProc)(XIC, Bool(*)(XIC, XEvent *))

Definition at line 106 of file guiIM.h.

typedef struct _StatusWinRec* StatusWin

Definition at line 109 of file guiIM.h.

typedef struct _XICGUIRec XICGUIRec
typedef struct XIMFilterRec * XIMFilter

Enumeration Type Documentation

enum LookupAttr
Enumerator:
LOOKUP_CREATE 
LOOKUP_START 
LOOKUP_DRAW 
LOOKUP_PROCESS 
LOOKUP_DONE 
LOOKUP_MOVE 
LOOKUP_DESTROY 
LOOKUP_SETFOCUS 

Definition at line 92 of file guiIM.h.

             {
  LOOKUP_CREATE = 0,        /* allocate IMlookup data */
  LOOKUP_START = 1,         /* start IMlookup */
  LOOKUP_DRAW = 2,          /* draw IMlookup*/
  LOOKUP_PROCESS = 3,              /* process IMlookup */
  LOOKUP_DONE = 4,          /* done IMlookup */
  LOOKUP_MOVE = 5,          /* move IMlookup window */
  LOOKUP_DESTROY = 6,              /* destroy IMlookup data */
  LOOKUP_SETFOCUS = 7              /* setfocus for lookup window */
} LookupAttr;
Enumerator:
PREEDIT_CREATE 
PREEDIT_WIN 
PREEDIT_FG 
PREEDIT_BG 
PREEDIT_FONT 
PREEDIT_MOVE 
PREEDIT_START 
PREEDIT_DRAW 
PREEDIT_CARET 
PREEDIT_DONE 
PREEDIT_DESTROY 

Definition at line 78 of file guiIM.h.

             {
  PREEDIT_CREATE = 0,              /* allocate IMpreedit data */
  PREEDIT_WIN = 1,          /* create IMPreedit window */
  PREEDIT_FG = 2,           /* set IMpreedit foreground color */
  PREEDIT_BG = 3,           /* set IMpreedit background color */
  PREEDIT_FONT = 4,         /* set IMpreedit fontset */
  PREEDIT_MOVE = 5,         /* move IMpreedit window */
  PREEDIT_START = 6,        /* start IMpreedit */
  PREEDIT_DRAW = 7,         /* draw IMpreedit */
  PREEDIT_CARET = 8,        /* set caret of IMpreedit */
  PREEDIT_DONE= 9,          /* done IMpreedit */
  PREEDIT_DESTROY = 10             /* destroy IMpreedit data */
} PreeditAttr;
enum StatusAttr
Enumerator:
STATUS_CREATE 
STATUS_WIN 
STATUS_FG 
STATUS_BG 
STATUS_FONT 
STATUS_START 
STATUS_DRAW 
STATUS_DONE 
STATUS_DESTROY 
STATUS_HIDE 

Definition at line 65 of file guiIM.h.

             {
  STATUS_CREATE = 0,        /* allocate IMstatus data */
  STATUS_WIN = 1,           /* create IMstatus window */
  STATUS_FG = 2,            /* set IMstatus foreground color */
  STATUS_BG = 3,            /* set IMstatus background color */
  STATUS_FONT = 4,          /* set IMstatus fontset */
  STATUS_START = 5,         /* start IMstatus */
  STATUS_DRAW = 6,          /* draw IMstatus */
  STATUS_DONE = 7,          /* done IMstatus */
  STATUS_DESTROY = 8,              /* destroy IMstatus data */
  STATUS_HIDE = 9           /* hide status window */
} StatusAttr;

Function Documentation

Definition at line 84 of file guiIMClbk.c.

                                                   {
  XIMCallback *cb;
  XIMPreeditCaretCallbackStruct *call_data = (XIMPreeditCaretCallbackStruct*)p;
  cb = &ic->core.preedit_attr.caret_callback;
  if (cb->callback &&
      ic->core.input_style & XIMPreeditCallbacks) {
    (*cb->callback)((XIC)ic, cb->client_data, (XPointer)call_data);
  } else {
    XIC_GUI(ic, change_preedit)((XIC)ic, PREEDIT_CARET, (XPointer)p);
  }
  return True;
}

Definition at line 98 of file guiIMClbk.c.

                                                  {
  XIMCallback *cb;
  cb = &ic->core.preedit_attr.done_callback;
  if (cb->callback &&
      ic->core.input_style & XIMPreeditCallbacks) {
    (*cb->callback)((XIC)ic, cb->client_data, NULL);
    ic->ximp_icpart->cbstatus &= ~XIMPCBPREEDITACTIVE ;
  } else {
    XIC_GUI(ic, change_preedit)((XIC)ic, PREEDIT_DONE, NULL);
  }
  return True;
}

Here is the caller graph for this function:

Bool CallPreeditDrawCallback ( XicCommon  ic,
XIMPreeditDrawCallbackStruct *  p,
IMFeedbackList feedback_list 
)

Definition at line 66 of file guiIMClbk.c.

                                                    {
  XIMCallback *cb;
  cb = &ic->core.preedit_attr.draw_callback;
  if (cb->callback &&
      ic->core.input_style & XIMPreeditCallbacks) {
    (*cb->callback)((XIC)ic, cb->client_data, (XPointer)p);
  } else {
    XIMDrawTextStruct preedit_draw;
    preedit_draw.call_data = (XPointer)p;
    preedit_draw.feedback_list = feedback_list;
    XIC_GUI(ic, change_preedit)((XIC)ic, PREEDIT_DRAW,
                            (XPointer)&preedit_draw);
  }
  return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 50 of file guiIMClbk.c.

                                                   {
  XIMCallback *cb;
  int max_len = -1;

  cb = &ic->core.preedit_attr.start_callback;
  if (cb->callback &&
      ic->core.input_style & XIMPreeditCallbacks) {
    max_len = (*(int(*)())cb->callback)(ic, cb->client_data, NULL);
    ic->ximp_icpart->cbstatus |= XIMPCBPREEDITACTIVE ;
  } else {
    XIC_GUI(ic, change_preedit)((XIC)ic, PREEDIT_START, NULL);
  }
  return max_len;
}

Here is the caller graph for this function:

Definition at line 196 of file guiIMClbk.c.

                                                 {
  XIMCallback *cb;
  cb = &ic->core.status_attr.done_callback;
  if (cb->callback && ic->core.input_style & XIMStatusCallbacks &&
      IsIMStatusAttached()) {
    (*cb->callback)((XIC)ic, cb->client_data, NULL);
    ic->ximp_icpart->cbstatus &= ~XIMPCBSTATUSACTIVE ;
  } else {
    XIC_GUI(ic, change_status)((XIC)ic, STATUS_DONE, NULL);
  }
  return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool CallStatusDrawCallback ( XicCommon  ic,
XIMStatusDrawCallbackStruct *  call_data,
IMFeedbackList feedback_list 
)

Definition at line 150 of file guiIMClbk.c.

                                                    {
  XIMCallback *cb;
  cb = &ic->core.status_attr.draw_callback;

  if (!IsIMStatusAttached()) {
    if (call_data->type == XIMTextType &&
       !call_data->data.text->encoding_is_wchar) {
      char *utf8 = locale_to_utf8 (call_data->data.text->string.multi_byte);
      ic_switcher_set_status_text (ic, utf8);
      free (utf8);
    } else {
      ic_switcher_set_status_text (ic, " ");
    }
  }
  if (cb->callback && ic->core.input_style & XIMStatusCallbacks) {
    if (!IsIMStatusAttached())
         call_data->data.text = NULL;
    (*cb->callback)((XIC)ic, cb->client_data, (XPointer)call_data);
  } else {
    XIMDrawTextStruct status_draw;

    if (XIM_IS_SWITCH(ic->core.im)) {
      /*
       fix for 4276042:
       status strings is not [English/European] when iiim IM is off
      */
      if (!IsConversionMode(ic)) {
       Ximp_Local_Status_Reset(ic);
       return True;
      }
    }
    status_draw.call_data = (XPointer)call_data->data.text;
    status_draw.feedback_list = feedback_list;
    XIC_GUI(ic, change_status)((XIC)ic, STATUS_DRAW,
                            (XPointer)&status_draw);
  }

  /* move preedit window */
  if (ic->core.input_style & XIMPreeditNothing) {
    XIC_GUI(ic, change_preedit)((XIC)ic, PREEDIT_WIN, NULL);
  }
  return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 112 of file guiIMClbk.c.

                                                  {
  XIMCallback *cb;
  cb = &ic->core.status_attr.start_callback;
  if (cb->callback && ic->core.input_style & XIMStatusCallbacks &&
      IsIMStatusAttached()) {
    (*cb->callback)((XIC)ic, cb->client_data, NULL);
    ic->ximp_icpart->cbstatus |= XIMPCBSTATUSACTIVE ;
  } else {
    XIC_GUI(ic, change_status)((XIC)ic, STATUS_START, (XPointer)p);
  }
  return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void ChangeLookup ( XIC  ,
LookupAttr  ,
XPointer   
)

Definition at line 1288 of file guiIMLookup.c.

                                                             {
  XicCommon ic = (XicCommon)xic;
  if (reason > LOOKUP_SETFOCUS) return;
  lookup_methods[reason](ic, call_data);
  return;
}

Here is the caller graph for this function:

void ChangePreeditArea ( XIC  ,
PreeditAttr  ,
XPointer   
)

Definition at line 245 of file guiIMPreArea.c.

                                                                   {
  XicCommon ic = (XicCommon)xic;
  if (reason > PREEDIT_DESTROY) return;
  preedit_area_methods[reason](ic, call_data);
  return;
}

Here is the caller graph for this function:

void ChangePreeditNothing ( XIC  ,
PreeditAttr  ,
XPointer   
)

Definition at line 303 of file guiIMPreNothing.c.

                                                                      {
  XicCommon ic = (XicCommon)xic;
  if (reason > PREEDIT_DESTROY) return;
  preedit_nothing_methods[reason](ic, call_data);
  return;
}

Here is the caller graph for this function:

void ChangePreeditPosition ( XIC  ,
PreeditAttr  ,
XPointer   
)

Definition at line 846 of file guiIMPrePos.c.

                                                                       {
  XicCommon ic = (XicCommon)xic;
  if (reason > PREEDIT_DESTROY) return;
  preedit_pos_methods[reason](ic, call_data);
  return;
}

Here is the caller graph for this function:

void ChangeStatusArea ( XIC  ,
StatusAttr  ,
XPointer   
)

Definition at line 158 of file guiIMStsArea.c.

                                                                 {
  XicCommon ic = (XicCommon)xic;
  if (reason > STATUS_HIDE) return;
  status_area_methods[reason](ic, call_data);
  return;
}

Here is the caller graph for this function:

void ChangeStatusNothing ( XIC  ,
StatusAttr  ,
XPointer   
)

Definition at line 275 of file guiIMStsNothing.c.

                                                                    {
  XicCommon ic = (XicCommon)xic;

#ifdef linux
  if(getenv("HTT_DISABLE_STATUS_WINDOW")){
    return;
  }
#endif

  if (reason == STATUS_DESTROY) {
    Focussed_IC=(XicCommon)NULL;
    Focussed_STATUS = (StatusWin)NULL;
  }

  if (reason > STATUS_HIDE) return;

  status_nothing_methods[reason](ic, call_data);
  return;
}

Here is the caller graph for this function:

XICGUI CreateGUI ( XicCommon  ic,
XIMArg arg 
)

Definition at line 129 of file guiIM.c.

                                     {
  XICGUIRec* gui_icpart = 0;
  XimCommon im = (XimCommon)ic->core.im;
  Display *display = im->core.display;

  gui_icpart = (XICGUIRec*)Xmalloc(sizeof(XICGUIRec));
  if (!gui_icpart) return 0;

  memset(gui_icpart, 0, sizeof(XICGUIRec));
  ic->gui_icpart = gui_icpart;

  XIC_GUI(ic, change_status) = ChangeStatus; /* default */
  XIC_GUI(ic, change_preedit) = ChangePreedit; /* default */

  SetScreenNumber(ic);

  if (im_settings_atom == None)
    im_settings_atom = XInternAtom (display, _IM_SETTINGS, False);

  _XRegisterFilterByType (display,
                       RootWindow(display, XIC_GUI(ic, screen_number)),
                       PropertyNotify, PropertyNotify,
                       GetIMSettingsPropertyFilter, (XPointer)ic);

  /* register a handler for dl_impart to return key events */
  if (im->dl_impart &&
      im->dl_impart->register_forwardevent)
    im->dl_impart->register_forwardevent((XIC)ic, IMForwardEvent);

  /* Need to set inputstyle to the ic first */
  if (!SetInputStyle(ic, arg)) {
    Xfree(gui_icpart);
    return 0;
  }
  ic->gui_icpart = gui_icpart;
  return gui_icpart;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void DestroyGUI ( XicCommon  )

Definition at line 180 of file guiIM.c.

                         {
  if (ic->gui_icpart) Xfree(ic->gui_icpart);
  ic->gui_icpart = 0;
}

Here is the caller graph for this function:

Bool IMForwardEvent ( XicCommon  ,
XEvent *   
)

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;
}

Definition at line 238 of file guiIM.c.

Here is the caller graph for this function:

Definition at line 261 of file guiIM.c.

Here is the caller graph for this function:

Definition at line 253 of file guiIM.c.

Here is the caller graph for this function:

void SetScreenNumber ( XicCommon  ic)

Definition at line 186 of file guiIM.c.

                              {
  XWindowAttributes attr;
  if (None != ic->core.focus_window) {
    if (XGetWindowAttributes(ic->core.im->core.display,
                          ic->core.focus_window, &attr)) {
      XIC_GUI(ic, screen_number) = XScreenNumberOfScreen(attr.screen);
    } else {
      XIC_GUI(ic, screen_number) = DefaultScreen(ic->core.im->core.display);
    }
  } else {
    XIC_GUI(ic, screen_number) = DefaultScreen(ic->core.im->core.display);
  }
}

Here is the caller graph for this function: