From 124460b5d9e88579dd52a6a0a0aab577da05d948 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 15 Feb 2012 10:04:31 -0800 Subject: [PATCH] New cursor instruction format (allowing buffering of cursors). --- libguac/include/protocol.h | 9 +++++++-- libguac/src/protocol.c | 14 +++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/libguac/include/protocol.h b/libguac/include/protocol.h index da5b7c7d..d7d282ed 100644 --- a/libguac/include/protocol.h +++ b/libguac/include/protocol.h @@ -333,10 +333,15 @@ int guac_protocol_send_png(guac_socket* socket, guac_composite_mode mode, * @param socket The guac_socket connection to use. * @param x The X coordinate of the cursor hotspot. * @param y The Y coordinate of the cursor hotspot. - * @param surface A cairo surface containing the image data to send. + * @param srcl The source layer. + * @param srcx The X coordinate of the source rectangle. + * @param srcy The Y coordinate of the source rectangle. + * @param w The width of the source rectangle. + * @param h The height of the source rectangle. * @return Zero on success, non-zero on error. */ -int guac_protocol_send_cursor(guac_socket* socket, int x, int y, cairo_surface_t* surface); +int guac_protocol_send_cursor(guac_socket* socket, int x, int y, + const guac_layer* srcl, int srcx, int srcy, int w, int h); /** * Returns whether new instruction data is available on the given guac_socket diff --git a/libguac/src/protocol.c b/libguac/src/protocol.c index 4f5c0678..6039494c 100644 --- a/libguac/src/protocol.c +++ b/libguac/src/protocol.c @@ -336,15 +336,23 @@ int guac_protocol_send_png(guac_socket* socket, guac_composite_mode mode, } -int guac_protocol_send_cursor(guac_socket* socket, int x, int y, cairo_surface_t* surface) { - +int guac_protocol_send_cursor(guac_socket* socket, int x, int y, + const guac_layer* srcl, int srcx, int srcy, int w, int h) { return guac_socket_write_string(socket, "6.cursor,") || __guac_socket_write_length_int(socket, x) || guac_socket_write_string(socket, ",") || __guac_socket_write_length_int(socket, y) || guac_socket_write_string(socket, ",") - || __guac_socket_write_length_png(socket, surface) + || __guac_socket_write_length_int(socket, srcl->index) + || guac_socket_write_string(socket, ",") + || __guac_socket_write_length_int(socket, srcx) + || guac_socket_write_string(socket, ",") + || __guac_socket_write_length_int(socket, srcy) + || guac_socket_write_string(socket, ",") + || __guac_socket_write_length_int(socket, w) + || guac_socket_write_string(socket, ",") + || __guac_socket_write_length_int(socket, h) || guac_socket_write_string(socket, ";"); }