diff --git a/client/DirectFB/dfreerdp.c b/client/DirectFB/dfreerdp.c index 6acef6224..b7c27c7c4 100644 --- a/client/DirectFB/dfreerdp.c +++ b/client/DirectFB/dfreerdp.c @@ -164,8 +164,6 @@ int dfreerdp_run(freerdp* instance) memset(rfds, 0, sizeof(rfds)); memset(wfds, 0, sizeof(wfds)); - printf("DirectFB Run\n"); - instance->Connect(instance); while (1) diff --git a/include/freerdp/update.h b/include/freerdp/update.h index 7164178ec..ef7c5f09e 100644 --- a/include/freerdp/update.h +++ b/include/freerdp/update.h @@ -64,6 +64,8 @@ typedef struct /* Orders Updates */ +/* Primary Drawing Orders */ + typedef struct { uint8 orderType; @@ -384,6 +386,218 @@ typedef struct uint8* data; } GLYPH_INDEX_ORDER; +/* Secondary Drawing Orders */ + +typedef struct +{ + uint8 cacheId; + uint8 bitmapBpp; + uint8 bitmapWidth; + uint8 bitmapHeight; + uint16 bitmapLength; + uint16 cacheIndex; + uint8* bitmapComprHdr; + uint8* bitmapDataStream; +} CACHE_BITMAP_ORDER; + +typedef struct +{ + uint8 cacheId; + uint16 flags; + uint32 key1; + uint32 key2; + uint8 bitmapBpp; + uint8 bitmapWidth; + uint8 bitmapHeight; + uint16 bitmapLength; + uint16 cacheIndex; + uint8* bitmapComprHdr; + uint8* bitmapDataStream; +} CACHE_BITMAP_V2_ORDER; + +typedef struct +{ + uint8 cacheId; + uint8 bpp; + uint16 flags; + uint16 cacheIndex; + uint32 key1; + uint32 key2; + uint8* bitmapData; +} CACHE_BITMAP_V3_ORDER; + +typedef struct +{ + uint8 cacheIndex; + uint16 numberColors; + uint32* colorTable; +} CACHE_COLOR_TABLE_ORDER; + +typedef struct +{ + uint16 cacheIndex; + uint16 x; + uint16 y; + uint16 cx; + uint16 cy; + uint8* aj; +} GLYPH_DATA; + +typedef struct +{ + uint8 cacheId; + uint8 cGlyphs; + GLYPH_DATA* glyphData; + uint8* unicodeCharacters; +} CACHE_GLYPH_ORDER; + +typedef struct +{ + uint8 cacheIndex; + sint16 x; + sint16 y; + uint16 cx; + uint16 cy; + uint8* aj; +} GLYPH_DATA_V2; + +typedef struct +{ + uint8 cacheId; + uint8 flags; + uint8 cGlyphs; + GLYPH_DATA_V2* glyphData; + uint8* unicodeCharacters; +} CACHE_GLYPH_V2_ORDER; + +typedef struct +{ + uint8 cacheEntry; + uint8 iBitmapFormat; + uint8 cx; + uint8 cy; + uint8 style; + uint8 iBytes; + uint8* brushData; +} CACHE_BRUSH_ORDER; + +/* Alternate Secondary Drawing Orders */ + +typedef struct +{ + uint16 cIndices; + uint16* indices; +} OFFSCREEN_DELETE_LIST; + +typedef struct +{ + uint16 offscreenBitmapId; + uint16 cx; + uint16 cy; + OFFSCREEN_DELETE_LIST deleteList; +} CREATE_OFFSCREEN_BITMAP_ORDER; + +typedef struct +{ + uint16 bitmapId; +} SWITCH_SURFACE_ORDER; + +typedef struct +{ + uint32 flFlags; + uint16 ulLeftWidth; + uint16 ulRightWidth; + uint16 ulTopHeight; + uint16 ulBottomHeight; + uint32 crTransparent; +} NINE_GRID_BITMAP_INFO; + +typedef struct +{ + uint8 bitmapBpp; + uint16 bitmapId; + uint16 cx; + uint16 cy; + NINE_GRID_BITMAP_INFO nineGridInfo; +} CREATE_NINE_GRID_BITMAP_ORDER; + +typedef struct +{ + uint32 action; +} FRAME_MARKER_ORDER; + +typedef struct +{ + +} STREAM_BITMAP_FIRST_ORDER; + +typedef struct +{ + +} STREAM_BITMAP_NEXT_ORDER; + +typedef struct +{ + +} DRAW_GDIPLUS_FIRST_ORDER; + +typedef struct +{ + +} DRAW_GDIPLUS_NEXT_ORDER; + +typedef struct +{ + +} DRAW_GDIPLUS_END_ORDER; + +typedef struct +{ + +} DRAW_GDIPLUS_CACHE_FIRST_ORDER; + +typedef struct +{ + +} DRAW_GDIPLUS_CACHE_NEXT_ORDER; + +typedef struct +{ + +} DRAW_GDIPLUS_CACHE_END_ORDER; + +/* Constants */ + +#define CACHED_BRUSH 0x80 + +#define BMF_1BPP 0x1 +#define BMF_8BPP 0x3 +#define BMF_16BPP 0x4 +#define BMF_24BPP 0x5 +#define BMF_32BPP 0x6 + +#define BS_SOLID 0x00 +#define BS_NULL 0x01 +#define BS_HATCHED 0x02 +#define BS_PATTERN 0x03 + +#define HS_HORIZONTAL 0x00 +#define HS_VERTICAL 0x01 +#define HS_FDIAGONAL 0x02 +#define HS_BDIAGONAL 0x03 +#define HS_CROSS 0x04 +#define HS_DIAGCROSS 0x05 + +#define DSDNG_STRETCH 0x00000001 +#define DSDNG_TILE 0x00000002 +#define DSDNG_PERPIXELALPHA 0x00000004 +#define DSDNG_TRANSPARENT 0x00000008 +#define DSDNG_MUSTFLIP 0x00000010 +#define DSDNG_TRUESIZE 0x00000020 + +#define FRAME_START 0x00000000 +#define FRAME_END 0x00000001 + /* Update Interface */ typedef struct rdp_update rdpUpdate; @@ -394,28 +608,50 @@ typedef void (*pcSetBounds)(rdpUpdate* update, BOUNDS* bounds); typedef void (*pcSynchronize)(rdpUpdate* update); typedef void (*pcBitmap)(rdpUpdate* update, BITMAP_UPDATE* bitmap); typedef void (*pcPalette)(rdpUpdate* update, PALETTE_UPDATE* palette); + typedef void (*pcDstBlt)(rdpUpdate* update, DSTBLT_ORDER* dstblt); typedef void (*pcPatBlt)(rdpUpdate* update, PATBLT_ORDER* patblt); typedef void (*pcScrBlt)(rdpUpdate* update, SCRBLT_ORDER* scrblt); -typedef void (*pcDrawNineGrid)(rdpUpdate* update, DRAW_NINE_GRID_ORDER* draw_nine_grid); -typedef void (*pcMultiDrawNineGrid)(rdpUpdate* update, MULTI_DRAW_NINE_GRID_ORDER* multi_draw_nine_grid); -typedef void (*pcLineTo)(rdpUpdate* update, LINE_TO_ORDER* line_to); typedef void (*pcOpaqueRect)(rdpUpdate* update, OPAQUE_RECT_ORDER* opaque_rect); -typedef void (*pcSaveBitmap)(rdpUpdate* update, SAVE_BITMAP_ORDER* save_bitmap); -typedef void (*pcMemBlt)(rdpUpdate* update, MEMBLT_ORDER* memblt); -typedef void (*pcMem3Blt)(rdpUpdate* update, MEM3BLT_ORDER* memblt); +typedef void (*pcDrawNineGrid)(rdpUpdate* update, DRAW_NINE_GRID_ORDER* draw_nine_grid); typedef void (*pcMultiDstBlt)(rdpUpdate* update, MULTI_DSTBLT_ORDER* multi_dstblt); typedef void (*pcMultiPatBlt)(rdpUpdate* update, MULTI_PATBLT_ORDER* multi_patblt); typedef void (*pcMultiScrBlt)(rdpUpdate* update, MULTI_SCRBLT_ORDER* multi_scrblt); typedef void (*pcMultiOpaqueRect)(rdpUpdate* update, MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect); +typedef void (*pcMultiDrawNineGrid)(rdpUpdate* update, MULTI_DRAW_NINE_GRID_ORDER* multi_draw_nine_grid); +typedef void (*pcLineTo)(rdpUpdate* update, LINE_TO_ORDER* line_to); +typedef void (*pcPolyline)(rdpUpdate* update, POLYLINE_ORDER* polyline); +typedef void (*pcMemBlt)(rdpUpdate* update, MEMBLT_ORDER* memblt); +typedef void (*pcMem3Blt)(rdpUpdate* update, MEM3BLT_ORDER* memblt); +typedef void (*pcSaveBitmap)(rdpUpdate* update, SAVE_BITMAP_ORDER* save_bitmap); typedef void (*pcFastIndex)(rdpUpdate* update, FAST_INDEX_ORDER* fast_index); +typedef void (*pcFastGlyph)(rdpUpdate* update, FAST_GLYPH_ORDER* fast_glyph); +typedef void (*pcGlyphIndex)(rdpUpdate* update, GLYPH_INDEX_ORDER* glyph_index); typedef void (*pcPolygonSC)(rdpUpdate* update, POLYGON_SC_ORDER* polygon_sc); typedef void (*pcPolygonCB)(rdpUpdate* update, POLYGON_CB_ORDER* polygon_cb); -typedef void (*pcPolyline)(rdpUpdate* update, POLYLINE_ORDER* polyline); -typedef void (*pcFastGlyph)(rdpUpdate* update, FAST_GLYPH_ORDER* fast_glyph); typedef void (*pcEllipseSC)(rdpUpdate* update, ELLIPSE_SC_ORDER* ellipse_sc); typedef void (*pcEllipseCB)(rdpUpdate* update, ELLIPSE_CB_ORDER* ellipse_cb); -typedef void (*pcGlyphIndex)(rdpUpdate* update, GLYPH_INDEX_ORDER* glyph_index); + +typedef void (*pcCacheBitmap)(rdpUpdate* update, CACHE_BITMAP_ORDER* cache_bitmap_order); +typedef void (*pcCacheBitmapV2)(rdpUpdate* update, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2_order); +typedef void (*pcCacheBitmapV3)(rdpUpdate* update, CACHE_BITMAP_V3_ORDER* cache_bitmap_v3_order); +typedef void (*pcCacheColorTable)(rdpUpdate* update, CACHE_COLOR_TABLE_ORDER* cache_color_table_order); +typedef void (*pcCacheGlyph)(rdpUpdate* update, CACHE_GLYPH_ORDER* cache_glyph_order); +typedef void (*pcCacheGlyphV2)(rdpUpdate* update, CACHE_GLYPH_V2_ORDER* cache_glyph_v2_order); +typedef void (*pcCacheBrush)(rdpUpdate* update, CACHE_BRUSH_ORDER* cache_brush_order); + +typedef void (*pcCreateOffscreenBitmap)(rdpUpdate* update, CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap); +typedef void (*pcSwitchSurface)(rdpUpdate* update, SWITCH_SURFACE_ORDER* switch_surface); +typedef void (*pcCreateNineGridBitmap)(rdpUpdate* update, CREATE_NINE_GRID_BITMAP_ORDER* create_nine_grid_bitmap); +typedef void (*pcFrameMarker)(rdpUpdate* update, FRAME_MARKER_ORDER* frame_marker); +typedef void (*pcStreamBitmapFirst)(rdpUpdate* update, STREAM_BITMAP_FIRST_ORDER* stream_bitmap_first); +typedef void (*pcStreamBitmapNext)(rdpUpdate* update, STREAM_BITMAP_FIRST_ORDER* stream_bitmap_next); +typedef void (*pcDrawGdiPlusFirst)(rdpUpdate* update, DRAW_GDIPLUS_FIRST_ORDER* draw_gdiplus_first); +typedef void (*pcDrawGdiPlusNext)(rdpUpdate* update, DRAW_GDIPLUS_NEXT_ORDER* draw_gdiplus_next); +typedef void (*pcDrawGdiPlusEnd)(rdpUpdate* update, DRAW_GDIPLUS_END_ORDER* draw_gdiplus_end); +typedef void (*pcDrawGdiPlusCacheFirst)(rdpUpdate* update, DRAW_GDIPLUS_CACHE_FIRST_ORDER* draw_gdiplus_cache_first); +typedef void (*pcDrawGdiPlusCacheNext)(rdpUpdate* update, DRAW_GDIPLUS_CACHE_NEXT_ORDER* draw_gdiplus_cache_next); +typedef void (*pcDrawGdiPlusCacheEnd)(rdpUpdate* update, DRAW_GDIPLUS_CACHE_END_ORDER* draw_gdiplus_cache_end); struct rdp_update { @@ -430,54 +666,99 @@ struct rdp_update pcSynchronize Synchronize; pcBitmap Bitmap; pcPalette Palette; + pcDstBlt DstBlt; pcPatBlt PatBlt; pcScrBlt ScrBlt; - pcDrawNineGrid DrawNineGrid; - pcMultiDrawNineGrid MultiDrawNineGrid; - pcLineTo LineTo; pcOpaqueRect OpaqueRect; - pcSaveBitmap SaveBitmap; - pcMemBlt MemBlt; - pcMem3Blt Mem3Blt; + pcDrawNineGrid DrawNineGrid; pcMultiDstBlt MultiDstBlt; pcMultiPatBlt MultiPatBlt; pcMultiScrBlt MultiScrBlt; pcMultiOpaqueRect MultiOpaqueRect; + pcMultiDrawNineGrid MultiDrawNineGrid; + pcLineTo LineTo; + pcPolyline Polyline; + pcMemBlt MemBlt; + pcMem3Blt Mem3Blt; + pcSaveBitmap SaveBitmap; pcFastIndex FastIndex; + pcFastGlyph FastGlyph; + pcGlyphIndex GlyphIndex; pcPolygonSC PolygonSC; pcPolygonCB PolygonCB; - pcPolyline Polyline; - pcFastGlyph FastGlyph; pcEllipseSC EllipseSC; pcEllipseCB EllipseCB; - pcGlyphIndex GlyphIndex; + + boolean glyph_v2; + pcCacheBitmap CacheBitmap; + pcCacheBitmapV2 CacheBitmapV2; + pcCacheBitmapV3 CacheBitmapV3; + pcCacheColorTable CacheColorTable; + pcCacheGlyph CacheGlyph; + pcCacheGlyphV2 CacheGlyphV2; + pcCacheBrush CacheBrush; + + pcCreateOffscreenBitmap CreateOffscreenBitmap; + pcSwitchSurface SwitchSurface; + pcCreateNineGridBitmap CreateNineGridBitmap; + pcFrameMarker FrameMarker; + pcStreamBitmapFirst StreamBitmapFirst; + pcStreamBitmapNext StreamBitmapNext; + pcDrawGdiPlusFirst DrawGdiPlusFirst; + pcDrawGdiPlusNext DrawGdiPlusNext; + pcDrawGdiPlusEnd DrawGdiPlusEnd; + pcDrawGdiPlusCacheFirst DrawGdiPlusCacheFirst; + pcDrawGdiPlusCacheNext DrawGdiPlusCacheNext; + pcDrawGdiPlusCacheEnd DrawGdiPlusCacheEnd; BITMAP_UPDATE bitmap_update; PALETTE_UPDATE palette_update; ORDER_INFO order_info; + DSTBLT_ORDER dstblt; PATBLT_ORDER patblt; SCRBLT_ORDER scrblt; - DRAW_NINE_GRID_ORDER draw_nine_grid; - MULTI_DRAW_NINE_GRID_ORDER multi_draw_nine_grid; - LINE_TO_ORDER line_to; OPAQUE_RECT_ORDER opaque_rect; - SAVE_BITMAP_ORDER save_bitmap; - MEMBLT_ORDER memblt; - MEM3BLT_ORDER mem3blt; + DRAW_NINE_GRID_ORDER draw_nine_grid; MULTI_DSTBLT_ORDER multi_dstblt; MULTI_PATBLT_ORDER multi_patblt; MULTI_SCRBLT_ORDER multi_scrblt; MULTI_OPAQUE_RECT_ORDER multi_opaque_rect; + MULTI_DRAW_NINE_GRID_ORDER multi_draw_nine_grid; + LINE_TO_ORDER line_to; + POLYLINE_ORDER polyline; + MEMBLT_ORDER memblt; + MEM3BLT_ORDER mem3blt; + SAVE_BITMAP_ORDER save_bitmap; FAST_INDEX_ORDER fast_index; + FAST_GLYPH_ORDER fast_glyph; + GLYPH_INDEX_ORDER glyph_index; POLYGON_SC_ORDER polygon_sc; POLYGON_CB_ORDER polygon_cb; - POLYLINE_ORDER polyline; - FAST_GLYPH_ORDER fast_glyph; ELLIPSE_SC_ORDER ellipse_sc; ELLIPSE_CB_ORDER ellipse_cb; - GLYPH_INDEX_ORDER glyph_index; + + CACHE_BITMAP_ORDER cache_bitmap_order; + CACHE_BITMAP_V2_ORDER cache_bitmap_v2_order; + CACHE_BITMAP_V3_ORDER cache_bitmap_v3_order; + CACHE_COLOR_TABLE_ORDER cache_color_table_order; + CACHE_GLYPH_ORDER cache_glyph_order; + CACHE_GLYPH_V2_ORDER cache_glyph_v2_order; + CACHE_BRUSH_ORDER cache_brush_order; + + CREATE_OFFSCREEN_BITMAP_ORDER create_offscreen_bitmap; + SWITCH_SURFACE_ORDER switch_surface; + CREATE_NINE_GRID_BITMAP_ORDER create_nine_grid_bitmap; + FRAME_MARKER_ORDER frame_marker; + STREAM_BITMAP_FIRST_ORDER stream_bitmap_first; + STREAM_BITMAP_FIRST_ORDER stream_bitmap_next; + DRAW_GDIPLUS_CACHE_FIRST_ORDER draw_gdiplus_cache_first; + DRAW_GDIPLUS_CACHE_NEXT_ORDER draw_gdiplus_cache_next; + DRAW_GDIPLUS_CACHE_END_ORDER draw_gdiplus_cache_end; + DRAW_GDIPLUS_FIRST_ORDER draw_gdiplus_first; + DRAW_GDIPLUS_NEXT_ORDER draw_gdiplus_next; + DRAW_GDIPLUS_END_ORDER draw_gdiplus_end; }; #endif /* __UPDATE_API_H */ diff --git a/libfreerdp-core/orders.c b/libfreerdp-core/orders.c index c35eecc40..b2f54c6e9 100644 --- a/libfreerdp-core/orders.c +++ b/libfreerdp-core/orders.c @@ -214,49 +214,6 @@ void update_read_scrblt_order(STREAM* s, ORDER_INFO* orderInfo, SCRBLT_ORDER* sc update_read_coord(s, &scrblt->nYSrc, orderInfo->deltaCoordinates); } -void update_read_draw_nine_grid_order(STREAM* s, ORDER_INFO* orderInfo, DRAW_NINE_GRID_ORDER* draw_nine_grid) -{ - -} - -void update_read_multi_draw_nine_grid_order(STREAM* s, ORDER_INFO* orderInfo, MULTI_DRAW_NINE_GRID_ORDER* multi_draw_nine_grid) -{ - -} - -void update_read_line_to_order(STREAM* s, ORDER_INFO* orderInfo, LINE_TO_ORDER* line_to) -{ - if (orderInfo->fieldFlags & ORDER_FIELD_01) - stream_read_uint16(s, line_to->backMode); - - if (orderInfo->fieldFlags & ORDER_FIELD_02) - update_read_coord(s, &line_to->nXStart, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_03) - update_read_coord(s, &line_to->nYStart, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_04) - update_read_coord(s, &line_to->nXEnd, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_05) - update_read_coord(s, &line_to->nYEnd, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_06) - update_read_color(s, &line_to->backColor); - - if (orderInfo->fieldFlags & ORDER_FIELD_07) - stream_read_uint8(s, line_to->bRop2); - - if (orderInfo->fieldFlags & ORDER_FIELD_08) - stream_read_uint8(s, line_to->penStyle); - - if (orderInfo->fieldFlags & ORDER_FIELD_09) - stream_read_uint8(s, line_to->penWidth); - - if (orderInfo->fieldFlags & ORDER_FIELD_10) - update_read_color(s, &line_to->penColor); -} - void update_read_opaque_rect_order(STREAM* s, ORDER_INFO* orderInfo, OPAQUE_RECT_ORDER* opaque_rect) { uint8 byte; @@ -292,106 +249,9 @@ void update_read_opaque_rect_order(STREAM* s, ORDER_INFO* orderInfo, OPAQUE_RECT } } -void update_read_save_bitmap_order(STREAM* s, ORDER_INFO* orderInfo, SAVE_BITMAP_ORDER* save_bitmap) +void update_read_draw_nine_grid_order(STREAM* s, ORDER_INFO* orderInfo, DRAW_NINE_GRID_ORDER* draw_nine_grid) { - if (orderInfo->fieldFlags & ORDER_FIELD_01) - stream_read_uint32(s, save_bitmap->savedBitmapPosition); - if (orderInfo->fieldFlags & ORDER_FIELD_02) - update_read_coord(s, &save_bitmap->nLeftRect, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_03) - update_read_coord(s, &save_bitmap->nTopRect, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_04) - update_read_coord(s, &save_bitmap->nRightRect, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_05) - update_read_coord(s, &save_bitmap->nBottomRect, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_06) - stream_read_uint8(s, save_bitmap->operation); -} - -void update_read_memblt_order(STREAM* s, ORDER_INFO* orderInfo, MEMBLT_ORDER* memblt) -{ - if (orderInfo->fieldFlags & ORDER_FIELD_01) - stream_read_uint16(s, memblt->cacheId); - - if (orderInfo->fieldFlags & ORDER_FIELD_02) - update_read_coord(s, &memblt->nLeftRect, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_03) - update_read_coord(s, &memblt->nTopRect, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_04) - update_read_coord(s, &memblt->nWidth, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_05) - update_read_coord(s, &memblt->nHeight, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_06) - stream_read_uint8(s, memblt->bRop); - - if (orderInfo->fieldFlags & ORDER_FIELD_07) - update_read_coord(s, &memblt->nXSrc, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_08) - update_read_coord(s, &memblt->nYSrc, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_09) - stream_read_uint16(s, memblt->cacheIndex); -} - -void update_read_mem3blt_order(STREAM* s, ORDER_INFO* orderInfo, MEM3BLT_ORDER* mem3blt) -{ - if (orderInfo->fieldFlags & ORDER_FIELD_01) - stream_read_uint16(s, mem3blt->cacheId); - - if (orderInfo->fieldFlags & ORDER_FIELD_02) - update_read_coord(s, &mem3blt->nLeftRect, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_03) - update_read_coord(s, &mem3blt->nTopRect, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_04) - update_read_coord(s, &mem3blt->nWidth, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_05) - update_read_coord(s, &mem3blt->nHeight, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_06) - stream_read_uint8(s, mem3blt->bRop); - - if (orderInfo->fieldFlags & ORDER_FIELD_07) - update_read_coord(s, &mem3blt->nXSrc, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_08) - update_read_coord(s, &mem3blt->nYSrc, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_09) - update_read_color(s, &mem3blt->backColor); - - if (orderInfo->fieldFlags & ORDER_FIELD_10) - update_read_color(s, &mem3blt->foreColor); - - if (orderInfo->fieldFlags & ORDER_FIELD_11) - stream_read_uint8(s, mem3blt->brushOrgX); - - if (orderInfo->fieldFlags & ORDER_FIELD_12) - stream_read_uint8(s, mem3blt->brushOrgY); - - if (orderInfo->fieldFlags & ORDER_FIELD_13) - stream_read_uint8(s, mem3blt->brushStyle); - - if (orderInfo->fieldFlags & ORDER_FIELD_14) - stream_read_uint8(s, mem3blt->brushHatch); - - if (orderInfo->fieldFlags & ORDER_FIELD_15) - stream_read(s, mem3blt->brushExtra, 7); - - if (orderInfo->fieldFlags & ORDER_FIELD_16) - stream_read_uint16(s, mem3blt->cacheIndex); } void update_read_multi_dstblt_order(STREAM* s, ORDER_INFO* orderInfo, MULTI_DSTBLT_ORDER* multi_dstblt) @@ -530,6 +390,166 @@ void update_read_multi_opaque_rect_order(STREAM* s, ORDER_INFO* orderInfo, MULTI /* codeDeltaList */ } +void update_read_multi_draw_nine_grid_order(STREAM* s, ORDER_INFO* orderInfo, MULTI_DRAW_NINE_GRID_ORDER* multi_draw_nine_grid) +{ + +} + +void update_read_line_to_order(STREAM* s, ORDER_INFO* orderInfo, LINE_TO_ORDER* line_to) +{ + if (orderInfo->fieldFlags & ORDER_FIELD_01) + stream_read_uint16(s, line_to->backMode); + + if (orderInfo->fieldFlags & ORDER_FIELD_02) + update_read_coord(s, &line_to->nXStart, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_03) + update_read_coord(s, &line_to->nYStart, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_04) + update_read_coord(s, &line_to->nXEnd, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_05) + update_read_coord(s, &line_to->nYEnd, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_06) + update_read_color(s, &line_to->backColor); + + if (orderInfo->fieldFlags & ORDER_FIELD_07) + stream_read_uint8(s, line_to->bRop2); + + if (orderInfo->fieldFlags & ORDER_FIELD_08) + stream_read_uint8(s, line_to->penStyle); + + if (orderInfo->fieldFlags & ORDER_FIELD_09) + stream_read_uint8(s, line_to->penWidth); + + if (orderInfo->fieldFlags & ORDER_FIELD_10) + update_read_color(s, &line_to->penColor); +} + +void update_read_polyline_order(STREAM* s, ORDER_INFO* orderInfo, POLYLINE_ORDER* polyline) +{ + if (orderInfo->fieldFlags & ORDER_FIELD_01) + update_read_coord(s, &polyline->xStart, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_02) + update_read_coord(s, &polyline->yStart, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_03) + stream_read_uint8(s, polyline->bRop2); + + if (orderInfo->fieldFlags & ORDER_FIELD_04) + update_read_color(s, &polyline->penColor); + + if (orderInfo->fieldFlags & ORDER_FIELD_05) + stream_read_uint8(s, polyline->nDeltaEntries); + + /* codeDeltaList */ +} + +void update_read_memblt_order(STREAM* s, ORDER_INFO* orderInfo, MEMBLT_ORDER* memblt) +{ + if (orderInfo->fieldFlags & ORDER_FIELD_01) + stream_read_uint16(s, memblt->cacheId); + + if (orderInfo->fieldFlags & ORDER_FIELD_02) + update_read_coord(s, &memblt->nLeftRect, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_03) + update_read_coord(s, &memblt->nTopRect, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_04) + update_read_coord(s, &memblt->nWidth, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_05) + update_read_coord(s, &memblt->nHeight, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_06) + stream_read_uint8(s, memblt->bRop); + + if (orderInfo->fieldFlags & ORDER_FIELD_07) + update_read_coord(s, &memblt->nXSrc, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_08) + update_read_coord(s, &memblt->nYSrc, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_09) + stream_read_uint16(s, memblt->cacheIndex); +} + +void update_read_mem3blt_order(STREAM* s, ORDER_INFO* orderInfo, MEM3BLT_ORDER* mem3blt) +{ + if (orderInfo->fieldFlags & ORDER_FIELD_01) + stream_read_uint16(s, mem3blt->cacheId); + + if (orderInfo->fieldFlags & ORDER_FIELD_02) + update_read_coord(s, &mem3blt->nLeftRect, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_03) + update_read_coord(s, &mem3blt->nTopRect, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_04) + update_read_coord(s, &mem3blt->nWidth, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_05) + update_read_coord(s, &mem3blt->nHeight, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_06) + stream_read_uint8(s, mem3blt->bRop); + + if (orderInfo->fieldFlags & ORDER_FIELD_07) + update_read_coord(s, &mem3blt->nXSrc, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_08) + update_read_coord(s, &mem3blt->nYSrc, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_09) + update_read_color(s, &mem3blt->backColor); + + if (orderInfo->fieldFlags & ORDER_FIELD_10) + update_read_color(s, &mem3blt->foreColor); + + if (orderInfo->fieldFlags & ORDER_FIELD_11) + stream_read_uint8(s, mem3blt->brushOrgX); + + if (orderInfo->fieldFlags & ORDER_FIELD_12) + stream_read_uint8(s, mem3blt->brushOrgY); + + if (orderInfo->fieldFlags & ORDER_FIELD_13) + stream_read_uint8(s, mem3blt->brushStyle); + + if (orderInfo->fieldFlags & ORDER_FIELD_14) + stream_read_uint8(s, mem3blt->brushHatch); + + if (orderInfo->fieldFlags & ORDER_FIELD_15) + stream_read(s, mem3blt->brushExtra, 7); + + if (orderInfo->fieldFlags & ORDER_FIELD_16) + stream_read_uint16(s, mem3blt->cacheIndex); +} + +void update_read_save_bitmap_order(STREAM* s, ORDER_INFO* orderInfo, SAVE_BITMAP_ORDER* save_bitmap) +{ + if (orderInfo->fieldFlags & ORDER_FIELD_01) + stream_read_uint32(s, save_bitmap->savedBitmapPosition); + + if (orderInfo->fieldFlags & ORDER_FIELD_02) + update_read_coord(s, &save_bitmap->nLeftRect, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_03) + update_read_coord(s, &save_bitmap->nTopRect, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_04) + update_read_coord(s, &save_bitmap->nRightRect, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_05) + update_read_coord(s, &save_bitmap->nBottomRect, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_06) + stream_read_uint8(s, save_bitmap->operation); +} + void update_read_fast_index_order(STREAM* s, ORDER_INFO* orderInfo, FAST_INDEX_ORDER* fast_index) { if (orderInfo->fieldFlags & ORDER_FIELD_01) @@ -577,90 +597,6 @@ void update_read_fast_index_order(STREAM* s, ORDER_INFO* orderInfo, FAST_INDEX_O /* bytes */ } -void update_read_polygon_sc_order(STREAM* s, ORDER_INFO* orderInfo, POLYGON_SC_ORDER* polygon_sc) -{ - if (orderInfo->fieldFlags & ORDER_FIELD_01) - update_read_coord(s, &polygon_sc->xStart, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_02) - update_read_coord(s, &polygon_sc->yStart, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_03) - stream_read_uint8(s, polygon_sc->bRop2); - - if (orderInfo->fieldFlags & ORDER_FIELD_04) - stream_read_uint8(s, polygon_sc->fillMode); - - if (orderInfo->fieldFlags & ORDER_FIELD_05) - update_read_color(s, &polygon_sc->brushColor); - - if (orderInfo->fieldFlags & ORDER_FIELD_06) - stream_read_uint8(s, polygon_sc->nDeltaEntries); - - /* codeDeltaList */ -} - -void update_read_polygon_cb_order(STREAM* s, ORDER_INFO* orderInfo, POLYGON_CB_ORDER* polygon_cb) -{ - if (orderInfo->fieldFlags & ORDER_FIELD_01) - update_read_coord(s, &polygon_cb->xStart, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_02) - update_read_coord(s, &polygon_cb->yStart, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_03) - stream_read_uint8(s, polygon_cb->bRop2); - - if (orderInfo->fieldFlags & ORDER_FIELD_04) - stream_read_uint8(s, polygon_cb->fillMode); - - if (orderInfo->fieldFlags & ORDER_FIELD_05) - update_read_color(s, &polygon_cb->backColor); - - if (orderInfo->fieldFlags & ORDER_FIELD_06) - update_read_color(s, &polygon_cb->foreColor); - - if (orderInfo->fieldFlags & ORDER_FIELD_07) - stream_read_uint8(s, polygon_cb->brushOrgX); - - if (orderInfo->fieldFlags & ORDER_FIELD_08) - stream_read_uint8(s, polygon_cb->brushOrgY); - - if (orderInfo->fieldFlags & ORDER_FIELD_09) - stream_read_uint8(s, polygon_cb->brushStyle); - - if (orderInfo->fieldFlags & ORDER_FIELD_10) - stream_read_uint8(s, polygon_cb->brushHatch); - - if (orderInfo->fieldFlags & ORDER_FIELD_12) - stream_read(s, polygon_cb->brushExtra, 7); - - if (orderInfo->fieldFlags & ORDER_FIELD_13) - stream_read_uint8(s, polygon_cb->nDeltaEntries); - - /* codeDeltaList */ -} - -void update_read_polyline_order(STREAM* s, ORDER_INFO* orderInfo, POLYLINE_ORDER* polyline) -{ - if (orderInfo->fieldFlags & ORDER_FIELD_01) - update_read_coord(s, &polyline->xStart, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_02) - update_read_coord(s, &polyline->yStart, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_03) - stream_read_uint8(s, polyline->bRop2); - - if (orderInfo->fieldFlags & ORDER_FIELD_04) - update_read_color(s, &polyline->penColor); - - if (orderInfo->fieldFlags & ORDER_FIELD_05) - stream_read_uint8(s, polyline->nDeltaEntries); - - /* codeDeltaList */ -} - void update_read_fast_glyph_order(STREAM* s, ORDER_INFO* orderInfo, FAST_GLYPH_ORDER* fast_glyph) { if (orderInfo->fieldFlags & ORDER_FIELD_01) @@ -708,72 +644,6 @@ void update_read_fast_glyph_order(STREAM* s, ORDER_INFO* orderInfo, FAST_GLYPH_O /* bytes */ } -void update_read_ellipse_sc_order(STREAM* s, ORDER_INFO* orderInfo, ELLIPSE_SC_ORDER* ellipse_sc) -{ - if (orderInfo->fieldFlags & ORDER_FIELD_01) - update_read_coord(s, &ellipse_sc->leftRect, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_02) - update_read_coord(s, &ellipse_sc->topRect, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_03) - update_read_coord(s, &ellipse_sc->rightRect, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_04) - update_read_coord(s, &ellipse_sc->bottomRect, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_05) - stream_read_uint8(s, ellipse_sc->bRop2); - - if (orderInfo->fieldFlags & ORDER_FIELD_06) - stream_read_uint8(s, ellipse_sc->fillMode); - - if (orderInfo->fieldFlags & ORDER_FIELD_07) - update_read_color(s, &ellipse_sc->color); -} - -void update_read_ellipse_cb_order(STREAM* s, ORDER_INFO* orderInfo, ELLIPSE_CB_ORDER* ellipse_cb) -{ - if (orderInfo->fieldFlags & ORDER_FIELD_01) - update_read_coord(s, &ellipse_cb->leftRect, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_02) - update_read_coord(s, &ellipse_cb->topRect, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_03) - update_read_coord(s, &ellipse_cb->rightRect, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_04) - update_read_coord(s, &ellipse_cb->bottomRect, orderInfo->deltaCoordinates); - - if (orderInfo->fieldFlags & ORDER_FIELD_05) - stream_read_uint8(s, ellipse_cb->bRop2); - - if (orderInfo->fieldFlags & ORDER_FIELD_06) - stream_read_uint8(s, ellipse_cb->fillMode); - - if (orderInfo->fieldFlags & ORDER_FIELD_07) - update_read_color(s, &ellipse_cb->backColor); - - if (orderInfo->fieldFlags & ORDER_FIELD_08) - update_read_color(s, &ellipse_cb->foreColor); - - if (orderInfo->fieldFlags & ORDER_FIELD_09) - stream_read_uint8(s, ellipse_cb->brushOrgX); - - if (orderInfo->fieldFlags & ORDER_FIELD_10) - stream_read_uint8(s, ellipse_cb->brushOrgY); - - if (orderInfo->fieldFlags & ORDER_FIELD_11) - stream_read_uint8(s, ellipse_cb->brushStyle); - - if (orderInfo->fieldFlags & ORDER_FIELD_12) - stream_read_uint8(s, ellipse_cb->brushHatch); - - if (orderInfo->fieldFlags & ORDER_FIELD_13) - stream_read(s, ellipse_cb->brushExtra, 7); -} - void update_read_glyph_index_order(STREAM* s, ORDER_INFO* orderInfo, GLYPH_INDEX_ORDER* glyph_index) { if (orderInfo->fieldFlags & ORDER_FIELD_01) @@ -842,116 +712,231 @@ void update_read_glyph_index_order(STREAM* s, ORDER_INFO* orderInfo, GLYPH_INDEX /* bytes */ } +void update_read_polygon_sc_order(STREAM* s, ORDER_INFO* orderInfo, POLYGON_SC_ORDER* polygon_sc) +{ + if (orderInfo->fieldFlags & ORDER_FIELD_01) + update_read_coord(s, &polygon_sc->xStart, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_02) + update_read_coord(s, &polygon_sc->yStart, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_03) + stream_read_uint8(s, polygon_sc->bRop2); + + if (orderInfo->fieldFlags & ORDER_FIELD_04) + stream_read_uint8(s, polygon_sc->fillMode); + + if (orderInfo->fieldFlags & ORDER_FIELD_05) + update_read_color(s, &polygon_sc->brushColor); + + if (orderInfo->fieldFlags & ORDER_FIELD_06) + stream_read_uint8(s, polygon_sc->nDeltaEntries); + + /* codeDeltaList */ +} + +void update_read_polygon_cb_order(STREAM* s, ORDER_INFO* orderInfo, POLYGON_CB_ORDER* polygon_cb) +{ + if (orderInfo->fieldFlags & ORDER_FIELD_01) + update_read_coord(s, &polygon_cb->xStart, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_02) + update_read_coord(s, &polygon_cb->yStart, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_03) + stream_read_uint8(s, polygon_cb->bRop2); + + if (orderInfo->fieldFlags & ORDER_FIELD_04) + stream_read_uint8(s, polygon_cb->fillMode); + + if (orderInfo->fieldFlags & ORDER_FIELD_05) + update_read_color(s, &polygon_cb->backColor); + + if (orderInfo->fieldFlags & ORDER_FIELD_06) + update_read_color(s, &polygon_cb->foreColor); + + if (orderInfo->fieldFlags & ORDER_FIELD_07) + stream_read_uint8(s, polygon_cb->brushOrgX); + + if (orderInfo->fieldFlags & ORDER_FIELD_08) + stream_read_uint8(s, polygon_cb->brushOrgY); + + if (orderInfo->fieldFlags & ORDER_FIELD_09) + stream_read_uint8(s, polygon_cb->brushStyle); + + if (orderInfo->fieldFlags & ORDER_FIELD_10) + stream_read_uint8(s, polygon_cb->brushHatch); + + if (orderInfo->fieldFlags & ORDER_FIELD_12) + stream_read(s, polygon_cb->brushExtra, 7); + + if (orderInfo->fieldFlags & ORDER_FIELD_13) + stream_read_uint8(s, polygon_cb->nDeltaEntries); + + /* codeDeltaList */ +} + +void update_read_ellipse_sc_order(STREAM* s, ORDER_INFO* orderInfo, ELLIPSE_SC_ORDER* ellipse_sc) +{ + if (orderInfo->fieldFlags & ORDER_FIELD_01) + update_read_coord(s, &ellipse_sc->leftRect, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_02) + update_read_coord(s, &ellipse_sc->topRect, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_03) + update_read_coord(s, &ellipse_sc->rightRect, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_04) + update_read_coord(s, &ellipse_sc->bottomRect, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_05) + stream_read_uint8(s, ellipse_sc->bRop2); + + if (orderInfo->fieldFlags & ORDER_FIELD_06) + stream_read_uint8(s, ellipse_sc->fillMode); + + if (orderInfo->fieldFlags & ORDER_FIELD_07) + update_read_color(s, &ellipse_sc->color); +} + +void update_read_ellipse_cb_order(STREAM* s, ORDER_INFO* orderInfo, ELLIPSE_CB_ORDER* ellipse_cb) +{ + if (orderInfo->fieldFlags & ORDER_FIELD_01) + update_read_coord(s, &ellipse_cb->leftRect, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_02) + update_read_coord(s, &ellipse_cb->topRect, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_03) + update_read_coord(s, &ellipse_cb->rightRect, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_04) + update_read_coord(s, &ellipse_cb->bottomRect, orderInfo->deltaCoordinates); + + if (orderInfo->fieldFlags & ORDER_FIELD_05) + stream_read_uint8(s, ellipse_cb->bRop2); + + if (orderInfo->fieldFlags & ORDER_FIELD_06) + stream_read_uint8(s, ellipse_cb->fillMode); + + if (orderInfo->fieldFlags & ORDER_FIELD_07) + update_read_color(s, &ellipse_cb->backColor); + + if (orderInfo->fieldFlags & ORDER_FIELD_08) + update_read_color(s, &ellipse_cb->foreColor); + + if (orderInfo->fieldFlags & ORDER_FIELD_09) + stream_read_uint8(s, ellipse_cb->brushOrgX); + + if (orderInfo->fieldFlags & ORDER_FIELD_10) + stream_read_uint8(s, ellipse_cb->brushOrgY); + + if (orderInfo->fieldFlags & ORDER_FIELD_11) + stream_read_uint8(s, ellipse_cb->brushStyle); + + if (orderInfo->fieldFlags & ORDER_FIELD_12) + stream_read_uint8(s, ellipse_cb->brushHatch); + + if (orderInfo->fieldFlags & ORDER_FIELD_13) + stream_read(s, ellipse_cb->brushExtra, 7); +} + /* Secondary Drawing Orders */ -void update_recv_cache_bitmap_order(rdpUpdate* update, STREAM* s) +void update_read_cache_bitmap_order(STREAM* s, CACHE_BITMAP_ORDER* cache_bitmap_order, boolean compressed) { } -void update_recv_cache_color_table_order(rdpUpdate* update, STREAM* s) +void update_read_cache_bitmap_v2_order(STREAM* s, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2_order, boolean compressed) { } -void update_recv_cache_bitmap_compressed_order(rdpUpdate* update, STREAM* s) +void update_read_cache_bitmap_v3_order(STREAM* s, CACHE_BITMAP_V3_ORDER* cache_bitmap_v3_order, boolean compressed) { } -void update_recv_cache_glyph_order(rdpUpdate* update, STREAM* s) +void update_read_cache_color_table_order(STREAM* s, CACHE_COLOR_TABLE_ORDER* cache_color_table_order) { } -void update_recv_cache_bitmap_v2_order(rdpUpdate* update, STREAM* s) +void update_read_cache_glyph_order(STREAM* s, CACHE_GLYPH_ORDER* cache_glyph_order) { } -void update_recv_cache_bitmap_v2_compressed_order(rdpUpdate* update, STREAM* s) +void update_read_cache_glyph_v2_order(STREAM* s, CACHE_GLYPH_V2_ORDER* cache_glyph_v2_order) { } -void update_recv_cache_brush_order(rdpUpdate* update, STREAM* s) -{ - -} - -void update_recv_cache_bitmap_v3_order(rdpUpdate* update, STREAM* s) +void update_read_cache_brush_order(STREAM* s, CACHE_BRUSH_ORDER* cache_brush_order) { } /* Alternate Secondary Drawing Orders */ -void update_recv_switch_surface_order(rdpUpdate* update, STREAM* s) +void update_read_create_offscreen_bitmap_order(STREAM* s, CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap) { } -void update_recv_create_offscreen_bitmap_order(rdpUpdate* update, STREAM* s) +void update_read_switch_surface_order(STREAM* s, SWITCH_SURFACE_ORDER* switch_surface) { } -void update_recv_stream_bitmap_first_order(rdpUpdate* update, STREAM* s) +void update_read_create_nine_grid_bitmap_order(STREAM* s, CREATE_NINE_GRID_BITMAP_ORDER* create_nine_grid_bitmap) { } -void update_recv_stream_bitmap_next_order(rdpUpdate* update, STREAM* s) +void update_read_frame_marker_order(STREAM* s, FRAME_MARKER_ORDER* frame_marker) { } -void update_recv_create_nine_grid_bitmap_order(rdpUpdate* update, STREAM* s) +void update_read_stream_bitmap_first_order(STREAM* s, STREAM_BITMAP_FIRST_ORDER* stream_bitmap_first) { } -void update_recv_draw_gdiplus_first_order(rdpUpdate* update, STREAM* s) +void update_read_stream_bitmap_next_order(STREAM* s, STREAM_BITMAP_FIRST_ORDER* stream_bitmap_next) { } -void update_recv_draw_gdiplus_next_order(rdpUpdate* update, STREAM* s) +void update_read_draw_gdiplus_first_order(STREAM* s, DRAW_GDIPLUS_FIRST_ORDER* draw_gdiplus_first) { } -void update_recv_draw_gdiplus_end_order(rdpUpdate* update, STREAM* s) +void update_read_draw_gdiplus_next_order(STREAM* s, DRAW_GDIPLUS_NEXT_ORDER* draw_gdiplus_next) { } -void update_recv_draw_gdiplus_cache_first_order(rdpUpdate* update, STREAM* s) +void update_read_draw_gdiplus_end_order(STREAM* s, DRAW_GDIPLUS_END_ORDER* draw_gdiplus_end) { } -void update_recv_draw_gdiplus_cache_next_order(rdpUpdate* update, STREAM* s) +void update_read_draw_gdiplus_cache_first_order(STREAM* s, DRAW_GDIPLUS_CACHE_FIRST_ORDER* draw_gdiplus_cache_first) { } -void update_recv_draw_gdiplus_cache_end_order(rdpUpdate* update, STREAM* s) +void update_read_draw_gdiplus_cache_next_order(STREAM* s, DRAW_GDIPLUS_CACHE_NEXT_ORDER* draw_gdiplus_cache_next) { } -void update_recv_windowing_order(rdpUpdate* update, STREAM* s) -{ - -} - -void update_recv_desktop_composition_order(rdpUpdate* update, STREAM* s) -{ - -} - -void update_recv_frame_marker_order(rdpUpdate* update, STREAM* s) +void update_read_draw_gdiplus_cache_end_order(STREAM* s, DRAW_GDIPLUS_CACHE_END_ORDER* draw_gdiplus_cache_end) { } @@ -1054,39 +1039,14 @@ void update_recv_primary_order(rdpUpdate* update, STREAM* s, uint8 flags) IFCALL(update->ScrBlt, update, &update->scrblt); break; - case ORDER_TYPE_DRAW_NINE_GRID: - update_read_draw_nine_grid_order(s, orderInfo, &(update->draw_nine_grid)); - IFCALL(update->DrawNineGrid, update, &update->draw_nine_grid); - break; - - case ORDER_TYPE_MULTI_DRAW_NINE_GRID: - update_read_multi_draw_nine_grid_order(s, orderInfo, &(update->multi_draw_nine_grid)); - IFCALL(update->MultiDrawNineGrid, update, &update->multi_draw_nine_grid); - break; - - case ORDER_TYPE_LINE_TO: - update_read_line_to_order(s, orderInfo, &(update->line_to)); - IFCALL(update->LineTo, update, &update->line_to); - break; - case ORDER_TYPE_OPAQUE_RECT: update_read_opaque_rect_order(s, orderInfo, &(update->opaque_rect)); IFCALL(update->OpaqueRect, update, &update->opaque_rect); break; - case ORDER_TYPE_SAVE_BITMAP: - update_read_save_bitmap_order(s, orderInfo, &(update->save_bitmap)); - IFCALL(update->SaveBitmap, update, &update->save_bitmap); - break; - - case ORDER_TYPE_MEMBLT: - update_read_memblt_order(s, orderInfo, &(update->memblt)); - IFCALL(update->MemBlt, update, &update->memblt); - break; - - case ORDER_TYPE_MEM3BLT: - update_read_mem3blt_order(s, orderInfo, &(update->mem3blt)); - IFCALL(update->Mem3Blt, update, &update->mem3blt); + case ORDER_TYPE_DRAW_NINE_GRID: + update_read_draw_nine_grid_order(s, orderInfo, &(update->draw_nine_grid)); + IFCALL(update->DrawNineGrid, update, &update->draw_nine_grid); break; case ORDER_TYPE_MULTI_DSTBLT: @@ -1109,11 +1069,51 @@ void update_recv_primary_order(rdpUpdate* update, STREAM* s, uint8 flags) IFCALL(update->MultiOpaqueRect, update, &update->multi_opaque_rect); break; + case ORDER_TYPE_MULTI_DRAW_NINE_GRID: + update_read_multi_draw_nine_grid_order(s, orderInfo, &(update->multi_draw_nine_grid)); + IFCALL(update->MultiDrawNineGrid, update, &update->multi_draw_nine_grid); + break; + + case ORDER_TYPE_LINE_TO: + update_read_line_to_order(s, orderInfo, &(update->line_to)); + IFCALL(update->LineTo, update, &update->line_to); + break; + + case ORDER_TYPE_POLYLINE: + update_read_polyline_order(s, orderInfo, &(update->polyline)); + IFCALL(update->Polyline, update, &update->polyline); + break; + + case ORDER_TYPE_MEMBLT: + update_read_memblt_order(s, orderInfo, &(update->memblt)); + IFCALL(update->MemBlt, update, &update->memblt); + break; + + case ORDER_TYPE_MEM3BLT: + update_read_mem3blt_order(s, orderInfo, &(update->mem3blt)); + IFCALL(update->Mem3Blt, update, &update->mem3blt); + break; + + case ORDER_TYPE_SAVE_BITMAP: + update_read_save_bitmap_order(s, orderInfo, &(update->save_bitmap)); + IFCALL(update->SaveBitmap, update, &update->save_bitmap); + break; + case ORDER_TYPE_FAST_INDEX: update_read_fast_index_order(s, orderInfo, &(update->fast_index)); IFCALL(update->FastIndex, update, &update->fast_index); break; + case ORDER_TYPE_FAST_GLYPH: + update_read_fast_glyph_order(s, orderInfo, &(update->fast_glyph)); + IFCALL(update->FastGlyph, update, &update->fast_glyph); + break; + + case ORDER_TYPE_GLYPH_INDEX: + update_read_glyph_index_order(s, orderInfo, &(update->glyph_index)); + IFCALL(update->GlyphIndex, update, &update->glyph_index); + break; + case ORDER_TYPE_POLYGON_SC: update_read_polygon_sc_order(s, orderInfo, &(update->polygon_sc)); IFCALL(update->PolygonSC, update, &update->polygon_sc); @@ -1124,16 +1124,6 @@ void update_recv_primary_order(rdpUpdate* update, STREAM* s, uint8 flags) IFCALL(update->PolygonCB, update, &update->polygon_cb); break; - case ORDER_TYPE_POLYLINE: - update_read_polyline_order(s, orderInfo, &(update->polyline)); - IFCALL(update->Polyline, update, &update->polyline); - break; - - case ORDER_TYPE_FAST_GLYPH: - update_read_fast_glyph_order(s, orderInfo, &(update->fast_glyph)); - IFCALL(update->FastGlyph, update, &update->fast_glyph); - break; - case ORDER_TYPE_ELLIPSE_SC: update_read_ellipse_sc_order(s, orderInfo, &(update->ellipse_sc)); IFCALL(update->EllipseSC, update, &update->ellipse_sc); @@ -1144,11 +1134,6 @@ void update_recv_primary_order(rdpUpdate* update, STREAM* s, uint8 flags) IFCALL(update->EllipseCB, update, &update->ellipse_cb); break; - case ORDER_TYPE_GLYPH_INDEX: - update_read_glyph_index_order(s, orderInfo, &(update->glyph_index)); - IFCALL(update->GlyphIndex, update, &update->glyph_index); - break; - default: break; } @@ -1177,35 +1162,51 @@ void update_recv_secondary_order(rdpUpdate* update, STREAM* s, uint8 flags) switch (orderType) { case ORDER_TYPE_BITMAP_UNCOMPRESSED: - update_recv_cache_bitmap_order(update, s); - break; - - case ORDER_TYPE_CACHE_COLOR_TABLE: - update_recv_cache_color_table_order(update, s); + update_read_cache_bitmap_order(s, &(update->cache_bitmap_order), False); + IFCALL(update->CacheBitmap, update, &(update->cache_bitmap_order)); break; case ORDER_TYPE_CACHE_BITMAP_COMPRESSED: - update_recv_cache_bitmap_compressed_order(update, s); - break; - - case ORDER_TYPE_CACHE_GLYPH: - update_recv_cache_glyph_order(update, s); + update_read_cache_bitmap_order(s, &(update->cache_bitmap_order), True); + IFCALL(update->CacheBitmap, update, &(update->cache_bitmap_order)); break; case ORDER_TYPE_BITMAP_UNCOMPRESSED_V2: - update_recv_cache_bitmap_v2_order(update, s); + update_read_cache_bitmap_v2_order(s, &(update->cache_bitmap_v2_order), False); + IFCALL(update->CacheBitmapV2, update, &(update->cache_bitmap_v2_order)); break; case ORDER_TYPE_BITMAP_COMPRESSED_V2: - update_recv_cache_bitmap_v2_compressed_order(update, s); - break; - - case ORDER_TYPE_CACHE_BRUSH: - update_recv_cache_brush_order(update, s); + update_read_cache_bitmap_v2_order(s, &(update->cache_bitmap_v2_order), True); + IFCALL(update->CacheBitmapV2, update, &(update->cache_bitmap_v2_order)); break; case ORDER_TYPE_BITMAP_COMPRESSED_V3: - update_recv_cache_bitmap_v3_order(update, s); + update_read_cache_bitmap_v3_order(s, &(update->cache_bitmap_v3_order), True); + IFCALL(update->CacheBitmapV3, update, &(update->cache_bitmap_v3_order)); + break; + + case ORDER_TYPE_CACHE_COLOR_TABLE: + update_read_cache_color_table_order(s, &(update->cache_color_table_order)); + IFCALL(update->CacheColorTable, update, &(update->cache_color_table_order)); + break; + + case ORDER_TYPE_CACHE_GLYPH: + if (update->glyph_v2) + { + update_read_cache_glyph_v2_order(s, &(update->cache_glyph_v2_order)); + IFCALL(update->CacheGlyph, update, &(update->cache_glyph_order)); + } + else + { + update_read_cache_glyph_order(s, &(update->cache_glyph_order)); + IFCALL(update->CacheGlyphV2, update, &(update->cache_glyph_v2_order)); + } + break; + + case ORDER_TYPE_CACHE_BRUSH: + update_read_cache_brush_order(s, &(update->cache_brush_order)); + IFCALL(update->CacheBrush, update, &(update->cache_brush_order)); break; default: @@ -1225,60 +1226,70 @@ void update_recv_altsec_order(rdpUpdate* update, STREAM* s, uint8 flags) switch (orderType) { + case ORDER_TYPE_CREATE_OFFSCREEN_BITMAP: + update_read_create_offscreen_bitmap_order(s, &(update->create_offscreen_bitmap)); + IFCALL(update->CreateOffscreenBitmap, update, &(update->create_offscreen_bitmap)); + break; + case ORDER_TYPE_SWITCH_SURFACE: - update_recv_switch_surface_order(update, s); - break; - - case ORDER_TYPE_CREATE_OFFSCR_BITMAP: - update_recv_create_offscreen_bitmap_order(update, s); - break; - - case ORDER_TYPE_STREAM_BITMAP_FIRST: - update_recv_stream_bitmap_first_order(update, s); - break; - - case ORDER_TYPE_STREAM_BITMAP_NEXT: - update_recv_stream_bitmap_next_order(update, s); + update_read_switch_surface_order(s, &(update->switch_surface)); + IFCALL(update->SwitchSurface, update, &(update->switch_surface)); break; case ORDER_TYPE_CREATE_NINE_GRID_BITMAP: - update_recv_create_nine_grid_bitmap_order(update, s); - break; - - case ORDER_TYPE_GDIPLUS_FIRST: - update_recv_draw_gdiplus_first_order(update, s); - break; - - case ORDER_TYPE_GDIPLUS_NEXT: - update_recv_draw_gdiplus_next_order(update, s); - break; - - case ORDER_TYPE_GDIPLUS_END: - update_recv_draw_gdiplus_end_order(update, s); - break; - - case ORDER_TYPE_GDIPLUS_CACHE_FIRST: - update_recv_draw_gdiplus_cache_first_order(update, s); - break; - - case ORDER_TYPE_GDIPLUS_CACHE_NEXT: - update_recv_draw_gdiplus_cache_next_order(update, s); - break; - - case ORDER_TYPE_GDIPLUS_CACHE_END: - update_recv_draw_gdiplus_cache_end_order(update, s); - break; - - case ORDER_TYPE_WINDOW: - update_recv_windowing_order(update, s); - break; - - case ORDER_TYPE_COMPDESK_FIRST: - update_recv_desktop_composition_order(update, s); + update_read_create_nine_grid_bitmap_order(s, &(update->create_nine_grid_bitmap)); + IFCALL(update->CreateNineGridBitmap, update, &(update->create_nine_grid_bitmap)); break; case ORDER_TYPE_FRAME_MARKER: - update_recv_frame_marker_order(update, s); + update_read_frame_marker_order(s, &(update->frame_marker)); + IFCALL(update->FrameMarker, update, &(update->frame_marker)); + break; + + case ORDER_TYPE_STREAM_BITMAP_FIRST: + update_read_stream_bitmap_first_order(s, &(update->stream_bitmap_first)); + IFCALL(update->StreamBitmapFirst, update, &(update->stream_bitmap_first)); + break; + + case ORDER_TYPE_STREAM_BITMAP_NEXT: + update_read_stream_bitmap_next_order(s, &(update->stream_bitmap_next)); + IFCALL(update->StreamBitmapNext, update, &(update->stream_bitmap_next)); + break; + + case ORDER_TYPE_GDIPLUS_FIRST: + update_read_draw_gdiplus_first_order(s, &(update->draw_gdiplus_first)); + IFCALL(update->DrawGdiPlusFirst, update, &(update->draw_gdiplus_first)); + break; + + case ORDER_TYPE_GDIPLUS_NEXT: + update_read_draw_gdiplus_next_order(s, &(update->draw_gdiplus_next)); + IFCALL(update->DrawGdiPlusNext, update, &(update->draw_gdiplus_next)); + break; + + case ORDER_TYPE_GDIPLUS_END: + update_read_draw_gdiplus_end_order(s, &(update->draw_gdiplus_end)); + IFCALL(update->DrawGdiPlusEnd, update, &(update->draw_gdiplus_end)); + break; + + case ORDER_TYPE_GDIPLUS_CACHE_FIRST: + update_read_draw_gdiplus_cache_first_order(s, &(update->draw_gdiplus_cache_first)); + IFCALL(update->DrawGdiPlusCacheFirst, update, &(update->draw_gdiplus_cache_first)); + break; + + case ORDER_TYPE_GDIPLUS_CACHE_NEXT: + update_read_draw_gdiplus_cache_next_order(s, &(update->draw_gdiplus_cache_next)); + IFCALL(update->DrawGdiPlusCacheNext, update, &(update->draw_gdiplus_cache_next)); + break; + + case ORDER_TYPE_GDIPLUS_CACHE_END: + update_read_draw_gdiplus_cache_end_order(s, &(update->draw_gdiplus_cache_end)); + IFCALL(update->DrawGdiPlusCacheEnd, update, &(update->draw_gdiplus_cache_end)); + break; + + case ORDER_TYPE_WINDOW: + break; + + case ORDER_TYPE_COMPDESK_FIRST: break; default: diff --git a/libfreerdp-core/orders.h b/libfreerdp-core/orders.h index 00e0f363e..636b1a617 100644 --- a/libfreerdp-core/orders.h +++ b/libfreerdp-core/orders.h @@ -160,7 +160,7 @@ /* Alternate Secondary Drawing Orders */ #define ORDER_TYPE_SWITCH_SURFACE 0x00 -#define ORDER_TYPE_CREATE_OFFSCR_BITMAP 0x01 +#define ORDER_TYPE_CREATE_OFFSCREEN_BITMAP 0x01 #define ORDER_TYPE_STREAM_BITMAP_FIRST 0x02 #define ORDER_TYPE_STREAM_BITMAP_NEXT 0x03 #define ORDER_TYPE_CREATE_NINE_GRID_BITMAP 0x04 diff --git a/libfreerdp-core/update.c b/libfreerdp-core/update.c index 10caeea0a..77b95f03c 100644 --- a/libfreerdp-core/update.c +++ b/libfreerdp-core/update.c @@ -92,7 +92,7 @@ void update_read_bitmap_data(STREAM* s, BITMAP_DATA* bitmap_data) bitmap_data->length, bitmap_data->bpp, bitmap_data->bpp); if (status != True) - printf("bitmap decompression failed\n"); + printf("bitmap decompression failed, bpp:%d\n", bitmap_data->bpp); } void update_read_bitmap(rdpUpdate* update, STREAM* s, BITMAP_UPDATE* bitmap_update) diff --git a/libfreerdp-gdi/gdi.c b/libfreerdp-gdi/gdi.c index 06933bd8f..d81e4790e 100644 --- a/libfreerdp-gdi/gdi.c +++ b/libfreerdp-gdi/gdi.c @@ -1101,6 +1101,72 @@ void gdi_set_bounds(rdpUpdate* update, BOUNDS* bounds) } } +void gdi_dstblt(rdpUpdate* update, DSTBLT_ORDER* dstblt) +{ + GDI* gdi = GET_GDI(update); + + gdi_BitBlt(gdi->drawing->hdc, dstblt->nLeftRect, dstblt->nTopRect, + dstblt->nWidth, dstblt->nHeight, NULL, 0, 0, gdi_rop3_code(dstblt->bRop)); +} + +void gdi_patblt(rdpUpdate* update, PATBLT_ORDER* patblt) +{ + HGDI_BRUSH originalBrush; + GDI* gdi = GET_GDI(update); + + if (patblt->brushStyle & CACHED_BRUSH) + { + /* obtain brush from cache */ + } + + patblt->brushStyle &= 0x7F; + + if (patblt->brushStyle == BS_SOLID) + { + uint32 color; + originalBrush = gdi->drawing->hdc->brush; + + color = gdi_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, + patblt->nWidth, patblt->nHeight, gdi_rop3_code(patblt->bRop)); + + gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush); + gdi->drawing->hdc->brush = originalBrush; + } + else if (patblt->brushStyle == BS_PATTERN) + { + uint8* data; + HGDI_BITMAP hBmp; + + data = (uint8*) &patblt->brushHatch; + + data = gdi_mono_image_convert(data, 8, 8, gdi->srcBpp, gdi->dstBpp, + patblt->backColor, patblt->foreColor, 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, patblt->nLeftRect, patblt->nTopRect, + patblt->nWidth, patblt->nHeight, gdi_rop3_code(patblt->bRop)); + + gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush); + gdi->drawing->hdc->brush = originalBrush; + } +} + +void gdi_scrblt(rdpUpdate* update, SCRBLT_ORDER* scrblt) +{ + GDI* gdi = GET_GDI(update); + + gdi_BitBlt(gdi->drawing->hdc, scrblt->nLeftRect, scrblt->nTopRect, + scrblt->nWidth, scrblt->nHeight, gdi->primary->hdc, + scrblt->nXSrc, scrblt->nYSrc, gdi_rop3_code(scrblt->bRop)); +} + void gdi_opaque_rect(rdpUpdate* update, OPAQUE_RECT_ORDER* opaque_rect) { GDI_RECT rect; @@ -1119,6 +1185,11 @@ void gdi_opaque_rect(rdpUpdate* update, OPAQUE_RECT_ORDER* opaque_rect) gdi_DeleteObject((HGDIOBJECT) hBrush); } +void gdi_multi_opaque_rect(rdpUpdate* update, MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect) +{ + +} + /** * Register GDI callbacks with libfreerdp. * @param inst current instance @@ -1130,28 +1201,28 @@ void gdi_register_update_callbacks(rdpUpdate* update) update->Bitmap = gdi_bitmap_update; update->Palette = gdi_palette_update; update->SetBounds = gdi_set_bounds; - update->DstBlt = NULL; - update->PatBlt = NULL; - update->ScrBlt = NULL; - update->DrawNineGrid = NULL; - update->MultiDrawNineGrid = NULL; - update->LineTo = NULL; + update->DstBlt = gdi_dstblt; + update->PatBlt = gdi_patblt; + update->ScrBlt = gdi_scrblt; update->OpaqueRect = gdi_opaque_rect; - update->SaveBitmap = NULL; - update->MemBlt = NULL; - update->Mem3Blt = NULL; + update->DrawNineGrid = NULL; update->MultiDstBlt = NULL; update->MultiPatBlt = NULL; update->MultiScrBlt = NULL; - update->MultiOpaqueRect = NULL; + update->MultiOpaqueRect = gdi_multi_opaque_rect; + update->MultiDrawNineGrid = NULL; + update->LineTo = NULL; + update->Polyline = NULL; + update->MemBlt = NULL; + update->Mem3Blt = NULL; + update->SaveBitmap = NULL; update->FastIndex = NULL; + update->FastGlyph = NULL; + update->GlyphIndex = NULL; update->PolygonSC = NULL; update->PolygonCB = NULL; - update->Polyline = NULL; - update->FastGlyph = NULL; update->EllipseSC = NULL; update->EllipseCB = NULL; - update->GlyphIndex = NULL; } /**