|
|
|
|
@@ -444,627 +444,6 @@ gdi_bitmap_free(GDI_IMAGE *gdi_bmp)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
|
|
|
|
|
/* GDI callbacks registered in libfreerdp */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_desktop_save(struct rdp_inst * inst, int offset, int x, int y, int cx, int cy)
|
|
|
|
|
{
|
|
|
|
|
DEBUG_GDI("gdi_ui_desktop_save");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_desktop_restore(struct rdp_inst * inst, int offset, int x, int y, int cx, int cy)
|
|
|
|
|
{
|
|
|
|
|
DEBUG_GDI("gdi_ui_desktop_restore");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create a new glyph.
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param width glyph width
|
|
|
|
|
* @param height glyph height
|
|
|
|
|
* @param data glyph data
|
|
|
|
|
* @return new glyph
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static FRDP_HGLYPH
|
|
|
|
|
gdi_ui_create_glyph(struct rdp_inst * inst, int width, int height, uint8 * data)
|
|
|
|
|
{
|
|
|
|
|
uint8* glyph;
|
|
|
|
|
GDI_IMAGE *gdi_bmp;
|
|
|
|
|
|
|
|
|
|
DEBUG_GDI("gdi_ui_create_glyph: width:%d height:%d", width, height);
|
|
|
|
|
|
|
|
|
|
gdi_bmp = (GDI_IMAGE*) malloc(sizeof(GDI_IMAGE));
|
|
|
|
|
|
|
|
|
|
gdi_bmp->hdc = gdi_GetDC();
|
|
|
|
|
gdi_bmp->hdc->bytesPerPixel = 1;
|
|
|
|
|
gdi_bmp->hdc->bitsPerPixel = 1;
|
|
|
|
|
glyph = gdi_glyph_convert(width, height, data);
|
|
|
|
|
gdi_bmp->bitmap = gdi_CreateBitmap(width, height, 1, glyph);
|
|
|
|
|
gdi_bmp->bitmap->bytesPerPixel = 1;
|
|
|
|
|
gdi_bmp->bitmap->bitsPerPixel = 1;
|
|
|
|
|
gdi_SelectObject(gdi_bmp->hdc, (HGDIOBJECT) gdi_bmp->bitmap);
|
|
|
|
|
gdi_bmp->org_bitmap = NULL;
|
|
|
|
|
|
|
|
|
|
return (FRDP_HGLYPH) gdi_bmp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Destroy a glyph.
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param glyph glyph
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_destroy_glyph(struct rdp_inst * inst, FRDP_HGLYPH glyph)
|
|
|
|
|
{
|
|
|
|
|
gdi_bitmap_free((GDI_IMAGE*) glyph);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create a new bitmap.
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param width bitmap width
|
|
|
|
|
* @param height bitmap height
|
|
|
|
|
* @param data bitmap data
|
|
|
|
|
* @return new bitmap
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static FRDP_HBITMAP
|
|
|
|
|
gdi_ui_create_bitmap(struct rdp_inst * inst, int width, int height, uint8* data)
|
|
|
|
|
{
|
|
|
|
|
GDI_IMAGE *gdi_bmp;
|
|
|
|
|
GDI *gdi = GET_GDI(inst);
|
|
|
|
|
|
|
|
|
|
DEBUG_GDI("gdi_ui_create_bitmap: width:%d height:%d", width, height);
|
|
|
|
|
|
|
|
|
|
gdi_bmp = gdi_bitmap_new(gdi, width, height, gdi->dstBpp, data);
|
|
|
|
|
|
|
|
|
|
return (FRDP_HBITMAP) gdi_bmp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Paint a bitmap without persisting it in the bitmap cache.
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param x x position
|
|
|
|
|
* @param y y position
|
|
|
|
|
* @param cx delta x
|
|
|
|
|
* @param cy delta y
|
|
|
|
|
* @param width bitmap width
|
|
|
|
|
* @param height bitmap height
|
|
|
|
|
* @param data bitmap data
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_paint_bitmap(struct rdp_inst * inst, int x, int y, int cx, int cy, int width, int height, uint8 * data)
|
|
|
|
|
{
|
|
|
|
|
GDI_IMAGE *gdi_bmp;
|
|
|
|
|
GDI *gdi = GET_GDI(inst);
|
|
|
|
|
|
|
|
|
|
DEBUG_GDI("ui_paint_bitmap: x:%d y:%d cx:%d cy:%d", x, y, cx, cy);
|
|
|
|
|
|
|
|
|
|
gdi_bmp = (GDI_IMAGE*) inst->ui_create_bitmap(inst, width, height, data);
|
|
|
|
|
gdi_BitBlt(gdi->primary->hdc, x, y, cx, cy, gdi_bmp->hdc, 0, 0, GDI_SRCCOPY);
|
|
|
|
|
inst->ui_destroy_bitmap(inst, (FRDP_HBITMAP) gdi_bmp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Destroy a bitmap.
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param bmp bitmap
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_destroy_bitmap(struct rdp_inst * inst, FRDP_HBITMAP bmp)
|
|
|
|
|
{
|
|
|
|
|
gdi_bitmap_free((GDI_IMAGE*) bmp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Draw a line using a pen.\n
|
|
|
|
|
* LineTo (LINETO_ORDER) @msdn{cc241589}
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param opcode raster operation code
|
|
|
|
|
* @param startx line starting x position
|
|
|
|
|
* @param starty line starting y position
|
|
|
|
|
* @param endx line ending x position
|
|
|
|
|
* @param endy line ending y position
|
|
|
|
|
* @param pen pen
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_line(struct rdp_inst * inst, uint8 opcode, int startx, int starty, int endx, int endy, FRDP_PEN * pen)
|
|
|
|
|
{
|
|
|
|
|
HGDI_PEN hPen;
|
|
|
|
|
int cx, cy;
|
|
|
|
|
uint32 color;
|
|
|
|
|
GDI *gdi = GET_GDI(inst);
|
|
|
|
|
|
|
|
|
|
DEBUG_GDI("ui_line opcode:0x%02X startx:%d starty:%d endx:%d endy:%d", opcode, startx, starty, endx, endy);
|
|
|
|
|
|
|
|
|
|
cx = endx - startx + 1;
|
|
|
|
|
cy = endy - starty + 1;
|
|
|
|
|
|
|
|
|
|
color = gdi_color_convert(pen->color, gdi->srcBpp, 32, gdi->clrconv);
|
|
|
|
|
hPen = gdi_CreatePen(pen->style, pen->width, (GDI_COLOR) color);
|
|
|
|
|
gdi_SelectObject(gdi->drawing->hdc, (HGDIOBJECT) hPen);
|
|
|
|
|
gdi_SetROP2(gdi->drawing->hdc, opcode);
|
|
|
|
|
|
|
|
|
|
gdi_MoveToEx(gdi->drawing->hdc, startx, starty, NULL);
|
|
|
|
|
gdi_LineTo(gdi->drawing->hdc, endx, endy);
|
|
|
|
|
|
|
|
|
|
gdi_DeleteObject((HGDIOBJECT) hPen);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Draw a rectangle using a color.
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param x x position
|
|
|
|
|
* @param y y position
|
|
|
|
|
* @param cx delta x
|
|
|
|
|
* @param cy delta y
|
|
|
|
|
* @param color color
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_rect(struct rdp_inst * inst, int x, int y, int cx, int cy, uint32 color)
|
|
|
|
|
{
|
|
|
|
|
GDI_RECT rect;
|
|
|
|
|
HGDI_BRUSH hBrush;
|
|
|
|
|
uint32 brush_color;
|
|
|
|
|
GDI *gdi = GET_GDI(inst);
|
|
|
|
|
|
|
|
|
|
DEBUG_GDI("ui_rect: x:%d y:%d cx:%d cy:%d", x, y, cx, cy);
|
|
|
|
|
|
|
|
|
|
gdi_CRgnToRect(x, y, cx, cy, &rect);
|
|
|
|
|
brush_color = gdi_color_convert(color, gdi->srcBpp, 32, gdi->clrconv);
|
|
|
|
|
|
|
|
|
|
hBrush = gdi_CreateSolidBrush(brush_color);
|
|
|
|
|
gdi_FillRect(gdi->drawing->hdc, &rect, hBrush);
|
|
|
|
|
gdi_DeleteObject((HGDIOBJECT) hBrush);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Draw a polygon using a brush.\n
|
|
|
|
|
* PolygonSC (POLYGON_SC_ORDER) @msdn{cc241594}\n
|
|
|
|
|
* PolygonCB (POLYGON_CB_ORDER) @msdn{cc241595}
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param opcode raster operation code
|
|
|
|
|
* @param fillmode fill mode
|
|
|
|
|
* @param point array of points
|
|
|
|
|
* @param npoints number of points
|
|
|
|
|
* @param brush brush
|
|
|
|
|
* @param bgcolor background color
|
|
|
|
|
* @param fgcolor foreground color
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_polygon(struct rdp_inst * inst, uint8 opcode, uint8 fillmode, FRDP_POINT * point, int npoints, FRDP_BRUSH * brush, uint32 bgcolor, uint32 fgcolor)
|
|
|
|
|
{
|
|
|
|
|
DEBUG_GDI("ui_polygon");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Draw a solid color polyline.\n
|
|
|
|
|
* Polyline (POLYLINE_ORDER) @msdn{cc241596}
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param opcode raster operation code
|
|
|
|
|
* @param points array of points
|
|
|
|
|
* @param npoints number of points
|
|
|
|
|
* @param pen pen
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_polyline(struct rdp_inst * inst, uint8 opcode, FRDP_POINT * points, int npoints, FRDP_PEN * pen)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
HGDI_PEN hPen;
|
|
|
|
|
int cx, cy;
|
|
|
|
|
uint32 color;
|
|
|
|
|
GDI *gdi = GET_GDI(inst);
|
|
|
|
|
|
|
|
|
|
DEBUG_GDI("ui_polyline: opcode:%d npoints:%d", opcode, npoints);
|
|
|
|
|
|
|
|
|
|
color = gdi_color_convert(pen->color, gdi->srcBpp, 32, gdi->clrconv);
|
|
|
|
|
|
|
|
|
|
hPen = gdi_CreatePen(pen->style, pen->width, (GDI_COLOR) color);
|
|
|
|
|
gdi_SelectObject(gdi->drawing->hdc, (HGDIOBJECT) hPen);
|
|
|
|
|
gdi_SetROP2(gdi->drawing->hdc, opcode);
|
|
|
|
|
|
|
|
|
|
cx = points[0].x;
|
|
|
|
|
cy = points[0].y;
|
|
|
|
|
for(i = 1; i < npoints; i++)
|
|
|
|
|
{
|
|
|
|
|
gdi_MoveToEx(gdi->drawing->hdc, cx, cy, NULL);
|
|
|
|
|
cx += points[i].x;
|
|
|
|
|
cy += points[i].y;
|
|
|
|
|
gdi_LineTo(gdi->drawing->hdc, cx, cy);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gdi_DeleteObject((HGDIOBJECT) hPen);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Draw an ellipse using a brush.\n
|
|
|
|
|
* EclipseSC (ELLIPSE_SC_ORDER) @msdn{cc241597}\n
|
|
|
|
|
* EclipseCB (ELLIPSE_CB_ORDER) @msdn{cc241599}
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param opcode raster operation code
|
|
|
|
|
* @param fillmode fill mode
|
|
|
|
|
* @param x x position
|
|
|
|
|
* @param y y position
|
|
|
|
|
* @param cx delta x
|
|
|
|
|
* @param cy delta y
|
|
|
|
|
* @param brush brush
|
|
|
|
|
* @param bgcolor background color
|
|
|
|
|
* @param fgcolor foreground color
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_ellipse(struct rdp_inst * inst, uint8 opcode, uint8 fillmode, int x, int y, int cx, int cy, FRDP_BRUSH * brush, uint32 bgcolor, uint32 fgcolor)
|
|
|
|
|
{
|
|
|
|
|
DEBUG_GDI("ui_ellipse");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Start drawing a set of glyphs.
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param bgcolor background color
|
|
|
|
|
* @param fgcolor foreground color
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_start_draw_glyphs(struct rdp_inst * inst, uint32 bgcolor, uint32 fgcolor)
|
|
|
|
|
{
|
|
|
|
|
uint32 color;
|
|
|
|
|
GDI *gdi = GET_GDI(inst);
|
|
|
|
|
color = gdi_color_convert(fgcolor, gdi->srcBpp, 32, gdi->clrconv);
|
|
|
|
|
gdi->textColor = gdi_SetTextColor(gdi->drawing->hdc, color);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Draw a single glyph.
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param x x position
|
|
|
|
|
* @param y y position
|
|
|
|
|
* @param cx delta x
|
|
|
|
|
* @param cy delta y
|
|
|
|
|
* @param glyph glyph
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_draw_glyph(struct rdp_inst * inst, int x, int y, int cx, int cy, FRDP_HGLYPH glyph)
|
|
|
|
|
{
|
|
|
|
|
GDI_IMAGE* gdi_bmp;
|
|
|
|
|
GDI *gdi = GET_GDI(inst);
|
|
|
|
|
|
|
|
|
|
gdi_bmp = (GDI_IMAGE*) glyph;
|
|
|
|
|
gdi_BitBlt(gdi->drawing->hdc, x, y, cx, cy, gdi_bmp->hdc, 0, 0, GDI_DSPDxax);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* End drawing a set of glyphs.
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param x x position
|
|
|
|
|
* @param y y position
|
|
|
|
|
* @param cx delta x
|
|
|
|
|
* @param cy delta y
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_end_draw_glyphs(struct rdp_inst * inst, int x, int y, int cx, int cy)
|
|
|
|
|
{
|
|
|
|
|
GDI *gdi = GET_GDI(inst);
|
|
|
|
|
gdi_SetTextColor(gdi->drawing->hdc, gdi->textColor);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* DstBlt (DSTBLT_ORDER) primary drawing order.\n
|
|
|
|
|
* @msdn{cc241587}
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param opcode raster operation code
|
|
|
|
|
* @param x x position
|
|
|
|
|
* @param y y position
|
|
|
|
|
* @param cx delta x
|
|
|
|
|
* @param cy delta y
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_destblt(struct rdp_inst * inst, uint8 opcode, int x, int y, int cx, int cy)
|
|
|
|
|
{
|
|
|
|
|
GDI *gdi = GET_GDI(inst);
|
|
|
|
|
|
|
|
|
|
DEBUG_GDI("ui_destblt: x: %d y: %d cx: %d cy: %d rop: 0x%X", x, y, cx, cy, rop3_code_table[opcode]);
|
|
|
|
|
gdi_BitBlt(gdi->drawing->hdc, x, y, cx, cy, NULL, 0, 0, gdi_rop3_code(opcode));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* PatBlt (PATBLT_ORDER) primary drawing order.\n
|
|
|
|
|
* @msdn{cc241602}
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param opcode raster operation code
|
|
|
|
|
* @param x x position
|
|
|
|
|
* @param y y position
|
|
|
|
|
* @param cx delta x
|
|
|
|
|
* @param cy delta y
|
|
|
|
|
* @param brush brush
|
|
|
|
|
* @param bgcolor background color
|
|
|
|
|
* @param fgcolor foreground color
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_patblt(struct rdp_inst * inst, uint8 opcode, int x, int y, int cx, int cy, FRDP_BRUSH * brush, uint32 bgcolor, uint32 fgcolor)
|
|
|
|
|
{
|
|
|
|
|
HGDI_BRUSH originalBrush;
|
|
|
|
|
GDI *gdi = GET_GDI(inst);
|
|
|
|
|
|
|
|
|
|
DEBUG_GDI("ui_patblt: x: %d y: %d cx: %d cy: %d rop: 0x%X", x, y, cx, cy, gdi_rop3_code(opcode));
|
|
|
|
|
|
|
|
|
|
if (brush->style == GDI_BS_PATTERN)
|
|
|
|
|
{
|
|
|
|
|
uint8* data;
|
|
|
|
|
HGDI_BITMAP hBmp;
|
|
|
|
|
|
|
|
|
|
if (brush->bd->color_code > 1)
|
|
|
|
|
data = gdi_image_convert(brush->bd->data, NULL, 8, 8, gdi->srcBpp, gdi->dstBpp, gdi->clrconv);
|
|
|
|
|
else
|
|
|
|
|
data = gdi_mono_image_convert(brush->bd->data, 8, 8, gdi->srcBpp, gdi->dstBpp, bgcolor, fgcolor, gdi->clrconv);
|
|
|
|
|
|
|
|
|
|
hBmp = gdi_CreateBitmap(8, 8, gdi->drawing->hdc->bitsPerPixel, data);
|
|
|
|
|
|
|
|
|
|
originalBrush = gdi->drawing->hdc->brush;
|
|
|
|
|
gdi->drawing->hdc->brush = gdi_CreatePatternBrush(hBmp);
|
|
|
|
|
|
|
|
|
|
gdi_PatBlt(gdi->drawing->hdc, x, y, cx, cy, gdi_rop3_code(opcode));
|
|
|
|
|
|
|
|
|
|
gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush);
|
|
|
|
|
gdi->drawing->hdc->brush = originalBrush;
|
|
|
|
|
}
|
|
|
|
|
else if (brush->style == GDI_BS_SOLID)
|
|
|
|
|
{
|
|
|
|
|
uint32 color;
|
|
|
|
|
originalBrush = gdi->drawing->hdc->brush;
|
|
|
|
|
|
|
|
|
|
color = gdi_color_convert(fgcolor, gdi->srcBpp, 32, gdi->clrconv);
|
|
|
|
|
gdi->drawing->hdc->brush = gdi_CreateSolidBrush(color);
|
|
|
|
|
|
|
|
|
|
gdi_PatBlt(gdi->drawing->hdc, x, y, cx, cy, gdi_rop3_code(opcode));
|
|
|
|
|
|
|
|
|
|
gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush);
|
|
|
|
|
gdi->drawing->hdc->brush = originalBrush;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
printf("ui_patblt: unknown brush style: %d\n", brush->style);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ScrBlt (SCRBLT_ORDER) primary drawing order.\n
|
|
|
|
|
* @msdn{cc241606}
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param opcode raster operation code
|
|
|
|
|
* @param x x position
|
|
|
|
|
* @param y y position
|
|
|
|
|
* @param cx delta x
|
|
|
|
|
* @param cy delta y
|
|
|
|
|
* @param srcx source x position
|
|
|
|
|
* @param srcy source y position
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_screenblt(struct rdp_inst * inst, uint8 opcode, int x, int y, int cx, int cy, int srcx, int srcy)
|
|
|
|
|
{
|
|
|
|
|
GDI *gdi = GET_GDI(inst);
|
|
|
|
|
|
|
|
|
|
DEBUG_GDI("gdi_ui_screenblt x:%d y:%d cx:%d cy:%d srcx:%d srcy:%d rop:0x%X",
|
|
|
|
|
x, y, cx, cy, srcx, srcy, rop3_code_table[opcode]);
|
|
|
|
|
|
|
|
|
|
gdi_BitBlt(gdi->drawing->hdc, x, y, cx, cy, gdi->primary->hdc, srcx, srcy, gdi_rop3_code(opcode));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* MemBlt (MEMBLT_ORDER) primary drawing order.\n
|
|
|
|
|
* @msdn{cc241608}
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param opcode raster operation code
|
|
|
|
|
* @param x x position
|
|
|
|
|
* @param y y position
|
|
|
|
|
* @param cx delta x
|
|
|
|
|
* @param cy delta y
|
|
|
|
|
* @param src source bitmap
|
|
|
|
|
* @param srcx source bitmap x position
|
|
|
|
|
* @param srcy source bitmap y position
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_memblt(struct rdp_inst * inst, uint8 opcode, int x, int y, int cx, int cy, FRDP_HBITMAP src, int srcx, int srcy)
|
|
|
|
|
{
|
|
|
|
|
GDI_IMAGE *gdi_bmp;
|
|
|
|
|
GDI *gdi = GET_GDI(inst);
|
|
|
|
|
|
|
|
|
|
DEBUG_GDI("gdi_ui_memblt: x:%d y:%d cx:%d cy:%d srcx:%d, srcy:%d rop:0x%X",
|
|
|
|
|
x, y, cx, cy, srcx, srcy, gdi_rop3_code(opcode));
|
|
|
|
|
|
|
|
|
|
gdi_bmp = (GDI_IMAGE*) src;
|
|
|
|
|
gdi_BitBlt(gdi->drawing->hdc, x, y, cx, cy, gdi_bmp->hdc, srcx, srcy, gdi_rop3_code(opcode));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Mem3Blt (MEM3BLT_ORDER) primary drawing order.\n
|
|
|
|
|
* @msdn{cc241588}
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param opcode raster operation code
|
|
|
|
|
* @param x x position
|
|
|
|
|
* @param y y position
|
|
|
|
|
* @param cx delta x
|
|
|
|
|
* @param cy delta y
|
|
|
|
|
* @param src source bitmap
|
|
|
|
|
* @param srcx source bitmap x position
|
|
|
|
|
* @param srcy source bitmap y position
|
|
|
|
|
* @param brush brush
|
|
|
|
|
* @param bgcolor background color
|
|
|
|
|
* @param fgcolor foreground color
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_mem3blt(struct rdp_inst * inst, uint8 opcode, int x, int y, int cx, int cy,
|
|
|
|
|
FRDP_HBITMAP src, int srcx, int srcy, FRDP_BRUSH * brush, uint32 bgcolor, uint32 fgcolor)
|
|
|
|
|
{
|
|
|
|
|
DEBUG_GDI("gdi_ui_mem3blt opcode: 0x%X", rop3_code_table[opcode]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Cache color table (CACHE_COLOR_TABLE_ORDER).\n
|
|
|
|
|
* @msdn{cc241617}
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param colors color table
|
|
|
|
|
* @return new palette created from color table
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static FRDP_HPALETTE
|
|
|
|
|
gdi_ui_create_palette(struct rdp_inst * inst, FRDP_PALETTE * palette)
|
|
|
|
|
{
|
|
|
|
|
DEBUG_GDI("gdi_ui_create_palette");
|
|
|
|
|
return (FRDP_HPALETTE) gdi_CreatePalette((HGDI_PALETTE) palette);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set the current palette.
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param palette new color palette
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_set_palette(struct rdp_inst * inst, FRDP_HPALETTE palette)
|
|
|
|
|
{
|
|
|
|
|
GDI *gdi = GET_GDI(inst);
|
|
|
|
|
DEBUG_GDI("gdi_ui_set_palette");
|
|
|
|
|
gdi->clrconv->palette = (FRDP_PALETTE*) palette;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set current clipping region.
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param x x position
|
|
|
|
|
* @param y y position
|
|
|
|
|
* @param cx delta x
|
|
|
|
|
* @param cy delta y
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_set_clipping_region(struct rdp_inst * inst, int x, int y, int cx, int cy)
|
|
|
|
|
{
|
|
|
|
|
GDI *gdi = GET_GDI(inst);
|
|
|
|
|
gdi_SetClipRgn(gdi->drawing->hdc, x, y, cx, cy);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Reset the current clipping region.
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_reset_clipping_region(struct rdp_inst * inst)
|
|
|
|
|
{
|
|
|
|
|
GDI *gdi = GET_GDI(inst);
|
|
|
|
|
gdi_SetNullClipRgn(gdi->drawing->hdc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create new drawing surface
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param width surface width
|
|
|
|
|
* @param height surface height
|
|
|
|
|
* @param old_surface old drawing surface
|
|
|
|
|
* @return new drawing surface
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static FRDP_HBITMAP
|
|
|
|
|
gdi_ui_create_surface(struct rdp_inst * inst, int width, int height, FRDP_HBITMAP old_surface)
|
|
|
|
|
{
|
|
|
|
|
GDI_IMAGE *gdi_bmp;
|
|
|
|
|
GDI_IMAGE *old_gdi_bmp;
|
|
|
|
|
GDI *gdi = GET_GDI(inst);
|
|
|
|
|
|
|
|
|
|
gdi_bmp = gdi_bitmap_new(gdi, width, height, gdi->dstBpp, NULL);
|
|
|
|
|
old_gdi_bmp = (GDI_IMAGE*) old_surface;
|
|
|
|
|
|
|
|
|
|
if (old_gdi_bmp != 0)
|
|
|
|
|
{
|
|
|
|
|
gdi_bitmap_free(old_gdi_bmp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (gdi->drawing == old_gdi_bmp)
|
|
|
|
|
{
|
|
|
|
|
gdi->drawing = gdi_bmp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DEBUG_GDI("ui_create_surface");
|
|
|
|
|
|
|
|
|
|
return (FRDP_HBITMAP) gdi_bmp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Switch Surface (SWITCH_SURFACE_ORDER).
|
|
|
|
|
* @msdn{cc241630}
|
|
|
|
|
* @param inst current instance
|
|
|
|
|
* @param surface new surface
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_switch_surface(struct rdp_inst * inst, FRDP_HBITMAP surface)
|
|
|
|
|
{
|
|
|
|
|
GDI *gdi = GET_GDI(inst);
|
|
|
|
|
|
|
|
|
|
DEBUG_GDI("ui_switch_surface");
|
|
|
|
|
|
|
|
|
|
if (surface != 0)
|
|
|
|
|
{
|
|
|
|
|
gdi->drawing = (GDI_IMAGE*) surface;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gdi->drawing = (GDI_IMAGE*) gdi->primary;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Destroy a surface.
|
|
|
|
|
* @param inst
|
|
|
|
|
* @param surface
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gdi_ui_destroy_surface(struct rdp_inst * inst, FRDP_HBITMAP surface)
|
|
|
|
|
{
|
|
|
|
|
GDI *gdi = GET_GDI(inst);
|
|
|
|
|
|
|
|
|
|
DEBUG_GDI("ui_destroy_surface");
|
|
|
|
|
|
|
|
|
|
if (gdi->drawing == surface)
|
|
|
|
|
{
|
|
|
|
|
gdi->drawing = gdi->primary;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (surface != 0)
|
|
|
|
|
{
|
|
|
|
|
gdi_bitmap_free((GDI_IMAGE*) surface);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
gdi_ui_decode(struct rdp_inst * inst, uint8 * data, int size)
|
|
|
|
|
{
|
|
|
|
|
GDI *gdi = GET_GDI(inst);
|
|
|
|
|
gdi_decode_data(gdi, data, size);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
void gdi_bitmap_update(rdpUpdate* update, BITMAP_UPDATE* bitmap)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|