Implement SetBounds.
authorMichael Jumper <zhangmaike@users.sourceforge.net>
Wed, 8 Feb 2012 22:16:05 +0000 (14:16 -0800)
committerMichael Jumper <zhangmaike@users.sourceforge.net>
Wed, 8 Feb 2012 22:16:05 +0000 (14:16 -0800)
include/rdp_gdi.h
src/client.c
src/rdp_gdi.c

index b4df003..894b2b4 100644 (file)
@@ -46,5 +46,6 @@ void guac_rdp_gdi_scrblt(rdpContext* context, SCRBLT_ORDER* scrblt);
 void guac_rdp_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt);
 void guac_rdp_gdi_opaquerect(rdpContext* context, OPAQUE_RECT_ORDER* opaque_rect);
 void guac_rdp_gdi_palette_update(rdpContext* context, PALETTE_UPDATE* palette);
+void guac_rdp_gdi_set_bounds(rdpContext* context, rdpBounds* bounds);
 
 #endif
index d8ca3a3..798c488 100644 (file)
@@ -124,6 +124,7 @@ boolean rdp_freerdp_pre_connect(freerdp* instance) {
 
     /* Set up GDI */
     instance->update->Palette = guac_rdp_gdi_palette_update;
+    instance->update->SetBounds = guac_rdp_gdi_set_bounds;
 
     primary = instance->update->primary;
     primary->DstBlt = guac_rdp_gdi_dstblt;
index ff79211..ac6507b 100644 (file)
@@ -88,3 +88,30 @@ void guac_rdp_gdi_palette_update(rdpContext* context, PALETTE_UPDATE* palette) {
     clrconv->palette->entries = palette->entries;
 
 }
+
+void guac_rdp_gdi_set_bounds(rdpContext* context, rdpBounds* bounds) {
+
+    guac_client* client = ((rdp_freerdp_context*) context)->client;
+    const guac_layer* current_layer = ((rdp_guac_client_data*) client->data)->current_surface;
+
+    /* Set clip if specified */
+    if (bounds != NULL)
+        guac_protocol_send_clip(
+                client->socket,
+                current_layer,
+                bounds->left,
+                bounds->top,
+                bounds->right - bounds->left + 1,
+                bounds->bottom - bounds->top + 1);
+
+    /* Otherwise, reset clip */
+    else
+        guac_protocol_send_clip(
+                client->socket,
+                current_layer,
+                0, 0,
+                context->instance->settings->width,
+                context->instance->settings->height);
+
+}
+