Back to index

im-sdk  12.3.91
Defines | Functions
switchIM.h File Reference
#include <X11/Xlib.h>
#include <X11/Xresource.h>
#include "Xlcint.h"
#include "commonIM.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define _switchIM_h

Functions

XIM _SwitchOpenIM (XLCd lcd, Display *dpy, XrmDatabase rdb, char *res_name, char *res_class)
void RegisterSwitchFilter (XicCommon ic, SwitchKeyEventProc is_switch_key, XFilterEventProc key_filter, XICMethods ic_methods)
void UnRegisterSwitchFilter (XicCommon ic, SwitchKeyEventProc is_switch_key, XFilterEventProc key_filter, XICMethods ic_methods)
void ResetSwitchFilter (XicCommon ic)
void SwitchUpdateStatus (XicCommon ic)

Define Documentation

#define _switchIM_h

Definition at line 48 of file switchIM.h.


Function Documentation

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

Definition at line 113 of file switchIM.c.

{
    XimCommon im = 0;
    char *disableMultiScriptIM = getenv("DISABLE_MULTI_SCRIPT_IM");

    if (disableMultiScriptIM &&
       !strcmp("true", disableMultiScriptIM)) return 0; /* hidden feature */

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

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

    im->methods = get_switch_im_methods();

    if (!im_switcher_active(im))
      if (!COMPOSE_OpenIM_SWITCH((XIM)im, lcd)) goto Error;

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

    return (XIM)im;

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

Here is the call graph for this function:

Here is the caller graph for this function:

void RegisterSwitchFilter ( XicCommon  ic,
SwitchKeyEventProc  is_switch_key,
XFilterEventProc  key_filter,
XICMethods  ic_methods 
)

Definition at line 164 of file switchIM.c.

{
    SwitchFilterEventRec *rec;

    rec = (SwitchFilterEventList)Xmalloc(sizeof(SwitchFilterEventRec));
    if (!rec)
       return;
    rec->is_switch_key = is_switch_key;
    rec->key_filter = key_filter;
    rec->ic_methods = ic_methods;
    rec->next = ic->switch_filters;
    ic->switch_filters = rec;
    return;
}

Here is the caller graph for this function:

Definition at line 206 of file switchIM.c.

{
    extern Bool Ximp_Local_KeyFilter(Display *, Window, XEvent*, XPointer);

    ic->active_filter = Ximp_Local_KeyFilter; /* default */
    ic->active_methods = get_local_ic_methods();
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 435 of file switchIM.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void UnRegisterSwitchFilter ( XicCommon  ic,
SwitchKeyEventProc  is_switch_key,
XFilterEventProc  key_filter,
XICMethods  ic_methods 
)

Definition at line 185 of file switchIM.c.

{
    SwitchFilterEventList *prev, fl;

    for (prev = &ic->switch_filters; (fl = *prev) != NULL; ) {
       if (fl->is_switch_key == is_switch_key &&
           fl->key_filter == key_filter && fl->ic_methods == ic_methods) {
           *prev = fl->next;
           Xfree((char *)fl);
       } else
           prev = &fl->next;
    }
    return;
}

Here is the caller graph for this function: