update: move secondary drawing orders to sub-interface
authorMarc-André Moreau <marcandre.moreau@gmail.com>
Tue, 22 Nov 2011 00:41:49 +0000 (19:41 -0500)
committerMarc-André Moreau <marcandre.moreau@gmail.com>
Tue, 22 Nov 2011 00:41:49 +0000 (19:41 -0500)
21 files changed:
client/DirectFB/dfreerdp.c
client/X11/xf_gdi.c
client/X11/xfreerdp.c
client/test/freerdp.c
include/freerdp/primary.h
include/freerdp/secondary.h
include/freerdp/update.h
libfreerdp-cache/bitmap.c
libfreerdp-cache/brush.c
libfreerdp-cache/glyph.c
libfreerdp-cache/palette.c
libfreerdp-core/capabilities.c
libfreerdp-core/connection.c
libfreerdp-core/fastpath.c
libfreerdp-core/freerdp.c
libfreerdp-core/orders.c
libfreerdp-core/surface.c
libfreerdp-core/update.c
libfreerdp-gdi/gdi.c
server/X11/xf_peer.c
server/test/tfreerdp.c

index ea0966a..d34ad55 100644 (file)
@@ -50,19 +50,19 @@ void df_context_free(freerdp* instance, rdpContext* context)
 
 }
 
-void df_begin_paint(rdpUpdate* update)
+void df_begin_paint(rdpContext* context)
 {
-       rdpGdi* gdi = update->context->gdi;
+       rdpGdi* gdi = context->gdi;
        gdi->primary->hdc->hwnd->invalid->null = 1;
 }
 
-void df_end_paint(rdpUpdate* update)
+void df_end_paint(rdpContext* context)
 {
        rdpGdi* gdi;
        dfInfo* dfi;
 
-       gdi = update->context->gdi;
-       dfi = ((dfContext*) update->context)->dfi;
+       gdi = context->gdi;
+       dfi = ((dfContext*) context)->dfi;
 
        if (gdi->primary->hdc->hwnd->invalid->null)
                return;
index 30d6b91..2d7ee67 100644 (file)
@@ -262,17 +262,17 @@ Pixmap xf_glyph_new(xfInfo* xfi, int width, int height, uint8* data)
        return bitmap;
 }
 
-void xf_gdi_palette_update(rdpUpdate* update, PALETTE_UPDATE* palette)
+void xf_gdi_palette_update(rdpContext* context, PALETTE_UPDATE* palette)
 {
-       xfInfo* xfi = ((xfContext*) update->context)->xfi;
+       xfInfo* xfi = ((xfContext*) context)->xfi;
        xfi->clrconv->palette->count = palette->number;
        xfi->clrconv->palette->entries = palette->entries;
 }
 
-void xf_gdi_set_bounds(rdpUpdate* update, BOUNDS* bounds)
+void xf_gdi_set_bounds(rdpContext* context, rdpBounds* bounds)
 {
        XRectangle clip;
-       xfInfo* xfi = ((xfContext*) update->context)->xfi;
+       xfInfo* xfi = ((xfContext*) context)->xfi;
 
        if (bounds != NULL)
        {
@@ -613,18 +613,19 @@ void xf_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
 
 }
 
-void xf_gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_command)
+void xf_gdi_surface_bits(rdpContext* context, SURFACE_BITS_COMMAND* surface_bits_command)
 {
        int i, tx, ty;
        XImage* image;
        RFX_MESSAGE* message;
-       xfInfo* xfi = ((xfContext*) update->context)->xfi;
-       RFX_CONTEXT* context = (RFX_CONTEXT*) xfi->rfx_context;
-       NSC_CONTEXT* ncontext = (NSC_CONTEXT*) xfi->nsc_context;
+       xfInfo* xfi = ((xfContext*) context)->xfi;
+       RFX_CONTEXT* rfx_context = (RFX_CONTEXT*) xfi->rfx_context;
+       NSC_CONTEXT* nsc_context = (NSC_CONTEXT*) xfi->nsc_context;
 
        if (surface_bits_command->codecID == CODEC_ID_REMOTEFX)
        {
-               message = rfx_process_message(context, surface_bits_command->bitmapData, surface_bits_command->bitmapDataLength);
+               message = rfx_process_message(rfx_context,
+                               surface_bits_command->bitmapData, surface_bits_command->bitmapDataLength);
 
                XSetFunction(xfi->display, xfi->gc, GXcopy);
                XSetFillStyle(xfi->display, xfi->gc, FillSolid);
@@ -662,20 +663,20 @@ void xf_gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_c
                }
 
                XSetClipMask(xfi->display, xfi->gc, None);
-               rfx_message_free(context, message);
+               rfx_message_free(rfx_context, message);
        }
        else if (surface_bits_command->codecID == CODEC_ID_NSCODEC)
        {
-               ncontext->width = surface_bits_command->width;
-               ncontext->height = surface_bits_command->height;
-               nsc_process_message(ncontext, surface_bits_command->bitmapData, surface_bits_command->bitmapDataLength);
+               nsc_context->width = surface_bits_command->width;
+               nsc_context->height = surface_bits_command->height;
+               nsc_process_message(nsc_context, surface_bits_command->bitmapData, surface_bits_command->bitmapDataLength);
                XSetFunction(xfi->display, xfi->gc, GXcopy);
                XSetFillStyle(xfi->display, xfi->gc, FillSolid);
 
                xfi->bmp_codec_nsc = (uint8*) xrealloc(xfi->bmp_codec_nsc,
                                surface_bits_command->width * surface_bits_command->height * 4);
 
-               freerdp_image_flip(ncontext->bmpdata, xfi->bmp_codec_nsc,
+               freerdp_image_flip(nsc_context->bmpdata, xfi->bmp_codec_nsc,
                                surface_bits_command->width, surface_bits_command->height, 32);
 
                image = XCreateImage(xfi->display, xfi->visual, 24, ZPixmap, 0,
@@ -697,7 +698,7 @@ void xf_gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_c
                                surface_bits_command->width, surface_bits_command->height);
 
                XSetClipMask(xfi->display, xfi->gc, None);
-               nsc_context_destroy(ncontext);
+               nsc_context_destroy(nsc_context);
        }
        else if (surface_bits_command->codecID == CODEC_ID_NONE)
        {
index d6c3a66..34726c1 100644 (file)
@@ -90,24 +90,22 @@ void xf_context_free(freerdp* instance, rdpContext* context)
 
 }
 
-void xf_sw_begin_paint(rdpUpdate* update)
+void xf_sw_begin_paint(rdpContext* context)
 {
-       rdpGdi* gdi = update->context->gdi;
+       rdpGdi* gdi = context->gdi;
        gdi->primary->hdc->hwnd->invalid->null = 1;
        gdi->primary->hdc->hwnd->ninvalid = 0;
 }
 
-void xf_sw_end_paint(rdpUpdate* update)
+void xf_sw_end_paint(rdpContext* context)
 {
        rdpGdi* gdi;
        xfInfo* xfi;
        sint32 x, y;
        uint32 w, h;
-       xfContext* context;
 
-       context = (xfContext*) update->context;
-       gdi = update->context->gdi;
-       xfi = context->xfi;
+       xfi = ((xfContext*) context)->xfi;
+       gdi = context->gdi;
 
        if (xfi->remote_app != true)
        {
@@ -160,21 +158,21 @@ void xf_sw_end_paint(rdpUpdate* update)
                w = gdi->primary->hdc->hwnd->invalid->w;
                h = gdi->primary->hdc->hwnd->invalid->h;
 
-               xf_rail_paint(xfi, update->context->rail, x, y, x + w - 1, y + h - 1);
+               xf_rail_paint(xfi, context->rail, x, y, x + w - 1, y + h - 1);
        }
 }
 
-void xf_sw_desktop_resize(rdpUpdate* update)
+void xf_sw_desktop_resize(rdpContext* context)
 {
        xfInfo* xfi;
        rdpSettings* settings;
 
-       xfi = ((xfContext*) update->context)->xfi;
+       xfi = ((xfContext*) context)->xfi;
        settings = xfi->instance->settings;
 
        if (xfi->fullscreen != true)
        {
-               rdpGdi* gdi = update->context->gdi;
+               rdpGdi* gdi = context->gdi;
                gdi_resize(gdi, xfi->width, xfi->height);
 
                if (xfi->image)
@@ -187,21 +185,21 @@ void xf_sw_desktop_resize(rdpUpdate* update)
        }
 }
 
-void xf_hw_begin_paint(rdpUpdate* update)
+void xf_hw_begin_paint(rdpContext* context)
 {
        xfInfo* xfi;
-       xfi = ((xfContext*) update->context)->xfi;
+       xfi = ((xfContext*) context)->xfi;
        xfi->hdc->hwnd->invalid->null = 1;
        xfi->hdc->hwnd->ninvalid = 0;
 }
 
-void xf_hw_end_paint(rdpUpdate* update)
+void xf_hw_end_paint(rdpContext* context)
 {
        xfInfo* xfi;
        sint32 x, y;
        uint32 w, h;
 
-       xfi = ((xfContext*) update->context)->xfi;
+       xfi = ((xfContext*) context)->xfi;
 
        if (xfi->remote_app)
        {
@@ -213,17 +211,17 @@ void xf_hw_end_paint(rdpUpdate* update)
                w = xfi->hdc->hwnd->invalid->w;
                h = xfi->hdc->hwnd->invalid->h;
 
-               xf_rail_paint(xfi, update->context->rail, x, y, x + w - 1, y + h - 1);
+               xf_rail_paint(xfi, context->rail, x, y, x + w - 1, y + h - 1);
        }
 }
 
-void xf_hw_desktop_resize(rdpUpdate* update)
+void xf_hw_desktop_resize(rdpContext* context)
 {
        xfInfo* xfi;
        boolean same;
        rdpSettings* settings;
 
-       xfi = ((xfContext*) update->context)->xfi;
+       xfi = ((xfContext*) context)->xfi;
        settings = xfi->instance->settings;
 
        if (xfi->fullscreen != true)
index e7eb61b..804d5df 100644 (file)
@@ -74,15 +74,15 @@ void tf_context_free(freerdp* instance, rdpContext* context)
 
 }
 
-void tf_begin_paint(rdpUpdate* update)
+void tf_begin_paint(rdpContext* context)
 {
-       rdpGdi* gdi = update->context->gdi;
+       rdpGdi* gdi = context->gdi;
        gdi->primary->hdc->hwnd->invalid->null = 1;
 }
 
-void tf_end_paint(rdpUpdate* update)
+void tf_end_paint(rdpContext* context)
 {
-       rdpGdi* gdi = update->context->gdi;
+       rdpGdi* gdi = context->gdi;
 
        if (gdi->primary->hdc->hwnd->invalid->null)
                return;
index 0adcb6e..0ec4ee7 100644 (file)
 
 #include <freerdp/types.h>
 
-struct _BOUNDS
+struct rdp_bounds
 {
        sint16 left;
        sint16 top;
        sint16 right;
        sint16 bottom;
 };
-typedef struct _BOUNDS BOUNDS;
+typedef struct rdp_bounds rdpBounds;
 
 struct rdp_brush
 {
@@ -48,7 +48,7 @@ struct _ORDER_INFO
 {
        uint8 orderType;
        uint32 fieldFlags;
-       BOUNDS bounds;
+       rdpBounds bounds;
        sint8 deltaBoundLeft;
        sint8 deltaBoundTop;
        sint8 deltaBoundRight;
index 6cb2bfe..bd1274a 100644 (file)
@@ -180,13 +180,13 @@ struct _CACHE_BRUSH_ORDER
 };
 typedef struct _CACHE_BRUSH_ORDER CACHE_BRUSH_ORDER;
 
-typedef void (*pCacheBitmap)(rdpUpdate* update, CACHE_BITMAP_ORDER* cache_bitmap_order);
-typedef void (*pCacheBitmapV2)(rdpUpdate* update, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2_order);
-typedef void (*pCacheBitmapV3)(rdpUpdate* update, CACHE_BITMAP_V3_ORDER* cache_bitmap_v3_order);
-typedef void (*pCacheColorTable)(rdpUpdate* update, CACHE_COLOR_TABLE_ORDER* cache_color_table_order);
-typedef void (*pCacheGlyph)(rdpUpdate* update, CACHE_GLYPH_ORDER* cache_glyph_order);
-typedef void (*pCacheGlyphV2)(rdpUpdate* update, CACHE_GLYPH_V2_ORDER* cache_glyph_v2_order);
-typedef void (*pCacheBrush)(rdpUpdate* update, CACHE_BRUSH_ORDER* cache_brush_order);
+typedef void (*pCacheBitmap)(rdpContext* context, CACHE_BITMAP_ORDER* cache_bitmap_order);
+typedef void (*pCacheBitmapV2)(rdpContext* context, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2_order);
+typedef void (*pCacheBitmapV3)(rdpContext* context, CACHE_BITMAP_V3_ORDER* cache_bitmap_v3_order);
+typedef void (*pCacheColorTable)(rdpContext* context, CACHE_COLOR_TABLE_ORDER* cache_color_table_order);
+typedef void (*pCacheGlyph)(rdpContext* context, CACHE_GLYPH_ORDER* cache_glyph_order);
+typedef void (*pCacheGlyphV2)(rdpContext* context, CACHE_GLYPH_V2_ORDER* cache_glyph_v2_order);
+typedef void (*pCacheBrush)(rdpContext* context, CACHE_BRUSH_ORDER* cache_brush_order);
 
 struct rdp_secondary_update
 {
@@ -204,6 +204,7 @@ struct rdp_secondary_update
 
        /* internal */
 
+       boolean glyph_v2;
        CACHE_BITMAP_ORDER cache_bitmap_order;
        CACHE_BITMAP_V2_ORDER cache_bitmap_v2_order;
        CACHE_BITMAP_V3_ORDER cache_bitmap_v3_order;
index cbcb767..55d3862 100644 (file)
@@ -115,20 +115,21 @@ typedef struct _SURFACE_BITS_COMMAND SURFACE_BITS_COMMAND;
 
 /* Update Interface */
 
-typedef void (*pBeginPaint)(rdpUpdate* update);
-typedef void (*pEndPaint)(rdpUpdate* update);
-typedef void (*pSetBounds)(rdpUpdate* update, BOUNDS* bounds);
-typedef void (*pSynchronize)(rdpUpdate* update);
-typedef void (*pDesktopResize)(rdpUpdate* update);
-typedef void (*pBitmapUpdate)(rdpUpdate* update, BITMAP_UPDATE* bitmap);
-typedef void (*pPalette)(rdpUpdate* update, PALETTE_UPDATE* palette);
-typedef void (*pPlaySound)(rdpUpdate* update, PLAY_SOUND_UPDATE* play_sound);
+typedef void (*pBeginPaint)(rdpContext* context);
+typedef void (*pEndPaint)(rdpContext* context);
+typedef void (*pSetBounds)(rdpContext* context, rdpBounds* bounds);
 
-typedef void (*pRefreshRect)(rdpUpdate* update, uint8 count, RECTANGLE_16* areas);
-typedef void (*pSuppressOutput)(rdpUpdate* update, uint8 allow, RECTANGLE_16* area);
+typedef void (*pSynchronize)(rdpContext* context);
+typedef void (*pDesktopResize)(rdpContext* context);
+typedef void (*pBitmapUpdate)(rdpContext* context, BITMAP_UPDATE* bitmap);
+typedef void (*pPalette)(rdpContext* context, PALETTE_UPDATE* palette);
+typedef void (*pPlaySound)(rdpContext* context, PLAY_SOUND_UPDATE* play_sound);
 
-typedef void (*pSurfaceCommand)(rdpUpdate* update, STREAM* s);
-typedef void (*pSurfaceBits)(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_command);
+typedef void (*pRefreshRect)(rdpContext* context, uint8 count, RECTANGLE_16* areas);
+typedef void (*pSuppressOutput)(rdpContext* context, uint8 allow, RECTANGLE_16* area);
+
+typedef void (*pSurfaceCommand)(rdpContext* context, STREAM* s);
+typedef void (*pSurfaceBits)(rdpContext* context, SURFACE_BITS_COMMAND* surface_bits_command);
 
 struct rdp_update
 {
@@ -146,57 +147,40 @@ struct rdp_update
        uint32 paddingB[32 - 24]; /* 24 */
 
        rdpPointerUpdate* pointer; /* 32 */
-       uint32 paddingC[48 - 33]; /* 33 */
-
-       rdpPrimaryUpdate* primary; /* 48 */
-       uint32 paddingD[80 - 49]; /* 49 */
-
-       pCacheBitmap CacheBitmap; /* 80 */
-       pCacheBitmapV2 CacheBitmapV2; /* 81 */
-       pCacheBitmapV3 CacheBitmapV3; /* 82 */
-       pCacheColorTable CacheColorTable; /* 83 */
-       pCacheGlyph CacheGlyph; /* 84 */
-       pCacheGlyphV2 CacheGlyphV2; /* 85 */
-       pCacheBrush CacheBrush; /* 86 */
-       uint32 paddingE[112 - 87]; /* 87 */
-
-       pCreateOffscreenBitmap CreateOffscreenBitmap; /* 112 */
-       pSwitchSurface SwitchSurface; /* 113 */
-       pCreateNineGridBitmap CreateNineGridBitmap; /* 114 */
-       pFrameMarker FrameMarker; /* 115 */
-       pStreamBitmapFirst StreamBitmapFirst; /* 116 */
-       pStreamBitmapNext StreamBitmapNext; /* 117 */
-       pDrawGdiPlusFirst DrawGdiPlusFirst; /* 118 */
-       pDrawGdiPlusNext DrawGdiPlusNext; /* 119 */
-       pDrawGdiPlusEnd DrawGdiPlusEnd; /* 120 */
-       pDrawGdiPlusCacheFirst DrawGdiPlusCacheFirst; /* 121 */
-       pDrawGdiPlusCacheNext DrawGdiPlusCacheNext; /* 122 */
-       pDrawGdiPlusCacheEnd DrawGdiPlusCacheEnd; /* 123 */
-       uint32 paddingF[144 - 124]; /* 124 */
-
-       pWindowCreate WindowCreate; /* 144 */
-       pWindowUpdate WindowUpdate; /* 145 */
-       pWindowIcon WindowIcon; /* 146 */
-       pWindowCachedIcon WindowCachedIcon; /* 147 */
-       pWindowDelete WindowDelete; /* 148 */
-       pNotifyIconCreate NotifyIconCreate; /* 149 */
-       pNotifyIconUpdate NotifyIconUpdate; /* 150 */
-       pNotifyIconDelete NotifyIconDelete; /* 151 */
-       pMonitoredDesktop MonitoredDesktop; /* 152 */
-       pNonMonitoredDesktop NonMonitoredDesktop; /* 153 */
-       uint32 paddingG[176 - 154]; /* 154 */
-
-       pRefreshRect RefreshRect; /* 176 */
-       pSuppressOutput SuppressOutput; /* 177 */
-       uint32 paddingH[192 - 178]; /* 178 */
-
-       pSurfaceCommand SurfaceCommand; /* 192 */
-       pSurfaceBits SurfaceBits; /* 193 */
-       uint32 paddingI[208 - 194]; /* 194 */
-
-       /* everything below is internal, and should not be directly accessed */
-
-       boolean glyph_v2;
+       rdpPrimaryUpdate* primary; /* 33 */
+       rdpSecondaryUpdate* secondary; /* 34 */
+
+       pCreateOffscreenBitmap CreateOffscreenBitmap;
+       pSwitchSurface SwitchSurface;
+       pCreateNineGridBitmap CreateNineGridBitmap;
+       pFrameMarker FrameMarker;
+       pStreamBitmapFirst StreamBitmapFirst;
+       pStreamBitmapNext StreamBitmapNext;
+       pDrawGdiPlusFirst DrawGdiPlusFirst;
+       pDrawGdiPlusNext DrawGdiPlusNext;
+       pDrawGdiPlusEnd DrawGdiPlusEnd;
+       pDrawGdiPlusCacheFirst DrawGdiPlusCacheFirst;
+       pDrawGdiPlusCacheNext DrawGdiPlusCacheNext;
+       pDrawGdiPlusCacheEnd DrawGdiPlusCacheEnd;
+
+       pWindowCreate WindowCreate;
+       pWindowUpdate WindowUpdate;
+       pWindowIcon WindowIcon;
+       pWindowCachedIcon WindowCachedIcon;
+       pWindowDelete WindowDelete;
+       pNotifyIconCreate NotifyIconCreate;
+       pNotifyIconUpdate NotifyIconUpdate;
+       pNotifyIconDelete NotifyIconDelete;
+       pMonitoredDesktop MonitoredDesktop;
+       pNonMonitoredDesktop NonMonitoredDesktop;
+
+       pRefreshRect RefreshRect;
+       pSuppressOutput SuppressOutput;
+
+       pSurfaceCommand SurfaceCommand;
+       pSurfaceBits SurfaceBits;
+
+       /* internal */
 
        boolean dump_rfx;
        boolean play_rfx;
@@ -206,14 +190,6 @@ struct rdp_update
        PALETTE_UPDATE palette_update;
        PLAY_SOUND_UPDATE play_sound;
 
-       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;
index 43f85ce..95e5844 100644 (file)
@@ -51,48 +51,48 @@ void update_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
        IFCALL(cache->bitmap->Mem3Blt, context, mem3blt);
 }
 
-void update_gdi_cache_bitmap(rdpUpdate* update, CACHE_BITMAP_ORDER* cache_bitmap)
+void update_gdi_cache_bitmap(rdpContext* context, CACHE_BITMAP_ORDER* cache_bitmap)
 {
        printf("Warning: CacheBitmapV1 Unimplemented\n");
 }
 
-void update_gdi_cache_bitmap_v2(rdpUpdate* update, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2)
+void update_gdi_cache_bitmap_v2(rdpContext* context, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2)
 {
        rdpBitmap* bitmap;
        rdpBitmap* prevBitmap;
-       rdpCache* cache = update->context->cache;
+       rdpCache* cache = context->cache;
 
-       bitmap = Bitmap_Alloc(update->context);
+       bitmap = Bitmap_Alloc(context);
 
-       Bitmap_SetDimensions(update->context, bitmap, cache_bitmap_v2->bitmapWidth, cache_bitmap_v2->bitmapHeight);
+       Bitmap_SetDimensions(context, bitmap, cache_bitmap_v2->bitmapWidth, cache_bitmap_v2->bitmapHeight);
 
-       bitmap->Decompress(update->context, bitmap,
+       bitmap->Decompress(context, bitmap,
                        cache_bitmap_v2->bitmapDataStream, cache_bitmap_v2->bitmapWidth, cache_bitmap_v2->bitmapHeight,
                        cache_bitmap_v2->bitmapBpp, cache_bitmap_v2->bitmapLength, cache_bitmap_v2->compressed);
 
-       bitmap->New(update->context, bitmap);
+       bitmap->New(context, bitmap);
 
        prevBitmap = bitmap_cache_get(cache->bitmap, cache_bitmap_v2->cacheId, cache_bitmap_v2->cacheIndex);
 
        if (prevBitmap != NULL)
-               Bitmap_Free(update->context, prevBitmap);
+               Bitmap_Free(context, prevBitmap);
 
        bitmap_cache_put(cache->bitmap, cache_bitmap_v2->cacheId, cache_bitmap_v2->cacheIndex, bitmap);
 }
 
-void update_gdi_bitmap_update(rdpUpdate* update, BITMAP_UPDATE* bitmap_update)
+void update_gdi_bitmap_update(rdpContext* context, BITMAP_UPDATE* bitmap_update)
 {
        int i;
        rdpBitmap* bitmap;
        BITMAP_DATA* bitmap_data;
-       rdpCache* cache = update->context->cache;
-       int reused = 1;
+       boolean reused = true;
+       rdpCache* cache = context->cache;
 
        if (cache->bitmap->bitmap == NULL)
        {
-               cache->bitmap->bitmap = Bitmap_Alloc(update->context);
+               cache->bitmap->bitmap = Bitmap_Alloc(context);
                cache->bitmap->bitmap->ephemeral = true;
-               reused = 0;
+               reused = false;
        }
 
        bitmap = cache->bitmap->bitmap;
@@ -105,24 +105,24 @@ void update_gdi_bitmap_update(rdpUpdate* update, BITMAP_UPDATE* bitmap_update)
                bitmap->length = bitmap_data->bitmapLength;
                bitmap->compressed = bitmap_data->compressed;
 
-               Bitmap_SetRectangle(update->context, bitmap,
+               Bitmap_SetRectangle(context, bitmap,
                                bitmap_data->destLeft, bitmap_data->destTop,
                                bitmap_data->destRight, bitmap_data->destBottom);
 
-               Bitmap_SetDimensions(update->context, bitmap, bitmap_data->width, bitmap_data->height);
+               Bitmap_SetDimensions(context, bitmap, bitmap_data->width, bitmap_data->height);
 
-               bitmap->Decompress(update->context, bitmap,
+               bitmap->Decompress(context, bitmap,
                                bitmap_data->bitmapDataStream, bitmap_data->width, bitmap_data->height,
                                bitmap_data->bitsPerPixel, bitmap_data->bitmapLength, bitmap_data->compressed);
 
                if (reused)
-                       bitmap->Free(update->context, bitmap);
+                       bitmap->Free(context, bitmap);
                else
-                       reused = 1;
+                       reused = true;
 
-               bitmap->New(update->context, bitmap);
+               bitmap->New(context, bitmap);
 
-               bitmap->Paint(update->context, bitmap);
+               bitmap->Paint(context, bitmap);
        }
 }
 
@@ -179,8 +179,10 @@ void bitmap_cache_register_callbacks(rdpUpdate* update)
 
        update->primary->MemBlt = update_gdi_memblt;
        update->primary->Mem3Blt = update_gdi_mem3blt;
-       update->CacheBitmap = update_gdi_cache_bitmap;
-       update->CacheBitmapV2 = update_gdi_cache_bitmap_v2;
+
+       update->secondary->CacheBitmap = update_gdi_cache_bitmap;
+       update->secondary->CacheBitmapV2 = update_gdi_cache_bitmap_v2;
+
        update->BitmapUpdate = update_gdi_bitmap_update;
 }
 
index 5b5fe15..891cd9d 100644 (file)
@@ -38,9 +38,9 @@ void update_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
        IFCALL(cache->brush->PatBlt, context, patblt);
 }
 
-void update_gdi_cache_brush(rdpUpdate* update, CACHE_BRUSH_ORDER* cache_brush)
+void update_gdi_cache_brush(rdpContext* context, CACHE_BRUSH_ORDER* cache_brush)
 {
-       rdpCache* cache = update->context->cache;
+       rdpCache* cache = context->cache;
        brush_cache_put(cache->brush, cache_brush->index, cache_brush->data, cache_brush->bpp);
 }
 
@@ -113,7 +113,7 @@ void brush_cache_register_callbacks(rdpUpdate* update)
        cache->brush->PatBlt = update->primary->PatBlt;
 
        update->primary->PatBlt = update_gdi_patblt;
-       update->CacheBrush = update_gdi_cache_brush;
+       update->secondary->CacheBrush = update_gdi_cache_brush;
 }
 
 rdpBrushCache* brush_cache_new(rdpSettings* settings)
index a89ab60..c663b2b 100644 (file)
@@ -188,18 +188,18 @@ void update_gdi_fast_index(rdpContext* context, FAST_INDEX_ORDER* fast_index)
                        fast_index->opRight - fast_index->opLeft, fast_index->opBottom - fast_index->opTop);
 }
 
-void update_gdi_cache_glyph(rdpUpdate* update, CACHE_GLYPH_ORDER* cache_glyph)
+void update_gdi_cache_glyph(rdpContext* context, CACHE_GLYPH_ORDER* cache_glyph)
 {
        int i;
        rdpGlyph* glyph;
        GLYPH_DATA* glyph_data;
-       rdpCache* cache = update->context->cache;
+       rdpCache* cache = context->cache;
 
        for (i = 0; i < cache_glyph->cGlyphs; i++)
        {
                glyph_data = cache_glyph->glyphData[i];
 
-               glyph = Glyph_Alloc(update->context);
+               glyph = Glyph_Alloc(context);
 
                glyph->x = glyph_data->x;
                glyph->y = glyph_data->y;
@@ -207,13 +207,13 @@ void update_gdi_cache_glyph(rdpUpdate* update, CACHE_GLYPH_ORDER* cache_glyph)
                glyph->cy = glyph_data->cy;
                glyph->aj = glyph_data->aj;
                glyph->cb = glyph_data->cb;
-               Glyph_New(update->context, glyph);
+               Glyph_New(context, glyph);
 
                glyph_cache_put(cache->glyph, cache_glyph->cacheId, glyph_data->cacheIndex, glyph);
        }
 }
 
-void update_gdi_cache_glyph_v2(rdpUpdate* update, CACHE_GLYPH_V2_ORDER* cache_glyph_v2)
+void update_gdi_cache_glyph_v2(rdpContext* context, CACHE_GLYPH_V2_ORDER* cache_glyph_v2)
 {
 
 }
@@ -306,8 +306,8 @@ void glyph_cache_register_callbacks(rdpUpdate* update)
 {
        update->primary->GlyphIndex = update_gdi_glyph_index;
        update->primary->FastIndex = update_gdi_fast_index;
-       update->CacheGlyph = update_gdi_cache_glyph;
-       update->CacheGlyphV2 = update_gdi_cache_glyph_v2;
+       update->secondary->CacheGlyph = update_gdi_cache_glyph;
+       update->secondary->CacheGlyphV2 = update_gdi_cache_glyph_v2;
 }
 
 rdpGlyphCache* glyph_cache_new(rdpSettings* settings)
index 1e2f4e5..2ecdeb6 100644 (file)
@@ -22,9 +22,9 @@
 
 #include <freerdp/cache/palette.h>
 
-void update_gdi_cache_color_table(rdpUpdate* update, CACHE_COLOR_TABLE_ORDER* cache_color_table)
+void update_gdi_cache_color_table(rdpContext* context, CACHE_COLOR_TABLE_ORDER* cache_color_table)
 {
-       rdpCache* cache = update->context->cache;
+       rdpCache* cache = context->cache;
        palette_cache_put(cache->palette, cache_color_table->cacheIndex, (void*) cache_color_table->colorTable);
 }
 
@@ -62,7 +62,7 @@ void palette_cache_put(rdpPaletteCache* palette_cache, uint8 index, void* entry)
 
 void palette_cache_register_callbacks(rdpUpdate* update)
 {
-       update->CacheColorTable = update_gdi_cache_color_table;
+       update->secondary->CacheColorTable = update_gdi_cache_color_table;
 }
 
 rdpPaletteCache* palette_cache_new(rdpSettings* settings)
index 85004e5..08d61a9 100644 (file)
@@ -1800,7 +1800,7 @@ boolean rdp_recv_demand_active(rdpRdp* rdp, STREAM* s)
                return false;
        }
 
-       rdp->update->glyph_v2 = (rdp->settings->glyphSupportLevel > GLYPH_SUPPORT_FULL) ? true : false;
+       rdp->update->secondary->glyph_v2 = (rdp->settings->glyphSupportLevel > GLYPH_SUPPORT_FULL) ? true : false;
 
        return true;
 }
index de97f15..65e071c 100644 (file)
@@ -362,7 +362,7 @@ boolean rdp_client_connect_demand_active(rdpRdp* rdp, STREAM* s)
         */
        if (width != rdp->settings->width || height != rdp->settings->height)
        {
-               IFCALL(rdp->update->DesktopResize, rdp->update);
+               IFCALL(rdp->update->DesktopResize, rdp->update->context);
        }
 
        /**
index 3d3ae7a..327f108 100644 (file)
@@ -141,8 +141,9 @@ static void fastpath_recv_orders(rdpFastPath* fastpath, STREAM* s)
 
 static void fastpath_recv_update_common(rdpFastPath* fastpath, STREAM* s)
 {
-       rdpUpdate* update = fastpath->rdp->update;
        uint16 updateType;
+       rdpUpdate* update = fastpath->rdp->update;
+       rdpContext* context = update->context;
 
        stream_read_uint16(s, updateType); /* updateType (2 bytes) */
 
@@ -150,12 +151,12 @@ static void fastpath_recv_update_common(rdpFastPath* fastpath, STREAM* s)
        {
                case UPDATE_TYPE_BITMAP:
                        update_read_bitmap(update, s, &update->bitmap_update);
-                       IFCALL(update->BitmapUpdate, update, &update->bitmap_update);
+                       IFCALL(update->BitmapUpdate, context, &update->bitmap_update);
                        break;
 
                case UPDATE_TYPE_PALETTE:
                        update_read_palette(update, s, &update->palette_update);
-                       IFCALL(update->Palette, update, &update->palette_update);
+                       IFCALL(update->Palette, context, &update->palette_update);
                        break;
        }
 }
@@ -178,7 +179,7 @@ static void fastpath_recv_update(rdpFastPath* fastpath, uint8 updateCode, uint32
                        break;
 
                case FASTPATH_UPDATETYPE_SYNCHRONIZE:
-                       IFCALL(update->Synchronize, update);
+                       IFCALL(update->Synchronize, context);
                        break;
 
                case FASTPATH_UPDATETYPE_SURFCMDS:
@@ -301,14 +302,14 @@ boolean fastpath_recv_updates(rdpFastPath* fastpath, STREAM* s)
 {
        rdpUpdate* update = fastpath->rdp->update;
 
-       IFCALL(update->BeginPaint, update);
+       IFCALL(update->BeginPaint, update->context);
 
        while (stream_get_left(s) > 3)
        {
                fastpath_recv_update_data(fastpath, s);
        }
 
-       IFCALL(update->EndPaint, update);
+       IFCALL(update->EndPaint, update->context);
 
        return true;
 }
index ab7f6b8..84a91ce 100644 (file)
@@ -77,9 +77,9 @@ boolean freerdp_connect(freerdp* instance)
                                pcap_get_next_record_content(update->pcap_rfx, &record);
                                stream_set_pos(s, 0);
 
-                               update->BeginPaint(update);
+                               update->BeginPaint(update->context);
                                update_recv_surfcmds(update, s->size, s);
-                               update->EndPaint(update);
+                               update->EndPaint(update->context);
                        }
 
                        xfree(s->data);
@@ -147,6 +147,7 @@ void freerdp_context_new(freerdp* instance)
        instance->update->context = instance->context;
        instance->update->pointer->context = instance->context;
        instance->update->primary->context = instance->context;
+       instance->update->secondary->context = instance->context;
 
        instance->input->context = instance->context;
        input_register_client_callbacks(rdp->input);
index d30b017..27c58fc 100644 (file)
@@ -1630,7 +1630,7 @@ void update_read_field_flags(STREAM* s, uint32* fieldFlags, uint8 flags, uint8 f
        }
 }
 
-void update_read_bounds(STREAM* s, BOUNDS* bounds)
+void update_read_bounds(STREAM* s, rdpBounds* bounds)
 {
        uint8 flags;
 
@@ -1676,7 +1676,7 @@ void update_recv_primary_order(rdpUpdate* update, STREAM* s, uint8 flags)
                if (!(flags & ORDER_ZERO_BOUNDS_DELTAS))
                        update_read_bounds(s, &orderInfo->bounds);
 
-               IFCALL(update->SetBounds, update, &orderInfo->bounds);
+               IFCALL(update->SetBounds, context, &orderInfo->bounds);
        }
 
        orderInfo->deltaCoordinates = (flags & ORDER_DELTA_COORDINATES) ? true : false;
@@ -1806,7 +1806,7 @@ void update_recv_primary_order(rdpUpdate* update, STREAM* s, uint8 flags)
 
        if (flags & ORDER_BOUNDS)
        {
-               IFCALL(update->SetBounds, update, NULL);
+               IFCALL(update->SetBounds, context, NULL);
        }
 }
 
@@ -1816,6 +1816,8 @@ void update_recv_secondary_order(rdpUpdate* update, STREAM* s, uint8 flags)
        uint8 orderType;
        uint16 extraFlags;
        uint16 orderLength;
+       rdpContext* context = update->context;
+       rdpSecondaryUpdate* secondary = update->secondary;
 
        stream_read_uint16(s, orderLength); /* orderLength (2 bytes) */
        stream_read_uint16(s, extraFlags); /* extraFlags (2 bytes) */
@@ -1833,53 +1835,51 @@ void update_recv_secondary_order(rdpUpdate* update, STREAM* s, uint8 flags)
        switch (orderType)
        {
                case ORDER_TYPE_BITMAP_UNCOMPRESSED:
-                       update_read_cache_bitmap_order(s, &(update->cache_bitmap_order), false, extraFlags);
-                       IFCALL(update->CacheBitmap, update, &(update->cache_bitmap_order));
+                       update_read_cache_bitmap_order(s, &(secondary->cache_bitmap_order), false, extraFlags);
+                       IFCALL(secondary->CacheBitmap, context, &(secondary->cache_bitmap_order));
                        break;
 
                case ORDER_TYPE_CACHE_BITMAP_COMPRESSED:
-                       update_read_cache_bitmap_order(s, &(update->cache_bitmap_order), true, extraFlags);
-                       IFCALL(update->CacheBitmap, update, &(update->cache_bitmap_order));
+                       update_read_cache_bitmap_order(s, &(secondary->cache_bitmap_order), true, extraFlags);
+                       IFCALL(secondary->CacheBitmap, context, &(secondary->cache_bitmap_order));
                        break;
 
                case ORDER_TYPE_BITMAP_UNCOMPRESSED_V2:
-                       update_read_cache_bitmap_v2_order(s, &(update->cache_bitmap_v2_order), false, extraFlags);
-                       //IFCALL(update->BitmapDecompress, update, update->cache_bitmap_v2_order.bitmap);
-                       IFCALL(update->CacheBitmapV2, update, &(update->cache_bitmap_v2_order));
+                       update_read_cache_bitmap_v2_order(s, &(secondary->cache_bitmap_v2_order), false, extraFlags);
+                       IFCALL(secondary->CacheBitmapV2, context, &(secondary->cache_bitmap_v2_order));
                        break;
 
                case ORDER_TYPE_BITMAP_COMPRESSED_V2:
-                       update_read_cache_bitmap_v2_order(s, &(update->cache_bitmap_v2_order), true, extraFlags);
-                       //IFCALL(update->BitmapDecompress, update, update->cache_bitmap_v2_order.bitmap);
-                       IFCALL(update->CacheBitmapV2, update, &(update->cache_bitmap_v2_order));
+                       update_read_cache_bitmap_v2_order(s, &(secondary->cache_bitmap_v2_order), true, extraFlags);
+                       IFCALL(secondary->CacheBitmapV2, context, &(secondary->cache_bitmap_v2_order));
                        break;
 
                case ORDER_TYPE_BITMAP_COMPRESSED_V3:
-                       update_read_cache_bitmap_v3_order(s, &(update->cache_bitmap_v3_order), true, extraFlags);
-                       IFCALL(update->CacheBitmapV3, update, &(update->cache_bitmap_v3_order));
+                       update_read_cache_bitmap_v3_order(s, &(secondary->cache_bitmap_v3_order), true, extraFlags);
+                       IFCALL(secondary->CacheBitmapV3, context, &(secondary->cache_bitmap_v3_order));
                        break;
 
                case ORDER_TYPE_CACHE_COLOR_TABLE:
-                       update_read_cache_color_table_order(s, &(update->cache_color_table_order), extraFlags);
-                       IFCALL(update->CacheColorTable, update, &(update->cache_color_table_order));
+                       update_read_cache_color_table_order(s, &(secondary->cache_color_table_order), extraFlags);
+                       IFCALL(secondary->CacheColorTable, context, &(secondary->cache_color_table_order));
                        break;
 
                case ORDER_TYPE_CACHE_GLYPH:
-                       if (update->glyph_v2)
+                       if (secondary->glyph_v2)
                        {
-                               update_read_cache_glyph_v2_order(s, &(update->cache_glyph_v2_order), extraFlags);
-                               IFCALL(update->CacheGlyphV2, update, &(update->cache_glyph_v2_order));
+                               update_read_cache_glyph_v2_order(s, &(secondary->cache_glyph_v2_order), extraFlags);
+                               IFCALL(secondary->CacheGlyphV2, context, &(secondary->cache_glyph_v2_order));
                        }
                        else
                        {
-                               update_read_cache_glyph_order(s, &(update->cache_glyph_order), extraFlags);
-                               IFCALL(update->CacheGlyph, update, &(update->cache_glyph_order));
+                               update_read_cache_glyph_order(s, &(secondary->cache_glyph_order), extraFlags);
+                               IFCALL(secondary->CacheGlyph, context, &(secondary->cache_glyph_order));
                        }
                        break;
 
                case ORDER_TYPE_CACHE_BRUSH:
-                       update_read_cache_brush_order(s, &(update->cache_brush_order), extraFlags);
-                       IFCALL(update->CacheBrush, update, &(update->cache_brush_order));
+                       update_read_cache_brush_order(s, &(secondary->cache_brush_order), extraFlags);
+                       IFCALL(secondary->CacheBrush, context, &(secondary->cache_brush_order));
                        break;
 
                default:
index f9ff7bb..04fa5bd 100644 (file)
@@ -39,7 +39,7 @@ static int update_recv_surfcmd_surface_bits(rdpUpdate* update, STREAM* s)
        pos = stream_get_pos(s) + cmd->bitmapDataLength;
        cmd->bitmapData = stream_get_tail(s);
 
-       IFCALL(update->SurfaceBits, update, cmd);
+       IFCALL(update->SurfaceBits, update->context, cmd);
 
        stream_set_pos(s, pos);
 
@@ -53,7 +53,6 @@ static int update_recv_surfcmd_frame_marker(rdpUpdate* update, STREAM* s)
 
        stream_read_uint16(s, frameAction);
        stream_read_uint32(s, frameId);
-       /*printf("frameAction %d frameId %d\n", frameAction, frameId);*/
 
        return 6;
 }
index fc75559..2541c70 100644 (file)
@@ -150,7 +150,7 @@ void update_read_play_sound(STREAM* s, PLAY_SOUND_UPDATE* play_sound)
 void update_recv_play_sound(rdpUpdate* update, STREAM* s)
 {
        update_read_play_sound(s, &update->play_sound);
-       IFCALL(update->PlaySound, update, &update->play_sound);
+       IFCALL(update->PlaySound, update->context, &update->play_sound);
 }
 
 void update_read_pointer_position(STREAM* s, POINTER_POSITION_UPDATE* pointer_position)
@@ -244,12 +244,13 @@ void update_recv_pointer(rdpUpdate* update, STREAM* s)
 void update_recv(rdpUpdate* update, STREAM* s)
 {
        uint16 updateType;
+       rdpContext* context = update->context;
 
        stream_read_uint16(s, updateType); /* updateType (2 bytes) */
 
        //printf("%s Update Data PDU\n", UPDATE_TYPE_STRINGS[updateType]);
 
-       IFCALL(update->BeginPaint, update);
+       IFCALL(update->BeginPaint, context);
 
        switch (updateType)
        {
@@ -259,21 +260,21 @@ void update_recv(rdpUpdate* update, STREAM* s)
 
                case UPDATE_TYPE_BITMAP:
                        update_read_bitmap(update, s, &update->bitmap_update);
-                       IFCALL(update->BitmapUpdate, update, &update->bitmap_update);
+                       IFCALL(update->BitmapUpdate, context, &update->bitmap_update);
                        break;
 
                case UPDATE_TYPE_PALETTE:
                        update_read_palette(update, s, &update->palette_update);
-                       IFCALL(update->Palette, update, &update->palette_update);
+                       IFCALL(update->Palette, context, &update->palette_update);
                        break;
 
                case UPDATE_TYPE_SYNCHRONIZE:
                        update_read_synchronize(update, s);
-                       IFCALL(update->Synchronize, update);
+                       IFCALL(update->Synchronize, context);
                        break;
        }
 
-       IFCALL(update->EndPaint, update);
+       IFCALL(update->EndPaint, context);
 
        if (stream_get_left(s) > RDP_SHARE_DATA_HEADER_LENGTH)
        {
@@ -330,12 +331,12 @@ void update_reset_state(rdpUpdate* update)
        IFCALL(update->SwitchSurface, update, &(update->switch_surface));
 }
 
-static void update_begin_paint(rdpUpdate* update)
+static void update_begin_paint(rdpContext* context)
 {
 
 }
 
-static void update_end_paint(rdpUpdate* update)
+static void update_end_paint(rdpContext* context)
 {
 
 }
@@ -351,10 +352,10 @@ static void update_write_refresh_rect(STREAM* s, uint8 count, RECTANGLE_16* area
                freerdp_write_rectangle_16(s, &areas[i]);
 }
 
-static void update_send_refresh_rect(rdpUpdate* update, uint8 count, RECTANGLE_16* areas)
+static void update_send_refresh_rect(rdpContext* context, uint8 count, RECTANGLE_16* areas)
 {
        STREAM* s;
-       rdpRdp* rdp = update->context->rdp;
+       rdpRdp* rdp = context->rdp;
 
        s = rdp_data_pdu_init(rdp);
        update_write_refresh_rect(s, count, areas);
@@ -371,10 +372,10 @@ static void update_write_suppress_output(STREAM* s, uint8 allow, RECTANGLE_16* a
                freerdp_write_rectangle_16(s, area);
 }
 
-static void update_send_suppress_output(rdpUpdate* update, uint8 allow, RECTANGLE_16* area)
+static void update_send_suppress_output(rdpContext* context, uint8 allow, RECTANGLE_16* area)
 {
        STREAM* s;
-       rdpRdp* rdp = update->context->rdp;
+       rdpRdp* rdp = context->rdp;
 
        s = rdp_data_pdu_init(rdp);
        update_write_suppress_output(s, allow, area);
@@ -382,22 +383,22 @@ static void update_send_suppress_output(rdpUpdate* update, uint8 allow, RECTANGL
        rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_SUPPRESS_OUTPUT, rdp->mcs->user_id);
 }
 
-static void update_send_surface_command(rdpUpdate* update, STREAM* s)
+static void update_send_surface_command(rdpContext* context, STREAM* s)
 {
-       rdpRdp* rdp = update->context->rdp;
+       rdpRdp* rdp = context->rdp;
        fastpath_send_fragmented_update_pdu(rdp->fastpath, s);
 }
 
-static void update_send_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_command)
+static void update_send_surface_bits(rdpContext* context, SURFACE_BITS_COMMAND* surface_bits_command)
 {
-       rdpRdp* rdp = update->context->rdp;
+       rdpRdp* rdp = context->rdp;
        fastpath_send_surfcmd_surface_bits(rdp->fastpath, surface_bits_command);
 }
 
-static void update_send_synchronize(rdpUpdate* update)
+static void update_send_synchronize(rdpContext* context)
 {
        STREAM* s;
-       rdpRdp* rdp = update->context->rdp;
+       rdpRdp* rdp = context->rdp;
 
        s = fastpath_update_pdu_init(rdp->fastpath);
        stream_write_uint8(s, FASTPATH_UPDATETYPE_SYNCHRONIZE); /* updateHeader (1 byte) */
@@ -405,11 +406,9 @@ static void update_send_synchronize(rdpUpdate* update)
        fastpath_send_update_pdu(rdp->fastpath, s);
 }
 
-static void update_send_desktop_resize(rdpUpdate* update)
+static void update_send_desktop_resize(rdpContext* context)
 {
-       rdpRdp* rdp = update->context->rdp;
-
-       rdp_server_reactivate(rdp);
+       rdp_server_reactivate(context->rdp);
 }
 
 static void update_send_pointer_system(rdpContext* context, POINTER_SYSTEM_UPDATE* pointer_system)
@@ -453,6 +452,7 @@ rdpUpdate* update_new(rdpRdp* rdp)
 
                update->pointer = xnew(rdpPointerUpdate);
                update->primary = xnew(rdpPrimaryUpdate);
+               update->secondary = xnew(rdpSecondaryUpdate);
        }
 
        return update;
index d425ad9..08707fd 100644 (file)
@@ -430,16 +430,16 @@ void gdi_bitmap_free_ex(gdiBitmap* bitmap)
        }
 }
 
-void gdi_palette_update(rdpUpdate* update, PALETTE_UPDATE* palette)
+void gdi_palette_update(rdpContext* context, PALETTE_UPDATE* palette)
 {
-       rdpGdi* gdi = update->context->gdi;
+       rdpGdi* gdi = context->gdi;
        gdi->clrconv->palette->count = palette->number;
        gdi->clrconv->palette->entries = palette->entries;
 }
 
-void gdi_set_bounds(rdpUpdate* update, BOUNDS* bounds)
+void gdi_set_bounds(rdpContext* context, rdpBounds* bounds)
 {
-       rdpGdi* gdi = update->context->gdi;
+       rdpGdi* gdi = context->gdi;
 
        if (bounds != NULL)
        {
@@ -627,15 +627,15 @@ void gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
 
 int tilenum = 0;
 
-void gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_command)
+void gdi_surface_bits(rdpContext* context, SURFACE_BITS_COMMAND* surface_bits_command)
 {
        int i, j;
        int tx, ty;
        char* tile_bitmap;
        RFX_MESSAGE* message;
-       rdpGdi* gdi = update->context->gdi;
-       RFX_CONTEXT* context = (RFX_CONTEXT*) gdi->rfx_context;
-       NSC_CONTEXT* ncontext = (NSC_CONTEXT*) gdi->nsc_context;
+       rdpGdi* gdi = context->gdi;
+       RFX_CONTEXT* rfx_context = (RFX_CONTEXT*) gdi->rfx_context;
+       NSC_CONTEXT* nsc_context = (NSC_CONTEXT*) gdi->nsc_context;
 
        DEBUG_GDI("destLeft %d destTop %d destRight %d destBottom %d "
                "bpp %d codecID %d width %d height %d length %d",
@@ -649,7 +649,8 @@ void gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_comm
 
        if (surface_bits_command->codecID == CODEC_ID_REMOTEFX)
        {
-               message = rfx_process_message(context, surface_bits_command->bitmapData, surface_bits_command->bitmapDataLength);
+               message = rfx_process_message(rfx_context,
+                               surface_bits_command->bitmapData, surface_bits_command->bitmapDataLength);
 
                DEBUG_GDI("num_rects %d num_tiles %d", message->num_rects, message->num_tiles);
 
@@ -678,21 +679,21 @@ void gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_comm
                }
 
                gdi_SetNullClipRgn(gdi->primary->hdc);
-               rfx_message_free(context, message);
+               rfx_message_free(rfx_context, message);
        }
        else if (surface_bits_command->codecID == CODEC_ID_NSCODEC)
        {
-               ncontext->width = surface_bits_command->width;
-               ncontext->height = surface_bits_command->height;
-               nsc_process_message(ncontext, surface_bits_command->bitmapData, surface_bits_command->bitmapDataLength);
+               nsc_context->width = surface_bits_command->width;
+               nsc_context->height = surface_bits_command->height;
+               nsc_process_message(nsc_context, surface_bits_command->bitmapData, surface_bits_command->bitmapDataLength);
                gdi->image->bitmap->width = surface_bits_command->width;
                gdi->image->bitmap->height = surface_bits_command->height;
                gdi->image->bitmap->bitsPerPixel = surface_bits_command->bpp;
                gdi->image->bitmap->bytesPerPixel = gdi->image->bitmap->bitsPerPixel / 8;
                gdi->image->bitmap->data = (uint8*) xrealloc(gdi->image->bitmap->data, gdi->image->bitmap->width * gdi->image->bitmap->height * 4);
-               freerdp_image_flip(ncontext->bmpdata, gdi->image->bitmap->data, gdi->image->bitmap->width, gdi->image->bitmap->height, 32);
+               freerdp_image_flip(nsc_context->bmpdata, 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, surface_bits_command->width, surface_bits_command->height, gdi->image->hdc, 0, 0, GDI_SRCCOPY);
-               nsc_context_destroy(ncontext);
+               nsc_context_destroy(nsc_context);
        } 
        else if (surface_bits_command->codecID == CODEC_ID_NONE)
        {
index 8d20869..91eb962 100644 (file)
@@ -218,7 +218,7 @@ void xf_peer_live_rfx(freerdp_peer* client)
                cmd->height = height;
                cmd->bitmapDataLength = stream_get_length(s);
                cmd->bitmapData = stream_get_head(s);
-               update->SurfaceBits(update, cmd);
+               update->SurfaceBits(update->context, cmd);
        }
 }
 
@@ -293,7 +293,7 @@ void xf_peer_dump_rfx(freerdp_peer* client)
                if (xf_pcap_dump_realtime && xf_peer_sleep_tsdiff(&prev_seconds, &prev_useconds, record.header.ts_sec, record.header.ts_usec) == false)
                         break;
 
-               update->SurfaceCommand(update, s);
+               update->SurfaceCommand(update->context, s);
        }
 }
 
@@ -329,7 +329,7 @@ boolean xf_peer_post_connect(freerdp_peer* client)
 
        client->settings->width = xfi->width;
        client->settings->height = xfi->height;
-       client->update->DesktopResize(client->update);
+       client->update->DesktopResize(client->update->context);
        xfp->activated = false;
 
        /* Return false here would stop the execution of the peer mainloop. */
@@ -381,7 +381,7 @@ void xf_peer_keyboard_event(rdpInput* input, uint16 flags, uint16 code)
                        client->settings->width = 640;
                        client->settings->height = 480;
                }
-               update->DesktopResize(update);
+               update->DesktopResize(update->context);
                xfp->activated = false;
        }
 }
index fee0d5e..ebde3fe 100644 (file)
@@ -135,7 +135,7 @@ static void test_peer_draw_background(freerdp_peer* client)
        cmd->height = rect.height;
        cmd->bitmapDataLength = stream_get_length(s);
        cmd->bitmapData = stream_get_head(s);
-       update->SurfaceBits(update, cmd);
+       update->SurfaceBits(update->context, cmd);
 
        xfree(rgb_data);
 }
@@ -219,7 +219,7 @@ static void test_peer_draw_icon(freerdp_peer* client, int x, int y)
                cmd->height = context->icon_height;
                cmd->bitmapDataLength = stream_get_length(s);
                cmd->bitmapData = stream_get_head(s);
-               update->SurfaceBits(update, cmd);
+               update->SurfaceBits(update->context, cmd);
        }
 
        s = test_peer_stream_init(context);
@@ -236,7 +236,7 @@ static void test_peer_draw_icon(freerdp_peer* client, int x, int y)
        cmd->height = context->icon_height;
        cmd->bitmapDataLength = stream_get_length(s);
        cmd->bitmapData = stream_get_head(s);
-       update->SurfaceBits(update, cmd);
+       update->SurfaceBits(update->context, cmd);
 
        context->icon_x = x;
        context->icon_y = y;
@@ -313,7 +313,7 @@ void tf_peer_dump_rfx(freerdp_peer* client)
                if (test_dump_rfx_realtime && test_sleep_tsdiff(&prev_seconds, &prev_useconds, record.header.ts_sec, record.header.ts_usec) == false)
                        break;
 
-               update->SurfaceCommand(update, s);
+               update->SurfaceCommand(update->context, s);
        }
 }
 
@@ -391,7 +391,7 @@ void tf_peer_keyboard_event(rdpInput* input, uint16 flags, uint16 code)
                        client->settings->width = 640;
                        client->settings->height = 480;
                }
-               update->DesktopResize(update);
+               update->DesktopResize(update->context);
                context->activated = false;
        }
 }