Implement default pointer (currently drawn with draw instructions - not an embedded bitmap).

This commit is contained in:
Michael Jumper 2012-05-16 19:52:43 -07:00
parent 2056ab9619
commit d7c5ec5ed0
3 changed files with 39 additions and 0 deletions

View File

@ -59,5 +59,6 @@ typedef struct guac_rdp_pointer {
void guac_rdp_pointer_new(rdpContext* context, rdpPointer* pointer); void guac_rdp_pointer_new(rdpContext* context, rdpPointer* pointer);
void guac_rdp_pointer_set(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_free(rdpContext* context, rdpPointer* pointer);
void guac_rdp_pointer_set_default(guac_client* client);
#endif #endif

View 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( guac_client_data->trans_glyph_surface = cairo_image_surface_create(
CAIRO_FORMAT_ARGB32, settings->width, settings->height); CAIRO_FORMAT_ARGB32, settings->width, settings->height);
/* Set default pointer */
guac_rdp_pointer_set_default(client);
/* Success */ /* Success */
return 0; return 0;

View 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);
}