From 55ac0eee0b2b6cb16d37be8990270ed5c9ac4776 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 11 Mar 2012 12:57:15 -0700 Subject: [PATCH] Implemented around 1/3 of all new instructions. --- libguac/src/protocol.c | 100 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/libguac/src/protocol.c b/libguac/src/protocol.c index 8e1b9000..e499f322 100644 --- a/libguac/src/protocol.c +++ b/libguac/src/protocol.c @@ -474,6 +474,49 @@ int guac_protocol_send_args(guac_socket* socket, const char** args) { } +int guac_protocol_send_cfill(guac_socket* socket, + guac_composite_mode mode, const guac_layer* layer, + int r, int g, int b, int a) { + + return + guac_socket_write_string(socket, "5.cfill,") + || __guac_socket_write_length_int(socket, mode) + || guac_socket_write_string(socket, ",") + || __guac_socket_write_length_int(socket, layer->index) + || guac_socket_write_string(socket, ",") + || __guac_socket_write_length_int(socket, r) + || guac_socket_write_string(socket, ",") + || __guac_socket_write_length_int(socket, g) + || guac_socket_write_string(socket, ",") + || __guac_socket_write_length_int(socket, b) + || guac_socket_write_string(socket, ",") + || __guac_socket_write_length_int(socket, a) + || guac_socket_write_string(socket, ";"); + +} + + +int guac_protocol_send_connect(guac_socket* socket, const char** args) { + + int i; + + if (guac_socket_write_string(socket, "7.connect")) return -1; + + for (i=0; args[i] != NULL; i++) { + + if (guac_socket_write_string(socket, ",")) + return -1; + + if (__guac_socket_write_length_string(socket, args[i])) + return -1; + + } + + return guac_socket_write_string(socket, ";"); + +} + + int guac_protocol_send_clip(guac_socket* socket, const guac_layer* layer) { return @@ -522,6 +565,35 @@ int guac_protocol_send_copy(guac_socket* socket, } +int guac_protocol_send_cstroke(guac_socket* socket, + guac_composite_mode mode, const guac_layer* layer, + guac_line_cap_style cap, guac_line_join_style join, int thickness, + int r, int g, int b, int a) { + + return + guac_socket_write_string(socket, "7.cstroke,") + || __guac_socket_write_length_int(socket, mode) + || guac_socket_write_string(socket, ",") + || __guac_socket_write_length_int(socket, layer->index) + || guac_socket_write_string(socket, ",") + || __guac_socket_write_length_int(socket, cap) + || guac_socket_write_string(socket, ",") + || __guac_socket_write_length_int(socket, join) + || guac_socket_write_string(socket, ",") + || __guac_socket_write_length_int(socket, thickness) + || guac_socket_write_string(socket, ",") + || __guac_socket_write_length_int(socket, r) + || guac_socket_write_string(socket, ",") + || __guac_socket_write_length_int(socket, g) + || guac_socket_write_string(socket, ",") + || __guac_socket_write_length_int(socket, b) + || guac_socket_write_string(socket, ",") + || __guac_socket_write_length_int(socket, a) + || guac_socket_write_string(socket, ";"); + +} + + 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 @@ -544,6 +616,11 @@ int guac_protocol_send_cursor(guac_socket* socket, int x, int y, } +int guac_protocol_send_disconnect(guac_socket* socket) { + return guac_socket_write_string(socket, "10.disconnect;"); +} + + int guac_protocol_send_dispose(guac_socket* socket, const guac_layer* layer) { return @@ -631,6 +708,29 @@ int guac_protocol_send_rect(guac_socket* socket, } +int guac_protocol_send_set(guac_socket* socket, const char* name, + const char* value) { + + return + guac_socket_write_string(socket, "3.set,") + || __guac_socket_write_length_string(socket, name) + || guac_socket_write_string(socket, ",") + || __guac_socket_write_length_string(socket, value) + || guac_socket_write_string(socket, ";"); + +} + + +int guac_protocol_send_select(guac_socket* socket, const char* protocol) { + + return + guac_socket_write_string(socket, "6.select,") + || __guac_socket_write_length_string(socket, protocol) + || guac_socket_write_string(socket, ";"); + +} + + int guac_protocol_send_size(guac_socket* socket, const guac_layer* layer, int w, int h) {