62 |
static XIM IM = NULL; |
static XIM IM = NULL; |
63 |
static XIC IC = NULL; |
static XIC IC = NULL; |
64 |
|
|
65 |
|
/* Compose support */ |
66 |
|
BOOL enable_compose = False; |
67 |
|
|
68 |
#define TRANSLATE(col) ( owncolmap ? col : translate_colour(colmap[col]) ) |
#define TRANSLATE(col) ( owncolmap ? col : translate_colour(colmap[col]) ) |
69 |
#define SET_FOREGROUND(col) XSetForeground(display, gc, TRANSLATE(col)); |
#define SET_FOREGROUND(col) XSetForeground(display, gc, TRANSLATE(col)); |
70 |
#define SET_BACKGROUND(col) XSetBackground(display, gc, TRANSLATE(col)); |
#define SET_BACKGROUND(col) XSetBackground(display, gc, TRANSLATE(col)); |
188 |
static unsigned long |
static unsigned long |
189 |
init_inputmethod(void) |
init_inputmethod(void) |
190 |
{ |
{ |
191 |
unsigned long filtered_events; |
unsigned long filtered_events = 0; |
192 |
|
|
193 |
IM = XOpenIM(display, NULL, NULL, NULL); |
IM = XOpenIM(display, NULL, NULL, NULL); |
194 |
if (IM == NULL) |
if (IM == NULL) |
251 |
Screen *screen; |
Screen *screen; |
252 |
uint16 test; |
uint16 test; |
253 |
int i; |
int i; |
|
unsigned long filtered_events; |
|
254 |
|
|
255 |
display = XOpenDisplay(NULL); |
display = XOpenDisplay(NULL); |
256 |
|
|
354 |
if (ownbackstore) |
if (ownbackstore) |
355 |
input_mask |= ExposureMask; |
input_mask |= ExposureMask; |
356 |
|
|
357 |
filtered_events = init_inputmethod(); |
if (enable_compose) |
358 |
|
input_mask |= init_inputmethod(); |
359 |
|
|
360 |
XSelectInput(display, wnd, input_mask | filtered_events); |
XSelectInput(display, wnd, input_mask); |
361 |
|
|
362 |
gc = XCreateGC(display, wnd, 0, NULL); |
gc = XCreateGC(display, wnd, 0, NULL); |
363 |
|
|
408 |
|
|
409 |
while (XCheckMaskEvent(display, ~0, &xevent)) |
while (XCheckMaskEvent(display, ~0, &xevent)) |
410 |
{ |
{ |
411 |
if (XFilterEvent(&xevent, None) == True) |
if (enable_compose && (XFilterEvent(&xevent, None) == True)) |
412 |
{ |
{ |
413 |
DEBUG_KBD("Filtering event\n"); |
DEBUG_KBD("Filtering event\n"); |
414 |
continue; |
continue; |
459 |
|
|
460 |
tr = xkeymap_translate_key(keysym, |
tr = xkeymap_translate_key(keysym, |
461 |
xevent.xkey. |
xevent.xkey. |
462 |
keycode); |
keycode, |
463 |
|
xevent.xkey.state); |
464 |
|
|
465 |
ensure_remote_modifiers(ev_time, tr); |
ensure_remote_modifiers(ev_time, tr); |
466 |
|
|
467 |
if (tr.scancode == 0) |
if (tr.scancode == 0) |
484 |
|
|
485 |
tr = xkeymap_translate_key(keysym, |
tr = xkeymap_translate_key(keysym, |
486 |
xevent.xkey. |
xevent.xkey. |
487 |
keycode); |
keycode, |
488 |
|
xevent.xkey.state); |
489 |
|
|
490 |
if (tr.scancode == 0) |
if (tr.scancode == 0) |
491 |
break; |
break; |
589 |
|
|
590 |
tdata = (owncolmap ? data : translate_image(width, height, data)); |
tdata = (owncolmap ? data : translate_image(width, height, data)); |
591 |
bitmap = XCreatePixmap(display, wnd, width, height, depth); |
bitmap = XCreatePixmap(display, wnd, width, height, depth); |
592 |
image = XCreateImage(display, visual, depth, ZPixmap, 0, tdata, width, |
image = XCreateImage(display, visual, depth, ZPixmap, 0, (char *)tdata, |
593 |
height, 8, 0); |
width, height, 8, 0); |
594 |
|
|
595 |
XPutImage(display, bitmap, gc, image, 0, 0, 0, 0, width, height); |
XPutImage(display, bitmap, gc, image, 0, 0, 0, 0, width, height); |
596 |
|
|
608 |
uint8 *tdata; |
uint8 *tdata; |
609 |
|
|
610 |
tdata = (owncolmap ? data : translate_image(width, height, data)); |
tdata = (owncolmap ? data : translate_image(width, height, data)); |
611 |
image = XCreateImage(display, visual, depth, ZPixmap, 0, tdata, width, |
image = XCreateImage(display, visual, depth, ZPixmap, 0, (char *)tdata, |
612 |
height, 8, 0); |
width, height, 8, 0); |
613 |
|
|
614 |
if (ownbackstore) |
if (ownbackstore) |
615 |
{ |
{ |
645 |
bitmap = XCreatePixmap(display, wnd, width, height, 1); |
bitmap = XCreatePixmap(display, wnd, width, height, 1); |
646 |
gc = XCreateGC(display, bitmap, 0, NULL); |
gc = XCreateGC(display, bitmap, 0, NULL); |
647 |
|
|
648 |
image = XCreateImage(display, visual, 1, ZPixmap, 0, data, width, |
image = XCreateImage(display, visual, 1, ZPixmap, 0, (char *)data, |
649 |
height, 8, scanline); |
width, height, 8, scanline); |
650 |
image->byte_order = MSBFirst; |
image->byte_order = MSBFirst; |
651 |
image->bitmap_bit_order = MSBFirst; |
image->bitmap_bit_order = MSBFirst; |
652 |
XInitImage(image); |
XInitImage(image); |
1016 |
if ((xyoffset & 0x80))\ |
if ((xyoffset & 0x80))\ |
1017 |
{\ |
{\ |
1018 |
if (flags & TEXT2_VERTICAL) \ |
if (flags & TEXT2_VERTICAL) \ |
1019 |
y += ttext[++idx] | (ttext[++idx] << 8);\ |
y += ttext[idx+1] | (ttext[idx+2] << 8);\ |
1020 |
else\ |
else\ |
1021 |
x += ttext[++idx] | (ttext[++idx] << 8);\ |
x += ttext[idx+1] | (ttext[idx+2] << 8);\ |
1022 |
|
idx += 2;\ |
1023 |
}\ |
}\ |
1024 |
else\ |
else\ |
1025 |
{\ |
{\ |
1157 |
if (data == NULL) |
if (data == NULL) |
1158 |
return; |
return; |
1159 |
|
|
1160 |
image = XCreateImage(display, visual, depth, ZPixmap, 0, data, cx, cy, |
image = XCreateImage(display, visual, depth, ZPixmap, 0, (char *)data, |
1161 |
BitmapPad(display), cx * bpp / 8); |
cx, cy, BitmapPad(display), cx * bpp / 8); |
1162 |
|
|
1163 |
if (ownbackstore) |
if (ownbackstore) |
1164 |
{ |
{ |