xfreerdp-server: encode a single tile from X11 at a hardcoded position

This commit is contained in:
Marc-André Moreau 2011-09-13 19:03:06 -04:00
parent c71a68e37b
commit 5c25717eae
17 changed files with 378 additions and 189 deletions

View File

@ -199,7 +199,7 @@ Pixmap xf_bitmap_new(xfInfo* xfi, int width, int height, int bpp, uint8* data)
bitmap = XCreatePixmap(xfi->display, xfi->window->handle, width, height, xfi->bpp);
cdata = gdi_image_convert(data, NULL, width, height, bpp, xfi->bpp, xfi->clrconv);
cdata = freerdp_image_convert(data, NULL, width, height, bpp, xfi->bpp, xfi->clrconv);
image = XCreateImage(xfi->display, xfi->visual, xfi->depth,
ZPixmap, 0, (char *) cdata, width, height, xfi->scanline_pad, 0);
@ -246,7 +246,7 @@ void xf_gdi_bitmap_update(rdpUpdate* update, BITMAP_UPDATE* bitmap)
{
bmp = &bitmap->bitmaps[i];
data = gdi_image_convert(bmp->data, NULL, bmp->width, bmp->height, bmp->bpp, xfi->bpp, xfi->clrconv);
data = freerdp_image_convert(bmp->data, NULL, bmp->width, bmp->height, bmp->bpp, xfi->bpp, xfi->clrconv);
image = XCreateImage(xfi->display, xfi->visual, xfi->depth,
ZPixmap, 0, (char*) data, bmp->width, bmp->height, xfi->scanline_pad, 0);
@ -314,8 +314,8 @@ void xf_gdi_patblt(rdpUpdate* update, PATBLT_ORDER* patblt)
brush = &patblt->brush;
xf_set_rop3(xfi, gdi_rop3_code(patblt->bRop));
foreColor = gdi_color_convert(patblt->foreColor, xfi->srcBpp, 32, xfi->clrconv);
backColor = gdi_color_convert(patblt->backColor, xfi->srcBpp, 32, xfi->clrconv);
foreColor = freerdp_color_convert(patblt->foreColor, xfi->srcBpp, 32, xfi->clrconv);
backColor = freerdp_color_convert(patblt->backColor, xfi->srcBpp, 32, xfi->clrconv);
if (brush->style & CACHED_BRUSH)
{
@ -408,7 +408,7 @@ void xf_gdi_opaque_rect(rdpUpdate* update, OPAQUE_RECT_ORDER* opaque_rect)
uint32 color;
xfInfo* xfi = GET_XFI(update);
color = gdi_color_convert(opaque_rect->color, xfi->srcBpp, xfi->bpp, xfi->clrconv);
color = freerdp_color_convert(opaque_rect->color, xfi->srcBpp, xfi->bpp, xfi->clrconv);
XSetFunction(xfi->display, xfi->gc, GXcopy);
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
@ -431,7 +431,7 @@ void xf_gdi_multi_opaque_rect(rdpUpdate* update, MULTI_OPAQUE_RECT_ORDER* multi_
DELTA_RECT* rectangle;
xfInfo* xfi = GET_XFI(update);
color = gdi_color_convert(multi_opaque_rect->color, xfi->srcBpp, xfi->bpp, xfi->clrconv);
color = freerdp_color_convert(multi_opaque_rect->color, xfi->srcBpp, xfi->bpp, xfi->clrconv);
XSetFunction(xfi->display, xfi->gc, GXcopy);
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
@ -459,7 +459,7 @@ void xf_gdi_line_to(rdpUpdate* update, LINE_TO_ORDER* line_to)
xfInfo* xfi = GET_XFI(update);
xf_set_rop2(xfi, line_to->bRop2);
color = gdi_color_convert(line_to->penColor, xfi->srcBpp, 32, xfi->clrconv);
color = freerdp_color_convert(line_to->penColor, xfi->srcBpp, 32, xfi->clrconv);
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
XSetForeground(xfi->display, xfi->gc, color);
@ -482,7 +482,7 @@ void xf_gdi_polyline(rdpUpdate* update, POLYLINE_ORDER* polyline)
xfInfo* xfi = GET_XFI(update);
xf_set_rop2(xfi, polyline->bRop2);
color = gdi_color_convert(polyline->penColor, xfi->srcBpp, 32, xfi->clrconv);
color = freerdp_color_convert(polyline->penColor, xfi->srcBpp, 32, xfi->clrconv);
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
XSetForeground(xfi->display, xfi->gc, color);

View File

@ -146,7 +146,7 @@ void xf_rail_SetWindowIcon(rdpRail* rail, rdpWindow* window, rdpIcon* icon)
xfi = (xfInfo*) rail->extra;
xfw = (xfWindow*) window->extra;
icon->extra = gdi_icon_convert(icon->entry->bitsColor, NULL, icon->entry->bitsMask,
icon->extra = freerdp_icon_convert(icon->entry->bitsColor, NULL, icon->entry->bitsMask,
icon->entry->width, icon->entry->height, icon->entry->bpp, rail->clrconv);
xf_SetWindowIcon(xfi, xfw, icon);

View File

@ -1533,88 +1533,88 @@ void test_gdi_LineTo(void)
clrconv->invert = 0;
clrconv->palette = hPalette;
data = (uint8*) gdi_image_convert((uint8*) line_to_case_1, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_case_1, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_1 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_case_2, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_case_2, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_2 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_case_3, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_case_3, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_3 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_case_4, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_case_4, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_4 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_case_5, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_case_5, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_5 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_case_5, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_case_5, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_5 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_case_6, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_case_6, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_6 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_case_7, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_case_7, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_7 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_case_8, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_case_8, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_8 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_case_9, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_case_9, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_9 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_case_10, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_case_10, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_10 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_case_11, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_case_11, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_11 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_R2_BLACK, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_BLACK, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_BLACK = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_R2_NOTMERGEPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_NOTMERGEPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_NOTMERGEPEN = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_R2_MASKNOTPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_MASKNOTPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_MASKNOTPEN = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_R2_NOTCOPYPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_NOTCOPYPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_NOTCOPYPEN = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_R2_MASKPENNOT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_MASKPENNOT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_MASKPENNOT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_R2_NOT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_NOT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_NOT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_R2_XORPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_XORPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_XORPEN = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_R2_NOTMASKPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_NOTMASKPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_NOTMASKPEN = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_R2_MASKPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_MASKPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_MASKPEN = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_R2_NOTXORPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_NOTXORPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_NOTXORPEN = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_R2_NOP, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_NOP, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_NOP = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_R2_MERGENOTPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_MERGENOTPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_MERGENOTPEN = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_R2_COPYPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_COPYPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_COPYPEN = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_R2_MERGEPENNOT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_MERGEPENNOT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_MERGEPENNOT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_R2_MERGEPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_MERGEPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_MERGEPEN = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) line_to_R2_WHITE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_WHITE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_WHITE = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
/* Test Case 1: (0,0) -> (15, 15) */
@ -1851,13 +1851,13 @@ void test_gdi_Ellipse(void)
clrconv->invert = 0;
clrconv->palette = hPalette;
data = (uint8*) gdi_image_convert((uint8*) ellipse_case_1, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) ellipse_case_1, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_Ellipse_1 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) ellipse_case_2, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) ellipse_case_2, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_Ellipse_2 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) ellipse_case_3, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) ellipse_case_3, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_Ellipse_3 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
/* Test Case 1: (0,0) -> (16, 16) */
@ -2009,64 +2009,64 @@ void test_gdi_BitBlt_32bpp(void)
clrconv->invert = 0;
clrconv->palette = hPalette;
data = (uint8*) gdi_image_convert((uint8*) bmp_SRC, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SRC, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmpSrc = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmpDst = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmpDstOriginal = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_PAT, NULL, 8, 8, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_PAT, NULL, 8, 8, 8, bitsPerPixel, clrconv);
hBmpPat = gdi_CreateBitmap(8, 8, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_SRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCCOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_SPna, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SPna, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SPna = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_BLACKNESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_BLACKNESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_BLACKNESS = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_WHITENESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_WHITENESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_WHITENESS = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_SRCAND, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCAND, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCAND = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_SRCPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCPAINT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_SRCINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCINVERT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_SRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCERASE = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_NOTSRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_NOTSRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_NOTSRCCOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_NOTSRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_NOTSRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_NOTSRCERASE = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_DSTINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_DSTINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_DSTINVERT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_MERGECOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_MERGECOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_MERGECOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_MERGEPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_MERGEPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_MERGEPAINT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_PATCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_PATCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_PATCOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_PATPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_PATPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_PATPAINT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_PATINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_PATINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_PATINVERT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
gdi_SelectObject(hdcSrc, (HGDIOBJECT) hBmpSrc);
@ -2263,64 +2263,64 @@ void test_gdi_BitBlt_16bpp(void)
clrconv->invert = 0;
clrconv->palette = hPalette;
data = (uint8*) gdi_image_convert((uint8*) bmp_SRC, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SRC, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmpSrc = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmpDst = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmpDstOriginal = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_PAT, NULL, 8, 8, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_PAT, NULL, 8, 8, 8, bitsPerPixel, clrconv);
hBmpPat = gdi_CreateBitmap(8, 8, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_SRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCCOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_SPna, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SPna, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SPna = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_BLACKNESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_BLACKNESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_BLACKNESS = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_WHITENESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_WHITENESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_WHITENESS = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_SRCAND, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCAND, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCAND = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_SRCPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCPAINT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_SRCINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCINVERT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_SRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCERASE = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_NOTSRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_NOTSRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_NOTSRCCOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_NOTSRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_NOTSRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_NOTSRCERASE = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_DSTINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_DSTINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_DSTINVERT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_MERGECOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_MERGECOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_MERGECOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_MERGEPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_MERGEPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_MERGEPAINT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_PATCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_PATCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_PATCOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_PATPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_PATPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_PATPAINT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_PATINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_PATINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_PATINVERT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
gdi_SelectObject(hdcSrc, (HGDIOBJECT) hBmpSrc);
@ -2517,64 +2517,64 @@ void test_gdi_BitBlt_8bpp(void)
clrconv->invert = 0;
clrconv->palette = hPalette;
data = (uint8*) gdi_image_convert((uint8*) bmp_SRC, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SRC, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmpSrc = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmpDst = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmpDstOriginal = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_PAT, NULL, 8, 8, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_PAT, NULL, 8, 8, 8, bitsPerPixel, clrconv);
hBmpPat = gdi_CreateBitmap(8, 8, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_SRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCCOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_SPna, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SPna, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SPna = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_BLACKNESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_BLACKNESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_BLACKNESS = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_WHITENESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_WHITENESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_WHITENESS = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_SRCAND, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCAND, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCAND = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_SRCPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCPAINT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_SRCINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCINVERT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_SRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCERASE = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_NOTSRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_NOTSRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_NOTSRCCOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_NOTSRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_NOTSRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_NOTSRCERASE = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_DSTINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_DSTINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_DSTINVERT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_MERGECOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_MERGECOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_MERGECOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_MERGEPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_MERGEPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_MERGEPAINT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_PATCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_PATCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_PATCOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_PATPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_PATPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_PATPAINT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
data = (uint8*) gdi_image_convert((uint8*) bmp_PATINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
data = (uint8*) freerdp_image_convert((uint8*) bmp_PATINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_PATINVERT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
gdi_SelectObject(hdcSrc, (HGDIOBJECT) hBmpSrc);

View File

@ -234,14 +234,14 @@ typedef CLRCONV* HCLRCONV;
#define IBPP(_bpp) (((_bpp + 1)/ 8) % 5)
typedef uint8* (*p_gdi_image_convert)(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv);
typedef uint8* (*p_freerdp_image_convert)(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv);
FREERDP_API uint32 gdi_color_convert(uint32 srcColor, int srcBpp, int dstBpp, HCLRCONV clrconv);
FREERDP_API uint8* gdi_image_convert(uint8* srcData, uint8 *dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv);
FREERDP_API uint8* gdi_glyph_convert(int width, int height, uint8* data);
FREERDP_API uint8* gdi_image_invert(uint8* srcData, uint8* dstData, int width, int height, int bpp);
FREERDP_API uint8* gdi_icon_convert(uint8* srcData, uint8* dstData, uint8* mask, int width, int height, int bpp, HCLRCONV clrconv);
FREERDP_API uint8* gdi_mono_image_convert(uint8* srcData, int width, int height, int srcBpp, int dstBpp, uint32 bgcolor, uint32 fgcolor, HCLRCONV clrconv);
FREERDP_API uint32 freerdp_color_convert(uint32 srcColor, int srcBpp, int dstBpp, HCLRCONV clrconv);
FREERDP_API uint8* freerdp_image_convert(uint8* srcData, uint8 *dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv);
FREERDP_API uint8* freerdp_glyph_convert(int width, int height, uint8* data);
FREERDP_API uint8* freerdp_image_invert(uint8* srcData, uint8* dstData, int width, int height, int bpp);
FREERDP_API uint8* freerdp_icon_convert(uint8* srcData, uint8* dstData, uint8* mask, int width, int height, int bpp, HCLRCONV clrconv);
FREERDP_API uint8* freerdp_mono_image_convert(uint8* srcData, int width, int height, int srcBpp, int dstBpp, uint32 bgcolor, uint32 fgcolor, HCLRCONV clrconv);
#ifdef __cplusplus
}

View File

@ -39,6 +39,7 @@ typedef void (*psPeerAccepted)(freerdp_listener* instance, freerdp_peer* client)
struct rdp_freerdp_listener
{
void* info;
void* listener;
void* param1;
void* param2;

View File

@ -37,6 +37,7 @@ typedef boolean (*psPeerActivate)(freerdp_peer* client);
struct rdp_freerdp_peer
{
void* info;
void* peer;
void* param1;
void* param2;

View File

@ -23,7 +23,7 @@
#include <freerdp/freerdp.h>
#include <freerdp/common/color.h>
uint32 gdi_color_convert_rgb(uint32 srcColor, int srcBpp, int dstBpp, HCLRCONV clrconv)
uint32 freerdp_color_convert_rgb(uint32 srcColor, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
uint8 red = 0;
uint8 green = 0;
@ -107,7 +107,7 @@ uint32 gdi_color_convert_rgb(uint32 srcColor, int srcBpp, int dstBpp, HCLRCONV c
return dstColor;
}
uint32 gdi_color_convert_bgr(uint32 srcColor, int srcBpp, int dstBpp, HCLRCONV clrconv)
uint32 freerdp_color_convert_bgr(uint32 srcColor, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
uint8 red = 0;
uint8 green = 0;
@ -191,15 +191,15 @@ uint32 gdi_color_convert_bgr(uint32 srcColor, int srcBpp, int dstBpp, HCLRCONV c
return dstColor;
}
uint32 gdi_color_convert(uint32 srcColor, int srcBpp, int dstBpp, HCLRCONV clrconv)
uint32 freerdp_color_convert(uint32 srcColor, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
if (clrconv->invert)
return gdi_color_convert_bgr(srcColor, srcBpp, dstBpp, clrconv);
return freerdp_color_convert_bgr(srcColor, srcBpp, dstBpp, clrconv);
else
return gdi_color_convert_rgb(srcColor, srcBpp, dstBpp, clrconv);
return freerdp_color_convert_rgb(srcColor, srcBpp, dstBpp, clrconv);
}
uint8* gdi_image_convert_8bpp(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
uint8* freerdp_image_convert_8bpp(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
int i;
uint8 red;
@ -280,7 +280,7 @@ uint8* gdi_image_convert_8bpp(uint8* srcData, uint8* dstData, int width, int hei
return srcData;
}
uint8* gdi_image_convert_15bpp(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
uint8* freerdp_image_convert_15bpp(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
int i;
uint8 red;
@ -341,10 +341,10 @@ uint8* gdi_image_convert_15bpp(uint8* srcData, uint8* dstData, int width, int he
return srcData;
}
uint8* gdi_image_convert_16bpp(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
uint8* freerdp_image_convert_16bpp(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
if (srcBpp == 15)
return gdi_image_convert_15bpp(srcData, dstData, width, height, srcBpp, dstBpp, clrconv);
return freerdp_image_convert_15bpp(srcData, dstData, width, height, srcBpp, dstBpp, clrconv);
if (dstBpp == 16)
{
@ -434,29 +434,21 @@ uint8* gdi_image_convert_16bpp(uint8* srcData, uint8* dstData, int width, int he
return srcData;
}
uint8* gdi_image_convert_24bpp(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
uint8* freerdp_image_convert_24bpp(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
int i;
uint8 red;
uint8 green;
uint8 blue;
uint32 pixel;
uint32 *dst32;
if (dstBpp == 32)
{
if (dstData == NULL)
dstData = (uint8*) malloc(width * height * 4);
dst32 = (uint32 *) dstData;
for (i = width * height; i > 0; i--)
{
red = *(srcData++);
green = *(srcData++);
blue = *(srcData++);
pixel = BGR24(red, green, blue);
*dst32 = pixel;
dst32++;
*(dstData++) = *(srcData++);
*(dstData++) = *(srcData++);
*(dstData++) = *(srcData++);
*(dstData++) = 0xFF;
}
return dstData;
}
@ -464,7 +456,7 @@ uint8* gdi_image_convert_24bpp(uint8* srcData, uint8* dstData, int width, int he
return srcData;
}
uint8* gdi_image_convert_32bpp(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
uint8* freerdp_image_convert_32bpp(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
if (dstBpp == 16)
{
@ -556,26 +548,26 @@ uint8* gdi_image_convert_32bpp(uint8* srcData, uint8* dstData, int width, int he
return srcData;
}
p_gdi_image_convert gdi_image_convert_[5] =
p_freerdp_image_convert freerdp_image_convert_[5] =
{
NULL,
gdi_image_convert_8bpp,
gdi_image_convert_16bpp,
gdi_image_convert_24bpp,
gdi_image_convert_32bpp
freerdp_image_convert_8bpp,
freerdp_image_convert_16bpp,
freerdp_image_convert_24bpp,
freerdp_image_convert_32bpp
};
uint8* gdi_image_convert(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
uint8* freerdp_image_convert(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
p_gdi_image_convert _p_gdi_image_convert = gdi_image_convert_[IBPP(srcBpp)];
p_freerdp_image_convert _p_freerdp_image_convert = freerdp_image_convert_[IBPP(srcBpp)];
if (_p_gdi_image_convert != NULL)
return _p_gdi_image_convert(srcData, dstData, width, height, srcBpp, dstBpp, clrconv);
if (_p_freerdp_image_convert != NULL)
return _p_freerdp_image_convert(srcData, dstData, width, height, srcBpp, dstBpp, clrconv);
else
return 0;
}
uint8* gdi_image_invert(uint8* srcData, uint8* dstData, int width, int height, int bpp)
uint8* freerdp_image_invert(uint8* srcData, uint8* dstData, int width, int height, int bpp)
{
int y;
uint8* srcp;
@ -600,7 +592,7 @@ uint8* gdi_image_invert(uint8* srcData, uint8* dstData, int width, int height, i
return dstData;
}
uint8* gdi_icon_convert(uint8* srcData, uint8* dstData, uint8* mask, int width, int height, int bpp, HCLRCONV clrconv)
uint8* freerdp_icon_convert(uint8* srcData, uint8* dstData, uint8* mask, int width, int height, int bpp, HCLRCONV clrconv)
{
int x, y;
int pixel;
@ -610,8 +602,8 @@ uint8* gdi_icon_convert(uint8* srcData, uint8* dstData, uint8* mask, int width,
uint32* icon;
pixel = 0;
data = gdi_image_invert(srcData, dstData, width, height, bpp);
dstData = gdi_image_convert(data, NULL, width, height, bpp, 32, clrconv);
data = freerdp_image_invert(srcData, dstData, width, height, bpp);
dstData = freerdp_image_convert(data, NULL, width, height, bpp, 32, clrconv);
free(data);
bmask = mask[pixel];
@ -642,7 +634,7 @@ uint8* gdi_icon_convert(uint8* srcData, uint8* dstData, uint8* mask, int width,
return dstData;
}
uint8* gdi_glyph_convert(int width, int height, uint8* data)
uint8* freerdp_glyph_convert(int width, int height, uint8* data)
{
int x, y;
uint8 *srcp;
@ -679,7 +671,7 @@ uint8* gdi_glyph_convert(int width, int height, uint8* data)
return dstData;
}
uint8* gdi_mono_image_convert(uint8* srcData, int width, int height, int srcBpp, int dstBpp, uint32 bgcolor, uint32 fgcolor, HCLRCONV clrconv)
uint8* freerdp_mono_image_convert(uint8* srcData, int width, int height, int srcBpp, int dstBpp, uint32 bgcolor, uint32 fgcolor, HCLRCONV clrconv)
{
int index;
uint16* dst16;

View File

@ -396,7 +396,7 @@ HGDI_BITMAP gdi_create_bitmap(GDI* gdi, int width, int height, int bpp, uint8* d
uint8* bmpData;
HGDI_BITMAP bitmap;
bmpData = gdi_image_convert(data, NULL, width, height, gdi->srcBpp, bpp, gdi->clrconv);
bmpData = freerdp_image_convert(data, NULL, width, height, gdi->srcBpp, bpp, gdi->clrconv);
bitmap = gdi_CreateBitmap(width, height, gdi->dstBpp, bmpData);
return bitmap;
@ -506,7 +506,7 @@ void gdi_patblt(rdpUpdate* update, PATBLT_ORDER* patblt)
uint32 color;
originalBrush = gdi->drawing->hdc->brush;
color = gdi_color_convert(patblt->foreColor, gdi->srcBpp, 32, gdi->clrconv);
color = freerdp_color_convert(patblt->foreColor, gdi->srcBpp, 32, gdi->clrconv);
gdi->drawing->hdc->brush = gdi_CreateSolidBrush(color);
gdi_PatBlt(gdi->drawing->hdc, patblt->nLeftRect, patblt->nTopRect,
@ -521,11 +521,11 @@ void gdi_patblt(rdpUpdate* update, PATBLT_ORDER* patblt)
if (brush->bpp > 1)
{
data = gdi_image_convert(brush->data, NULL, 8, 8, gdi->srcBpp, gdi->dstBpp, gdi->clrconv);
data = freerdp_image_convert(brush->data, NULL, 8, 8, gdi->srcBpp, gdi->dstBpp, gdi->clrconv);
}
else
{
data = gdi_mono_image_convert(brush->data, 8, 8, gdi->srcBpp, gdi->dstBpp,
data = freerdp_mono_image_convert(brush->data, 8, 8, gdi->srcBpp, gdi->dstBpp,
patblt->backColor, patblt->foreColor, gdi->clrconv);
}
@ -565,7 +565,7 @@ void gdi_opaque_rect(rdpUpdate* update, OPAQUE_RECT_ORDER* opaque_rect)
gdi_CRgnToRect(opaque_rect->nLeftRect, opaque_rect->nTopRect,
opaque_rect->nWidth, opaque_rect->nHeight, &rect);
brush_color = gdi_color_convert(opaque_rect->color, gdi->srcBpp, 32, gdi->clrconv);
brush_color = freerdp_color_convert(opaque_rect->color, gdi->srcBpp, 32, gdi->clrconv);
hBrush = gdi_CreateSolidBrush(brush_color);
gdi_FillRect(gdi->drawing->hdc, &rect, hBrush);
@ -589,7 +589,7 @@ void gdi_multi_opaque_rect(rdpUpdate* update, MULTI_OPAQUE_RECT_ORDER* multi_opa
gdi_CRgnToRect(rectangle->left, rectangle->top,
rectangle->width, rectangle->height, &rect);
brush_color = gdi_color_convert(multi_opaque_rect->color, gdi->srcBpp, 32, gdi->clrconv);
brush_color = freerdp_color_convert(multi_opaque_rect->color, gdi->srcBpp, 32, gdi->clrconv);
hBrush = gdi_CreateSolidBrush(brush_color);
gdi_FillRect(gdi->drawing->hdc, &rect, hBrush);
@ -604,7 +604,7 @@ void gdi_line_to(rdpUpdate* update, LINE_TO_ORDER* line_to)
HGDI_PEN hPen;
GDI *gdi = GET_GDI(update);
color = gdi_color_convert(line_to->penColor, gdi->srcBpp, 32, gdi->clrconv);
color = freerdp_color_convert(line_to->penColor, gdi->srcBpp, 32, gdi->clrconv);
hPen = gdi_CreatePen(line_to->penStyle, line_to->penWidth, (GDI_COLOR) color);
gdi_SelectObject(gdi->drawing->hdc, (HGDIOBJECT) hPen);
gdi_SetROP2(gdi->drawing->hdc, line_to->bRop2);
@ -623,7 +623,7 @@ void gdi_polyline(rdpUpdate* update, POLYLINE_ORDER* polyline)
DELTA_POINT* points;
GDI *gdi = GET_GDI(update);
color = gdi_color_convert(polyline->penColor, gdi->srcBpp, 32, gdi->clrconv);
color = freerdp_color_convert(polyline->penColor, gdi->srcBpp, 32, gdi->clrconv);
hPen = gdi_CreatePen(0, 1, (GDI_COLOR) color);
gdi_SelectObject(gdi->drawing->hdc, (HGDIOBJECT) hPen);
gdi_SetROP2(gdi->drawing->hdc, polyline->bRop2);
@ -645,7 +645,7 @@ void gdi_fast_index(rdpUpdate* update, FAST_INDEX_ORDER* fast_index)
uint32 color;
GDI* gdi = GET_GDI(update);
color = gdi_color_convert(fast_index->foreColor, gdi->srcBpp, 32, gdi->clrconv);
color = freerdp_color_convert(fast_index->foreColor, gdi->srcBpp, 32, gdi->clrconv);
gdi->textColor = gdi_SetTextColor(gdi->drawing->hdc, color);
@ -710,7 +710,7 @@ void gdi_cache_glyph(rdpUpdate* update, CACHE_GLYPH_ORDER* cache_glyph)
gdi_bmp->hdc->bytesPerPixel = 1;
gdi_bmp->hdc->bitsPerPixel = 1;
extra = gdi_glyph_convert(glyph->cx, glyph->cy, glyph->aj);
extra = freerdp_glyph_convert(glyph->cx, glyph->cy, glyph->aj);
gdi_bmp->bitmap = gdi_CreateBitmap(glyph->cx, glyph->cy, 1, extra);
gdi_bmp->bitmap->bytesPerPixel = 1;
gdi_bmp->bitmap->bitsPerPixel = 1;
@ -739,7 +739,7 @@ void gdi_cache_glyph_v2(rdpUpdate* update, CACHE_GLYPH_V2_ORDER* cache_glyph_v2)
gdi_bmp->hdc->bytesPerPixel = 1;
gdi_bmp->hdc->bitsPerPixel = 1;
extra = gdi_glyph_convert(glyph->cx, glyph->cy, glyph->aj);
extra = freerdp_glyph_convert(glyph->cx, glyph->cy, glyph->aj);
gdi_bmp->bitmap = gdi_CreateBitmap(glyph->cx, glyph->cy, 1, extra);
gdi_bmp->bitmap->bytesPerPixel = 1;
gdi_bmp->bitmap->bitsPerPixel = 1;
@ -796,7 +796,7 @@ void gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_comm
tx = message->tiles[i]->x + surface_bits_command->destLeft;
ty = message->tiles[i]->y + surface_bits_command->destTop;
gdi_image_convert(message->tiles[i]->data, gdi->tile->bitmap->data, 64, 64, 32, 32, gdi->clrconv);
freerdp_image_convert(message->tiles[i]->data, gdi->tile->bitmap->data, 64, 64, 32, 32, gdi->clrconv);
#ifdef DUMP_REMOTEFX_TILES
sprintf(tile_bitmap, "/tmp/rfx/tile_%d.bmp", tilenum++);
@ -835,7 +835,7 @@ void gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_comm
tx = message->tiles[i]->x + surface_bits_command->destLeft;
ty = message->tiles[i]->y + surface_bits_command->destTop;
gdi_image_convert(message->tiles[i]->data, gdi->tile->bitmap->data, 64, 64, 32, 32, gdi->clrconv);
freerdp_image_convert(message->tiles[i]->data, gdi->tile->bitmap->data, 64, 64, 32, 32, gdi->clrconv);
#ifdef DUMP_REMOTEFX_TILES
sprintf(tile_bitmap, "/tmp/rfx/tile_%d.bmp", tilenum++);
@ -869,7 +869,7 @@ void gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_comm
if (surface_bits_command->bpp != 32)
{
gdi_image_convert(surface_bits_command->bitmapData, gdi->image->bitmap->data,
freerdp_image_convert(surface_bits_command->bitmapData, gdi->image->bitmap->data,
gdi->image->bitmap->width, gdi->image->bitmap->height,
gdi->image->bitmap->bitsPerPixel, 32, gdi->clrconv);
@ -877,7 +877,7 @@ void gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_comm
surface_bits_command->bitmapData = gdi->image->bitmap->data;
}
gdi_image_invert(surface_bits_command->bitmapData, gdi->image->bitmap->data,
freerdp_image_invert(surface_bits_command->bitmapData, gdi->image->bitmap->data,
gdi->image->bitmap->width, gdi->image->bitmap->height, 32);
gdi_BitBlt(gdi->primary->hdc, surface_bits_command->destLeft, surface_bits_command->destTop,

View File

@ -20,6 +20,14 @@
# Servers
if(NOT WIN32)
add_subdirectory(X11)
# Build Test Server
add_subdirectory(test)
# Build X11 Server
find_suggested_package(X11)
if(X11_FOUND)
add_subdirectory(X11)
endif()
endif()

View File

@ -17,11 +17,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
include_directories(${X11_INCLUDE_DIRS})
add_executable(xfreerdp-server
xf_peer.c
xf_encode.c
xfreerdp.c)
find_suggested_package(Xext)
if(XEXT_FOUND)
add_definitions(-DWITH_XEXT)
include_directories(${XEXT_INCLUDE_DIRS})
target_link_libraries(xfreerdp-server ${XEXT_LIBRARIES})
endif()
target_link_libraries(xfreerdp-server freerdp-core)
target_link_libraries(xfreerdp-server freerdp-common)
target_link_libraries(xfreerdp-server freerdp-utils)
target_link_libraries(xfreerdp-server freerdp-rfx)
target_link_libraries(xfreerdp-server ${X11_LIBRARIES})

View File

@ -18,3 +18,10 @@
*/
#include "xf_encode.h"
XImage* xf_snapshot(xfInfo* xfi, int x, int y, int width, int height)
{
XImage* image;
image = XGetImage(xfi->display, RootWindow(xfi->display, xfi->number), x, y, width, height, AllPlanes, ZPixmap);
return image;
}

View File

@ -20,6 +20,8 @@
#ifndef __XF_ENCODE_H
#define __XF_ENCODE_H
#include "xfreerdp.h"
XImage* xf_snapshot(xfInfo* xfi, int x, int y, int width, int height);
#endif /* __XF_ENCODE_H */

View File

@ -24,16 +24,19 @@
#include <freerdp/utils/sleep.h>
#include <freerdp/utils/memory.h>
#include <freerdp/utils/thread.h>
#include <freerdp/common/color.h>
extern char* xf_pcap_file;
#include "xf_encode.h"
#include "xf_peer.h"
void xf_peer_init(freerdp_peer* client)
{
xfPeerInfo* info;
xfPeer* info;
info = xnew(xfPeerInfo);
info = xnew(xfPeer);
info->context = rfx_context_new();
info->context->mode = RLGR3;
@ -48,7 +51,7 @@ void xf_peer_init(freerdp_peer* client)
void xf_peer_uninit(freerdp_peer* client)
{
xfPeerInfo* info = (xfPeerInfo*) client->param1;
xfPeer* info = (xfPeer*) client->param1;
if (info)
{
@ -58,13 +61,73 @@ void xf_peer_uninit(freerdp_peer* client)
}
}
STREAM* xf_peer_stream_init(xfPeerInfo* info)
STREAM* xf_peer_stream_init(xfPeer* info)
{
stream_clear(info->s);
stream_set_pos(info->s, 0);
return info->s;
}
void xf_peer_live_rfx(freerdp_peer* client)
{
STREAM* s;
uint8* data;
xfInfo* xfi;
xfPeer* xfp;
XImage* image;
RFX_RECT rect;
uint32 seconds;
uint32 useconds;
rdpUpdate* update;
uint8* background;
SURFACE_BITS_COMMAND* cmd;
seconds = 1;
useconds = 0;
update = client->update;
xfi = (xfInfo*) client->info;
xfp = (xfPeer*) client->param1;
cmd = &update->surface_bits_command;
rect.x = 0;
rect.y = 0;
rect.width = 64;
rect.height = 64;
data = (uint8*) xmalloc(64 * 64 * 3);
background = (uint8*) xmalloc(64 * 64 * 3);
memset(background, 0xA0, 64 * 64 * 3);
while (1)
{
if (seconds > 0)
freerdp_sleep(seconds);
if (useconds > 0)
freerdp_usleep(useconds);
s = xf_peer_stream_init(xfp);
image = xf_snapshot(xfi, 0, 0, 64, 64);
freerdp_image_convert((uint8*) image->data, data, 64, 64, 32, 24, xfi->clrconv);
rfx_compose_message(xfp->context, s,
&rect, 1, data, rect.width, rect.height, 64 * 3);
cmd->destLeft = 0;
cmd->destTop = 0;
cmd->destRight = 64;
cmd->destBottom = 64;
cmd->bpp = 32;
cmd->codecID = client->settings->rfx_codec_id;
cmd->width = 64;
cmd->height = 64;
cmd->bitmapDataLength = stream_get_length(s);
cmd->bitmapData = stream_get_head(s);
update->SurfaceBits(update, cmd);
}
}
void xf_peer_dump_rfx(freerdp_peer* client)
{
STREAM* s;
@ -136,16 +199,20 @@ boolean xf_peer_post_connect(freerdp_peer* client)
boolean xf_peer_activate(freerdp_peer* client)
{
xfPeerInfo* info = (xfPeerInfo*) client->param1;
xfPeer* xfp = (xfPeer*) client->param1;
rfx_context_reset(info->context);
info->activated = True;
rfx_context_reset(xfp->context);
xfp->activated = True;
if (xf_pcap_file != NULL)
{
client->update->dump_rfx = True;
xf_peer_dump_rfx(client);
}
else
{
xf_peer_live_rfx(client);
}
return True;
}
@ -159,7 +226,7 @@ void xf_peer_keyboard_event(rdpInput* input, uint16 flags, uint16 code)
{
freerdp_peer* client = (freerdp_peer*) input->param1;
rdpUpdate* update = client->update;
xfPeerInfo* info = (xfPeerInfo*)client->param1;
xfPeer* xfp = (xfPeer*) client->param1;
printf("Client sent a keyboard event (flags:0x%X code:0x%X)\n", flags, code);
@ -176,7 +243,7 @@ void xf_peer_keyboard_event(rdpInput* input, uint16 flags, uint16 code)
client->settings->height = 480;
}
update->DesktopResize(update);
info->activated = False;
xfp->activated = False;
}
}
@ -282,6 +349,8 @@ void* xf_peer_main_loop(void* arg)
void xf_peer_accepted(freerdp_listener* instance, freerdp_peer* client)
{
pthread_t th;
client->info = instance->info;
pthread_create(&th, 0, xf_peer_main_loop, client);
pthread_detach(th);
}

View File

@ -30,7 +30,7 @@ struct xf_peer_info
boolean activated;
RFX_CONTEXT* context;
};
typedef struct xf_peer_info xfPeerInfo;
typedef struct xf_peer_info xfPeer;
void xf_peer_accepted(freerdp_listener* instance, freerdp_peer* client);

View File

@ -20,12 +20,89 @@
#include <errno.h>
#include <signal.h>
#include <sys/select.h>
#include <freerdp/utils/memory.h>
#include "xf_peer.h"
#include "xfreerdp.h"
char* xf_pcap_file = NULL;
xfInfo* xf_info_init()
{
int i;
xfInfo* xfi;
int pf_count;
int vi_count;
XVisualInfo* vi;
XVisualInfo* vis;
XVisualInfo template;
XPixmapFormatValues* pf;
XPixmapFormatValues* pfs;
xfi = xnew(xfInfo);
xfi->display = XOpenDisplay(NULL);
if (xfi->display == NULL)
printf("failed to open display: %s\n", XDisplayName(NULL));
xfi->number = DefaultScreen(xfi->display);
xfi->screen = ScreenOfDisplay(xfi->display, xfi->number);
xfi->depth = DefaultDepthOfScreen(xfi->screen);
xfi->width = WidthOfScreen(xfi->screen);
xfi->height = HeightOfScreen(xfi->screen);
pfs = XListPixmapFormats(xfi->display, &pf_count);
if (pfs == NULL)
{
printf("XListPixmapFormats failed\n");
exit(1);
}
for (i = 0; i < pf_count; i++)
{
pf = pfs + i;
if (pf->depth == xfi->depth)
{
xfi->bpp = pf->bits_per_pixel;
xfi->scanline_pad = pf->scanline_pad;
break;
}
}
XFree(pfs);
memset(&template, 0, sizeof(template));
template.class = TrueColor;
template.screen = xfi->number;
vis = XGetVisualInfo(xfi->display, VisualClassMask | VisualScreenMask, &template, &vi_count);
if (vis == NULL)
{
printf("XGetVisualInfo failed\n");
exit(1);
}
for (i = 0; i < vi_count; i++)
{
vi = vis + i;
if (vi->depth == xfi->depth)
{
xfi->visual = vi->visual;
break;
}
}
XFree(vis);
xfi->clrconv = xnew(HCLRCONV);
xfi->clrconv->alpha = 1;
return xfi;
}
void xf_server_main_loop(freerdp_listener* instance)
{
int i;
@ -90,11 +167,11 @@ int main(int argc, char* argv[])
{
freerdp_listener* instance;
/* Ignore SIGPIPE, otherwise an SSL_write failure could crash your server */
/* ignore SIGPIPE, otherwise an SSL_write failure could crash the server */
signal(SIGPIPE, SIG_IGN);
instance = freerdp_listener_new();
instance->info = (void*) xf_info_init();
instance->PeerAccepted = xf_peer_accepted;
if (argc > 1)

View File

@ -20,6 +20,27 @@
#ifndef __XFREERDP_H
#define __XFREERDP_H
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <freerdp/common/color.h>
struct xf_info
{
int bpp;
int depth;
int width;
int height;
int number;
XImage* image;
Screen* screen;
Visual* visual;
Display* display;
int scanline_pad;
HCLRCONV clrconv;
};
typedef struct xf_info xfInfo;
#endif /* __XFREERDP_H */

View File

@ -238,7 +238,7 @@ static void test_peer_draw_icon(freerdp_peer* client, int x, int y)
info->icon_y = y;
}
void xf_peer_dump_rfx(freerdp_peer* client)
void tf_peer_dump_rfx(freerdp_peer* client)
{
STREAM* s;
uint32 seconds;
@ -278,7 +278,7 @@ void xf_peer_dump_rfx(freerdp_peer* client)
}
}
boolean xf_peer_post_connect(freerdp_peer* client)
boolean tf_peer_post_connect(freerdp_peer* client)
{
/**
* This callback is called when the entire connection sequence is done, i.e. we've received the
@ -308,7 +308,7 @@ boolean xf_peer_post_connect(freerdp_peer* client)
return True;
}
boolean xf_peer_activate(freerdp_peer* client)
boolean tf_peer_activate(freerdp_peer* client)
{
testPeerInfo* info = (testPeerInfo*)client->param1;
@ -318,7 +318,7 @@ boolean xf_peer_activate(freerdp_peer* client)
if (test_pcap_file != NULL)
{
client->update->dump_rfx = True;
xf_peer_dump_rfx(client);
tf_peer_dump_rfx(client);
}
else
{
@ -328,12 +328,12 @@ boolean xf_peer_activate(freerdp_peer* client)
return True;
}
void xf_peer_synchronize_event(rdpInput* input, uint32 flags)
void tf_peer_synchronize_event(rdpInput* input, uint32 flags)
{
printf("Client sent a synchronize event (flags:0x%X)\n", flags);
}
void xf_peer_keyboard_event(rdpInput* input, uint16 flags, uint16 code)
void tf_peer_keyboard_event(rdpInput* input, uint16 flags, uint16 code)
{
freerdp_peer* client = (freerdp_peer*) input->param1;
rdpUpdate* update = client->update;
@ -358,19 +358,19 @@ void xf_peer_keyboard_event(rdpInput* input, uint16 flags, uint16 code)
}
}
void xf_peer_unicode_keyboard_event(rdpInput* input, uint16 code)
void tf_peer_unicode_keyboard_event(rdpInput* input, uint16 code)
{
printf("Client sent a unicode keyboard event (code:0x%X)\n", code);
}
void xf_peer_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y)
void tf_peer_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y)
{
printf("Client sent a mouse event (flags:0x%X pos:%d,%d)\n", flags, x, y);
test_peer_draw_icon(input->param1, x + 10, y);
}
void xf_peer_extended_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y)
void tf_peer_extended_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y)
{
printf("Client sent an extended mouse event (flags:0x%X pos:%d,%d)\n", flags, x, y);
}
@ -395,15 +395,15 @@ static void* test_peer_mainloop(void* arg)
client->settings->nla_security = False;
client->settings->rfx_codec = True;
client->PostConnect = xf_peer_post_connect;
client->Activate = xf_peer_activate;
client->PostConnect = tf_peer_post_connect;
client->Activate = tf_peer_activate;
client->input->param1 = client;
client->input->SynchronizeEvent = xf_peer_synchronize_event;
client->input->KeyboardEvent = xf_peer_keyboard_event;
client->input->UnicodeKeyboardEvent = xf_peer_unicode_keyboard_event;
client->input->MouseEvent = xf_peer_mouse_event;
client->input->ExtendedMouseEvent = xf_peer_extended_mouse_event;
client->input->SynchronizeEvent = tf_peer_synchronize_event;
client->input->KeyboardEvent = tf_peer_keyboard_event;
client->input->UnicodeKeyboardEvent = tf_peer_unicode_keyboard_event;
client->input->MouseEvent = tf_peer_mouse_event;
client->input->ExtendedMouseEvent = tf_peer_extended_mouse_event;
client->Initialize(client);