|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
/*
|
|
|
|
|
Copyright 2005-2012 Jay Sorg
|
|
|
|
|
Copyright 2005-2013 Jay Sorg
|
|
|
|
|
|
|
|
|
|
Permission to use, copy, modify, distribute, and sell this software and its
|
|
|
|
|
documentation for any purpose is hereby granted without fee, provided that
|
|
|
|
@ -47,6 +47,7 @@ keyboard and mouse stuff
|
|
|
|
|
extern ScreenPtr g_pScreen; /* in rdpmain.c */
|
|
|
|
|
extern DeviceIntPtr g_pointer; /* in rdpmain.c */
|
|
|
|
|
extern DeviceIntPtr g_keyboard; /* in rdpmain.c */
|
|
|
|
|
extern rdpScreenInfoRec g_rdpScreen; /* from rdpmain.c */
|
|
|
|
|
|
|
|
|
|
static int g_old_button_mask = 0;
|
|
|
|
|
static int g_pause_spe = 0;
|
|
|
|
@ -519,6 +520,7 @@ get_pixel_safe(char *data, int x, int y, int width, int height, int bpp)
|
|
|
|
|
int start;
|
|
|
|
|
int shift;
|
|
|
|
|
int c;
|
|
|
|
|
unsigned int *src32;
|
|
|
|
|
|
|
|
|
|
if (x < 0)
|
|
|
|
|
{
|
|
|
|
@ -552,6 +554,11 @@ get_pixel_safe(char *data, int x, int y, int width, int height, int bpp)
|
|
|
|
|
return (c & (0x80 >> shift)) != 0;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
else if (bpp == 32)
|
|
|
|
|
{
|
|
|
|
|
src32 = (unsigned int*)data;
|
|
|
|
|
return src32[y * width + x];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
@ -563,6 +570,7 @@ set_pixel_safe(char *data, int x, int y, int width, int height, int bpp,
|
|
|
|
|
{
|
|
|
|
|
int start;
|
|
|
|
|
int shift;
|
|
|
|
|
unsigned int *dst32;
|
|
|
|
|
|
|
|
|
|
if (x < 0)
|
|
|
|
|
{
|
|
|
|
@ -605,6 +613,11 @@ set_pixel_safe(char *data, int x, int y, int width, int height, int bpp,
|
|
|
|
|
*(data + (3 * (y * width + x)) + 1) = pixel >> 8;
|
|
|
|
|
*(data + (3 * (y * width + x)) + 2) = pixel >> 16;
|
|
|
|
|
}
|
|
|
|
|
else if (bpp == 32)
|
|
|
|
|
{
|
|
|
|
|
dst32 = (unsigned int*)data;
|
|
|
|
|
dst32[y * width + x] = pixel;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
@ -612,7 +625,7 @@ void
|
|
|
|
|
rdpSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs,
|
|
|
|
|
int x, int y)
|
|
|
|
|
{
|
|
|
|
|
char cur_data[32 * (32 * 3)];
|
|
|
|
|
char cur_data[32 * (32 * 4)];
|
|
|
|
|
char cur_mask[32 * (32 / 8)];
|
|
|
|
|
char *mask;
|
|
|
|
|
char *data;
|
|
|
|
@ -626,6 +639,7 @@ rdpSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs,
|
|
|
|
|
int paddedRowBytes;
|
|
|
|
|
int fgcolor;
|
|
|
|
|
int bgcolor;
|
|
|
|
|
int bpp;
|
|
|
|
|
|
|
|
|
|
if (pCurs == 0)
|
|
|
|
|
{
|
|
|
|
@ -639,10 +653,32 @@ rdpSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs,
|
|
|
|
|
|
|
|
|
|
w = pCurs->bits->width;
|
|
|
|
|
h = pCurs->bits->height;
|
|
|
|
|
if ((pCurs->bits->argb != 0) &&
|
|
|
|
|
(g_rdpScreen.client_info.pointer_flags & 1))
|
|
|
|
|
{
|
|
|
|
|
bpp = 32;
|
|
|
|
|
paddedRowBytes = PixmapBytePad(w, 32);
|
|
|
|
|
xhot = pCurs->bits->xhot;
|
|
|
|
|
yhot = pCurs->bits->yhot;
|
|
|
|
|
data = (char *)(pCurs->bits->argb);
|
|
|
|
|
memset(cur_data, 0, sizeof(cur_data));
|
|
|
|
|
memset(cur_mask, 0, sizeof(cur_mask));
|
|
|
|
|
|
|
|
|
|
for (j = 0; j < 32; j++)
|
|
|
|
|
{
|
|
|
|
|
for (i = 0; i < 32; i++)
|
|
|
|
|
{
|
|
|
|
|
p = get_pixel_safe(data, i, j, paddedRowBytes / 4, h, 32);
|
|
|
|
|
set_pixel_safe(cur_data, i, 31 - j, 32, 32, 32, p);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bpp = 0;
|
|
|
|
|
paddedRowBytes = PixmapBytePad(w, 1);
|
|
|
|
|
xhot = pCurs->bits->xhot;
|
|
|
|
|
yhot = pCurs->bits->yhot;
|
|
|
|
|
/* ErrorF("xhot %d yhot %d\n", xhot, yhot); */
|
|
|
|
|
data = (char *)(pCurs->bits->source);
|
|
|
|
|
mask = (char *)(pCurs->bits->mask);
|
|
|
|
|
fgcolor = (((pCurs->foreRed >> 8) & 0xff) << 16) |
|
|
|
|
@ -669,9 +705,10 @@ rdpSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rdpup_begin_update();
|
|
|
|
|
rdpup_set_cursor(xhot, yhot, cur_data, cur_mask);
|
|
|
|
|
rdpup_set_cursor_ex(xhot, yhot, cur_data, cur_mask, bpp);
|
|
|
|
|
rdpup_end_update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|