From: Michael Jumper Date: Thu, 17 May 2012 02:52:43 +0000 (-0700) Subject: Implement default pointer (currently drawn with draw instructions - not an embedded... X-Git-Url: http://git.alex.org.uk Implement default pointer (currently drawn with draw instructions - not an embedded bitmap). --- diff --git a/include/rdp_pointer.h b/include/rdp_pointer.h index ff87091..516f36a 100644 --- a/include/rdp_pointer.h +++ b/include/rdp_pointer.h @@ -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 diff --git a/src/client.c b/src/client.c index 3a7c5f6..690427c 100644 --- a/src/client.c +++ b/src/client.c @@ -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; diff --git a/src/rdp_pointer.c b/src/rdp_pointer.c index 00ea93f..b8b1f11 100644 --- a/src/rdp_pointer.c +++ b/src/rdp_pointer.c @@ -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); + +} +