Implement default pointer (currently drawn with draw instructions - not an embedded...
authorMichael Jumper <zhangmaike@users.sourceforge.net>
Thu, 17 May 2012 02:52:43 +0000 (19:52 -0700)
committerMichael Jumper <zhangmaike@users.sourceforge.net>
Thu, 17 May 2012 02:52:43 +0000 (19:52 -0700)
include/rdp_pointer.h
src/client.c
src/rdp_pointer.c

index ff87091..516f36a 100644 (file)
@@ -59,5 +59,6 @@ typedef struct guac_rdp_pointer {
 void guac_rdp_pointer_new(rdpContext* context, rdpPointer* pointer);
 void guac_rdp_pointer_set(rdpContext* context, rdpPointer* pointer);
 void guac_rdp_pointer_free(rdpContext* context, rdpPointer* pointer);
+void guac_rdp_pointer_set_default(guac_client* client);
 
 #endif
index 3a7c5f6..690427c 100644 (file)
@@ -429,6 +429,9 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
     guac_client_data->trans_glyph_surface = cairo_image_surface_create(
             CAIRO_FORMAT_ARGB32, settings->width, settings->height);
 
+    /* Set default pointer */
+    guac_rdp_pointer_set_default(client);
+
     /* Success */
     return 0;
 
index 00ea93f..b8b1f11 100644 (file)
@@ -100,3 +100,38 @@ void guac_rdp_pointer_free(rdpContext* context, rdpPointer* pointer) {
 
 }
 
+void guac_rdp_pointer_set_default(guac_client* client) {
+
+    guac_socket* socket = client->socket;
+
+    /* Draw to buffer */
+    guac_layer* cursor = guac_client_alloc_buffer(client);
+    guac_protocol_send_size(socket, cursor, 110, 160);
+
+    /* Draw cursor */
+    guac_protocol_send_start(socket, cursor,  0,  0);
+    guac_protocol_send_line(socket, cursor,  10, 10);
+    guac_protocol_send_line(socket, cursor,   6, 10);
+    guac_protocol_send_line(socket, cursor,   8, 15);
+    guac_protocol_send_line(socket, cursor,   5, 15);
+    guac_protocol_send_line(socket, cursor,   3, 11);
+    guac_protocol_send_line(socket, cursor,   0, 14);
+    guac_protocol_send_close(socket, cursor);
+
+    /* Fill */
+    guac_protocol_send_cfill(socket, GUAC_COMP_OVER, cursor,
+            0x00, 0x00, 0x00, 0xFF);
+
+    /* Stroke */
+    guac_protocol_send_cstroke(socket, GUAC_COMP_OVER, cursor,
+            GUAC_LINE_CAP_SQUARE, GUAC_LINE_JOIN_BEVEL, 1,
+            0xFF, 0xFF, 0xFF, 0xFF);
+
+    /* Set cursor */
+    guac_protocol_send_cursor(socket, 0, 0, cursor, 0, 0, 11, 16);
+
+    /* Free buffer */
+    guac_client_free_buffer(client, cursor);
+
+}
+