Modified size to be layer-specific, adding layer move instruction.

This commit is contained in:
Michael Jumper 2012-02-11 19:00:55 -08:00
parent c339b1299b
commit a17cd6202b
3 changed files with 46 additions and 5 deletions

View File

@ -35,7 +35,7 @@
# ***** END LICENSE BLOCK ***** # ***** END LICENSE BLOCK *****
AC_INIT(src/client.c) AC_INIT(src/client.c)
AM_INIT_AUTOMAKE(libguac, 0.5.0) AM_INIT_AUTOMAKE(libguac, 0.6.0)
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
# Checks for programs. # Checks for programs.

View File

@ -214,11 +214,31 @@ int guac_protocol_send_clipboard(guac_socket* socket, const char* data);
* returned, and guac_error is set appropriately. * returned, and guac_error is set appropriately.
* *
* @param socket The guac_socket connection to use. * @param socket The guac_socket connection to use.
* @param w The width of the display. * @param layer The layer to resize.
* @param h The height of the display. * @param w The new width of the layer.
* @param h The new height of the layer.
* @return Zero on success, non-zero on error. * @return Zero on success, non-zero on error.
*/ */
int guac_protocol_send_size(guac_socket* socket, int w, int h); int guac_protocol_send_size(guac_socket* socket, const guac_layer* layer,
int w, int h);
/**
* Sends a move instruction over the given guac_socket connection.
*
* If an error occurs sending the instruction, a non-zero value is
* returned, and guac_error is set appropriately.
*
* @param socket The guac_socket connection to use.
* @param layer The layer to move.
* @param parent The parent layer the specified layer will be positioned
* relative to.
* @param x The X coordinate of the layer.
* @param y The Y coordinate of the layer.
* @param z The Z index of the layer, relative to other layers in its parent.
* @return Zero on success, non-zero on error.
*/
int guac_protocol_send_move(guac_socket* socket, const guac_layer* layer,
const guac_layer* parent, int x, int y, int z);
/** /**
* Sends a copy instruction over the given guac_socket connection. * Sends a copy instruction over the given guac_socket connection.

View File

@ -110,10 +110,13 @@ int guac_protocol_send_name(guac_socket* socket, const char* name) {
} }
int guac_protocol_send_size(guac_socket* socket, int w, int h) { int guac_protocol_send_size(guac_socket* socket, const guac_layer* layer,
int w, int h) {
return return
guac_socket_write_string(socket, "4.size,") guac_socket_write_string(socket, "4.size,")
|| __guac_socket_write_length_int(socket, layer->index)
|| guac_socket_write_string(socket, ",")
|| __guac_socket_write_length_int(socket, w) || __guac_socket_write_length_int(socket, w)
|| guac_socket_write_string(socket, ",") || guac_socket_write_string(socket, ",")
|| __guac_socket_write_length_int(socket, h) || __guac_socket_write_length_int(socket, h)
@ -121,6 +124,24 @@ int guac_protocol_send_size(guac_socket* socket, int w, int h) {
} }
int guac_protocol_send_move(guac_socket* socket, const guac_layer* layer,
const guac_layer* parent, int x, int y, int z) {
return
guac_socket_write_string(socket, "4.move,")
|| __guac_socket_write_length_int(socket, layer->index)
|| guac_socket_write_string(socket, ",")
|| __guac_socket_write_length_int(socket, parent->index)
|| guac_socket_write_string(socket, ",")
|| __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_int(socket, z)
|| guac_socket_write_string(socket, ";");
}
int guac_protocol_send_clipboard(guac_socket* socket, const char* data) { int guac_protocol_send_clipboard(guac_socket* socket, const char* data) {
return return