From d3302341e7cf8bbca2bc57afe9cbdac205c1e97b Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 8 Jan 2012 15:18:31 -0800 Subject: [PATCH] Add cache and bitmap decompress stub. --- protocols/rdp/configure.in | 1 + protocols/rdp/include/rdp_bitmap.h | 1 + protocols/rdp/src/client.c | 17 ++++++++++++++++- protocols/rdp/src/rdp_bitmap.c | 5 +++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/protocols/rdp/configure.in b/protocols/rdp/configure.in index a86ee998..fa117499 100644 --- a/protocols/rdp/configure.in +++ b/protocols/rdp/configure.in @@ -46,6 +46,7 @@ AC_PROG_LIBTOOL # Checks for libraries. AC_CHECK_LIB([guac], [guac_client_plugin_open],, AC_MSG_ERROR("libguac must be installed first")) AC_CHECK_LIB([cairo], [cairo_create],, AC_MSG_ERROR("cairo is required for drawing instructions")) +AC_CHECK_LIB([freerdp-cache], [glyph_cache_register_callbacks],, AC_MSG_ERROR("libfreerdp-cache is required (part of FreeRDP)")) AC_CHECK_LIB([freerdp-core], [freerdp_new],, AC_MSG_ERROR("libfreerdp-core is required (part of FreeRDP)")) AC_CHECK_LIB([freerdp-channels], [freerdp_channels_new],, AC_MSG_ERROR("libfreerdp-channels is required (part of FreeRDP)")) AC_CHECK_LIB([freerdp-utils], [xzalloc],, AC_MSG_ERROR("libfreerdp-utils is required (part of FreeRDP)")) diff --git a/protocols/rdp/include/rdp_bitmap.h b/protocols/rdp/include/rdp_bitmap.h index 0968cb3f..72fa11f7 100644 --- a/protocols/rdp/include/rdp_bitmap.h +++ b/protocols/rdp/include/rdp_bitmap.h @@ -57,6 +57,7 @@ typedef struct guac_rdp_bitmap { } guac_rdp_bitmap; void guac_rdp_bitmap_new(rdpContext* context, rdpBitmap* bitmap); +void guac_rdp_bitmap_decompress(rdpContext* context, rdpBitmap* bitmap, uint8* data, int width, int height, int bpp, int length, boolean compressed); void guac_rdp_bitmap_paint(rdpContext* context, rdpBitmap* bitmap); void guac_rdp_bitmap_free(rdpContext* context, rdpBitmap* bitmap); void guac_rdp_bitmap_setsurface(rdpContext* context, rdpBitmap* bitmap, boolean primary); diff --git a/protocols/rdp/src/client.c b/protocols/rdp/src/client.c index b8723ee4..b3574032 100644 --- a/protocols/rdp/src/client.c +++ b/protocols/rdp/src/client.c @@ -44,6 +44,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include @@ -84,13 +89,16 @@ boolean rdp_freerdp_pre_connect(freerdp* instance) { rdpPointer* pointer; rdpPrimaryUpdate* primary; + /* Init FreeRDP cache */ + instance->context->cache = cache_new(instance->settings); + /* Set up bitmap handling */ bitmap = xnew(rdpBitmap); bitmap->size = sizeof(guac_rdp_bitmap); bitmap->New = guac_rdp_bitmap_new; bitmap->Free = guac_rdp_bitmap_free; bitmap->Paint = guac_rdp_bitmap_paint; - /* bitmap->Decompress = guac_rdp_bitmap_decompress; */ + bitmap->Decompress = guac_rdp_bitmap_decompress; bitmap->SetSurface = guac_rdp_bitmap_setsurface; graphics_register_bitmap(context->graphics, bitmap); @@ -119,6 +127,13 @@ boolean rdp_freerdp_pre_connect(freerdp* instance) { primary->MemBlt = guac_rdp_gdi_memblt; primary->OpaqueRect = guac_rdp_gdi_opaquerect; + /*pointer_cache_register_callbacks(instance->update);*/ + glyph_cache_register_callbacks(instance->update); + /*brush_cache_register_callbacks(instance->update);*/ + bitmap_cache_register_callbacks(instance->update); + /*offscreen_cache_register_callbacks(instance->update);*/ + /*palette_cache_register_callbacks(instance->update);*/ + /* Init channels (pre-connect) */ if (freerdp_channels_pre_connect(channels, instance)) { guac_protocol_send_error(client->socket, "Error initializing RDP client channel manager"); diff --git a/protocols/rdp/src/rdp_bitmap.c b/protocols/rdp/src/rdp_bitmap.c index fbf51b40..af915ce1 100644 --- a/protocols/rdp/src/rdp_bitmap.c +++ b/protocols/rdp/src/rdp_bitmap.c @@ -119,3 +119,8 @@ void guac_rdp_bitmap_setsurface(rdpContext* context, rdpBitmap* bitmap, boolean guac_client_log_info(client, "guac_rdp_bitmap_setsurface()"); } +void guac_rdp_bitmap_decompress(rdpContext* context, rdpBitmap* bitmap, uint8* data, int width, int height, int bpp, int length, boolean compressed) { + guac_client* client = ((rdp_freerdp_context*) context)->client; + guac_client_log_info(client, "guac_rdp_bitmap_decompress()"); +} +