201 |
static uint32 |
static uint32 |
202 |
make_colour24(PixelColour pc) |
make_colour24(PixelColour pc) |
203 |
{ |
{ |
204 |
return (pc.red << 16) | (pc.green << 8) | pc.blue; |
if (g_xserver_be) |
205 |
|
{ |
206 |
|
return pc.red | (pc.green << 8) | (pc.blue << 16); |
207 |
|
} |
208 |
|
else |
209 |
|
{ |
210 |
|
return (pc.red << 16) | (pc.green << 8) | pc.blue; |
211 |
|
} |
212 |
} |
} |
213 |
|
|
214 |
static uint32 |
static uint32 |
215 |
make_colour32(PixelColour pc) |
make_colour32(PixelColour pc) |
216 |
{ |
{ |
217 |
return (pc.red << 16) | (pc.green << 8) | pc.blue; |
if (g_xserver_be) |
218 |
|
{ |
219 |
|
return pc.red | (pc.green << 8) | (pc.blue << 16); |
220 |
|
} |
221 |
|
else |
222 |
|
{ |
223 |
|
return (pc.red << 16) | (pc.green << 8) | pc.blue; |
224 |
|
} |
225 |
} |
} |
226 |
|
|
227 |
#define BSWAP16(x) { x = (((x & 0xff) << 8) | (x >> 8)); } |
#define BSWAP16(x) { x = (((x & 0xff) << 8) | (x >> 8)); } |
358 |
static void |
static void |
359 |
translate15to32(uint16 * data, uint32 * out, uint32 * end) |
translate15to32(uint16 * data, uint32 * out, uint32 * end) |
360 |
{ |
{ |
361 |
|
uint16 pixel; |
362 |
|
|
363 |
while (out < end) |
while (out < end) |
364 |
*(out++) = make_colour32(split_colour15(*(data++))); |
{ |
365 |
|
if (g_host_be) |
366 |
|
{ |
367 |
|
pixel = *(data++); |
368 |
|
pixel = (pixel & 0xff) << 8 | (pixel & 0xff00) >> 8; |
369 |
|
*(out++) = make_colour32(split_colour15(pixel)); |
370 |
|
} |
371 |
|
else |
372 |
|
{ |
373 |
|
*(out++) = make_colour32(split_colour15(*(data++))); |
374 |
|
} |
375 |
|
} |
376 |
} |
} |
377 |
|
|
378 |
static void |
static void |
400 |
static void |
static void |
401 |
translate16to32(uint16 * data, uint32 * out, uint32 * end) |
translate16to32(uint16 * data, uint32 * out, uint32 * end) |
402 |
{ |
{ |
403 |
|
uint16 pixel; |
404 |
|
|
405 |
while (out < end) |
while (out < end) |
406 |
*(out++) = make_colour32(split_colour16(*(data++))); |
{ |
407 |
|
if (g_host_be) |
408 |
|
{ |
409 |
|
pixel = *(data++); |
410 |
|
pixel = (pixel & 0xff) << 8 | (pixel & 0xff00) >> 8; |
411 |
|
*(out++) = make_colour32(split_colour16(pixel)); |
412 |
|
} |
413 |
|
else |
414 |
|
{ |
415 |
|
*(out++) = make_colour32(split_colour16(*(data++))); |
416 |
|
} |
417 |
|
} |
418 |
} |
} |
419 |
|
|
420 |
static void |
static void |
445 |
uint32 pixel = 0; |
uint32 pixel = 0; |
446 |
while (out < end) |
while (out < end) |
447 |
{ |
{ |
448 |
pixel = *(data++); |
if (g_host_be) |
449 |
pixel |= *(data++) << 8; |
{ |
450 |
pixel |= *(data++) << 16; |
pixel = *(data++) << 16; |
451 |
|
pixel |= *(data++) << 8; |
452 |
|
pixel |= *(data++); |
453 |
|
} |
454 |
|
else |
455 |
|
{ |
456 |
|
pixel = *(data++); |
457 |
|
pixel |= *(data++) << 8; |
458 |
|
pixel |= *(data++) << 16; |
459 |
|
} |
460 |
*(out++) = pixel; |
*(out++) = pixel; |
461 |
} |
} |
462 |
} |
} |
705 |
attribs.override_redirect = g_fullscreen; |
attribs.override_redirect = g_fullscreen; |
706 |
|
|
707 |
g_wnd = XCreateWindow(g_display, RootWindowOfScreen(g_screen), 0, 0, wndwidth, wndheight, |
g_wnd = XCreateWindow(g_display, RootWindowOfScreen(g_screen), 0, 0, wndwidth, wndheight, |
708 |
0, CopyFromParent, InputOutput, CopyFromParent, |
0, CopyFromParent, InputOutput, CopyFromParent, |
709 |
CWBackPixel | CWBackingStore | CWOverrideRedirect, &attribs); |
CWBackPixel | CWBackingStore | CWOverrideRedirect, &attribs); |
710 |
|
|
711 |
XStoreName(g_display, g_wnd, g_title); |
XStoreName(g_display, g_wnd, g_title); |
712 |
|
|
746 |
if (g_IM != NULL) |
if (g_IM != NULL) |
747 |
{ |
{ |
748 |
g_IC = XCreateIC(g_IM, XNInputStyle, (XIMPreeditNothing | XIMStatusNothing), |
g_IC = XCreateIC(g_IM, XNInputStyle, (XIMPreeditNothing | XIMStatusNothing), |
749 |
XNClientWindow, g_wnd, XNFocusWindow, g_wnd, NULL); |
XNClientWindow, g_wnd, XNFocusWindow, g_wnd, NULL); |
750 |
|
|
751 |
if ((g_IC != NULL) |
if ((g_IC != NULL) |
752 |
&& (XGetICValues(g_IC, XNFilterEvents, &ic_input_mask, NULL) == NULL)) |
&& (XGetICValues(g_IC, XNFilterEvents, &ic_input_mask, NULL) == NULL)) |
882 |
if (tr.scancode == 0) |
if (tr.scancode == 0) |
883 |
break; |
break; |
884 |
|
|
885 |
save_remote_modifiers(); |
save_remote_modifiers(tr.scancode); |
886 |
ensure_remote_modifiers(ev_time, tr); |
ensure_remote_modifiers(ev_time, tr); |
887 |
rdp_send_scancode(ev_time, RDP_KEYPRESS, tr.scancode); |
rdp_send_scancode(ev_time, RDP_KEYPRESS, tr.scancode); |
888 |
restore_remote_modifiers(); |
restore_remote_modifiers(ev_time, tr.scancode); |
889 |
|
|
890 |
break; |
break; |
891 |
|
|
934 |
/* The close button, continue */ |
/* The close button, continue */ |
935 |
; |
; |
936 |
} |
} |
937 |
else if (xevent.xbutton.x >= g_width - g_win_button_size * 2) |
else if (xevent.xbutton.x >= |
938 |
|
g_width - g_win_button_size * 2) |
939 |
{ |
{ |
940 |
/* The maximize/restore button. Do not send to |
/* The maximize/restore button. Do not send to |
941 |
server. It might be a good idea to change the |
server. It might be a good idea to change the |
943 |
that rdesktop inhibited this click */ |
that rdesktop inhibited this click */ |
944 |
break; |
break; |
945 |
} |
} |
946 |
else if (xevent.xbutton.x >= g_width - g_win_button_size * 3) |
else if (xevent.xbutton.x >= |
947 |
|
g_width - g_win_button_size * 3) |
948 |
{ |
{ |
949 |
/* The minimize button. Iconify window. */ |
/* The minimize button. Iconify window. */ |
950 |
XIconifyWindow(g_display, g_wnd, |
XIconifyWindow(g_display, g_wnd, |