25 |
#define XK_MISCELLANY |
#define XK_MISCELLANY |
26 |
#include <X11/keysymdef.h> |
#include <X11/keysymdef.h> |
27 |
#include "rdesktop.h" |
#include "rdesktop.h" |
28 |
|
#include "scancodes.h" |
29 |
|
|
30 |
extern int width; |
extern int width; |
31 |
extern int height; |
extern int height; |
32 |
extern BOOL sendmotion; |
extern BOOL sendmotion; |
33 |
extern BOOL fullscreen; |
extern BOOL fullscreen; |
34 |
|
extern BOOL grab_keyboard; |
35 |
|
|
36 |
Display *display = NULL; |
Display *display = NULL; |
37 |
static int x_socket; |
static int x_socket; |
349 |
|
|
350 |
input_mask = |
input_mask = |
351 |
KeyPressMask | KeyReleaseMask | ButtonPressMask | |
KeyPressMask | KeyReleaseMask | ButtonPressMask | |
352 |
ButtonReleaseMask | EnterWindowMask | LeaveWindowMask; |
ButtonReleaseMask; |
353 |
|
if (grab_keyboard) |
354 |
|
input_mask |= EnterWindowMask | LeaveWindowMask; |
355 |
if (sendmotion) |
if (sendmotion) |
356 |
input_mask |= PointerMotionMask; |
input_mask |= PointerMotionMask; |
357 |
|
|
522 |
xevent.xmotion.y); |
xevent.xmotion.y); |
523 |
break; |
break; |
524 |
|
|
525 |
|
case FocusIn: |
526 |
|
/* fall through */ |
527 |
case EnterNotify: |
case EnterNotify: |
528 |
XGrabKeyboard(display, wnd, True, |
if (grab_keyboard) |
529 |
GrabModeAsync, GrabModeAsync, |
XGrabKeyboard(display, wnd, True, |
530 |
CurrentTime); |
GrabModeAsync, |
531 |
|
GrabModeAsync, |
532 |
|
CurrentTime); |
533 |
break; |
break; |
534 |
|
|
535 |
|
case FocusOut: |
536 |
|
/* reset keys */ |
537 |
|
rdp_send_input(ev_time, RDP_INPUT_SCANCODE, |
538 |
|
KBD_FLAG_DOWN | KBD_FLAG_UP, |
539 |
|
SCANCODE_CHAR_LCTRL, 0); |
540 |
|
rdp_send_input(ev_time, RDP_INPUT_SCANCODE, |
541 |
|
KBD_FLAG_DOWN | KBD_FLAG_UP, |
542 |
|
SCANCODE_CHAR_LALT, 0); |
543 |
|
/* fall through */ |
544 |
case LeaveNotify: |
case LeaveNotify: |
545 |
XUngrabKeyboard(display, CurrentTime); |
if (grab_keyboard) |
546 |
|
XUngrabKeyboard(display, CurrentTime); |
547 |
break; |
break; |
548 |
|
|
549 |
case Expose: |
case Expose: |
607 |
|
|
608 |
tdata = (owncolmap ? data : translate_image(width, height, data)); |
tdata = (owncolmap ? data : translate_image(width, height, data)); |
609 |
bitmap = XCreatePixmap(display, wnd, width, height, depth); |
bitmap = XCreatePixmap(display, wnd, width, height, depth); |
610 |
image = XCreateImage(display, visual, depth, ZPixmap, 0, tdata, width, |
image = XCreateImage(display, visual, depth, ZPixmap, 0, |
611 |
height, 8, 0); |
(char *) tdata, width, height, 8, 0); |
612 |
|
|
613 |
XPutImage(display, bitmap, gc, image, 0, 0, 0, 0, width, height); |
XPutImage(display, bitmap, gc, image, 0, 0, 0, 0, width, height); |
614 |
|
|
626 |
uint8 *tdata; |
uint8 *tdata; |
627 |
|
|
628 |
tdata = (owncolmap ? data : translate_image(width, height, data)); |
tdata = (owncolmap ? data : translate_image(width, height, data)); |
629 |
image = XCreateImage(display, visual, depth, ZPixmap, 0, tdata, width, |
image = XCreateImage(display, visual, depth, ZPixmap, 0, |
630 |
height, 8, 0); |
(char *) tdata, width, height, 8, 0); |
631 |
|
|
632 |
if (ownbackstore) |
if (ownbackstore) |
633 |
{ |
{ |
663 |
bitmap = XCreatePixmap(display, wnd, width, height, 1); |
bitmap = XCreatePixmap(display, wnd, width, height, 1); |
664 |
gc = XCreateGC(display, bitmap, 0, NULL); |
gc = XCreateGC(display, bitmap, 0, NULL); |
665 |
|
|
666 |
image = XCreateImage(display, visual, 1, ZPixmap, 0, data, width, |
image = XCreateImage(display, visual, 1, ZPixmap, 0, (char *) data, |
667 |
height, 8, scanline); |
width, height, 8, scanline); |
668 |
image->byte_order = MSBFirst; |
image->byte_order = MSBFirst; |
669 |
image->bitmap_bit_order = MSBFirst; |
image->bitmap_bit_order = MSBFirst; |
670 |
XInitImage(image); |
XInitImage(image); |
1034 |
if ((xyoffset & 0x80))\ |
if ((xyoffset & 0x80))\ |
1035 |
{\ |
{\ |
1036 |
if (flags & TEXT2_VERTICAL) \ |
if (flags & TEXT2_VERTICAL) \ |
1037 |
y += ttext[++idx] | (ttext[++idx] << 8);\ |
y += ttext[idx+1] | (ttext[idx+2] << 8);\ |
1038 |
else\ |
else\ |
1039 |
x += ttext[++idx] | (ttext[++idx] << 8);\ |
x += ttext[idx+1] | (ttext[idx+2] << 8);\ |
1040 |
|
idx += 2;\ |
1041 |
}\ |
}\ |
1042 |
else\ |
else\ |
1043 |
{\ |
{\ |
1175 |
if (data == NULL) |
if (data == NULL) |
1176 |
return; |
return; |
1177 |
|
|
1178 |
image = XCreateImage(display, visual, depth, ZPixmap, 0, data, cx, cy, |
image = XCreateImage(display, visual, depth, ZPixmap, 0, |
1179 |
BitmapPad(display), cx * bpp / 8); |
(char *) data, cx, cy, BitmapPad(display), |
1180 |
|
cx * bpp / 8); |
1181 |
|
|
1182 |
if (ownbackstore) |
if (ownbackstore) |
1183 |
{ |
{ |