changed indentation to use spaces only
[wmaker-crm.git] / WINGs / winputmethod.c
blobb81490948d2b0874761cbb7a82186f75ee3226ce
3 #include <X11/Xlib.h>
5 #include "WINGsP.h"
9 typedef struct W_IMContext {
10 XIM xim;
12 struct W_ICContext *icList;
13 } WMIMContext;
16 typedef struct W_ICContext {
17 struct W_ICContext *next;
18 struct W_ICContext *prev;
20 XIC xic;
21 } WMICContext;
25 Bool
26 W_InitIMStuff(WMScreen *scr)
28 WMIMContext *ctx;
30 ctx = scr->imctx = wmalloc(sizeof(WMIMContext));
32 ctx->xim = XOpenIM(scr->display, NULL, NULL, NULL);
33 if (ctx->xim == NULL) {
34 wwarning("could not open IM");
35 return False;
38 //XGetIMValues(scr->display,
42 void
43 W_CloseIMStuff(WMScreen *scr)
45 if (!scr->imctx)
46 return;
48 if (scr->imctx->xim)
49 XCloseIM(scr->imctx->xim);
50 wfree(scr->imctx);
51 scr->imctx = NULL;
56 WMICContext*
57 W_CreateIC(WMView *view)
59 WMScreen *scr = W_VIEW_SCREEN(view);
60 WMICContext *ctx;
62 ctx->prev = NULL;
63 ctx->next = scr->imctx->icList;
64 if (scr->imctx->icList)
65 scr->imctx->icList->prev = ctx;
66 //scr->imctx = ctx;
70 void
71 W_DestroyIC(WMICContext *ctx)
73 XDestroyIC(ctx->xic);
79 int
80 W_LookupString(WMView *view, XKeyEvent *event,
81 char buffer, int bufsize, KeySym ksym)