~profzoom/ubuntu/quantal/wmaker/bug-1079925

« back to all changes in this revision

Viewing changes to WINGs/winputmethod.c

  • Committer: Bazaar Package Importer
  • Author(s): Marcelo E. Magallon
  • Date: 2004-11-10 14:05:30 UTC
  • Revision ID: james.westby@ubuntu.com-20041110140530-qpd66b5lm38x7apk
Tags: upstream-0.91.0
ImportĀ upstreamĀ versionĀ 0.91.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
 
 
3
#include <X11/Xlib.h>
 
4
 
 
5
#include "WINGsP.h"
 
6
 
 
7
 
 
8
 
 
9
typedef struct W_IMContext {
 
10
    XIM xim;
 
11
 
 
12
    struct W_ICContext *icList;
 
13
} WMIMContext;
 
14
 
 
15
 
 
16
typedef struct W_ICContext {
 
17
    struct W_ICContext *next;
 
18
    struct W_ICContext *prev;
 
19
 
 
20
    XIC xic;
 
21
} WMICContext;
 
22
 
 
23
 
 
24
 
 
25
Bool
 
26
W_InitIMStuff(WMScreen *scr)
 
27
{
 
28
    WMIMContext *ctx;
 
29
 
 
30
    ctx = scr->imctx = wmalloc(sizeof(WMIMContext));
 
31
 
 
32
    ctx->xim = XOpenIM(scr->display, NULL, NULL, NULL);
 
33
    if (ctx->xim == NULL) {
 
34
        wwarning("could not open IM");
 
35
        return False;
 
36
    }
 
37
 
 
38
}
 
39
 
 
40
 
 
41
void
 
42
W_CloseIMStuff(WMScreen *scr)
 
43
{
 
44
    if (!scr->imctx)
 
45
        return;
 
46
 
 
47
    if (scr->imctx->xim)
 
48
        XCloseIM(scr->imctx->xim);
 
49
    wfree(scr->imctx);
 
50
    scr->imctx = NULL;
 
51
}
 
52
 
 
53
 
 
54
 
 
55
WMICContext*
 
56
W_CreateIC(WMView *view)
 
57
{
 
58
    WMScreen *scr = W_VIEW_SCREEN(view);
 
59
    WMICContext *ctx;
 
60
 
 
61
    ctx->prev = NULL;
 
62
    ctx->next = scr->imctx->icList;
 
63
    if (scr->imctx->icList)
 
64
        scr->imctx->icList->prev = ctx;
 
65
 
 
66
 
 
67
}
 
68
 
 
69
 
 
70
void
 
71
W_DestroyIC(WMICContext *ctx)
 
72
{
 
73
    XDestroyIC(ctx->xic);
 
74
 
 
75
 
 
76
}
 
77
 
 
78
 
 
79
int
 
80
W_LookupString(WMView *view, XKeyEvent *event,
 
81
               char buffer, int bufsize, KeySym ksym)
 
82
{
 
83
 
 
84
}
 
85
 
 
86
 
 
87