Refactored rstroke/rfill to lstroke/lfill.

This commit is contained in:
Michael Jumper 2012-03-11 21:05:34 -07:00
parent eee3fc4fd7
commit fbe43e917e
2 changed files with 74 additions and 99 deletions

View File

@ -475,6 +475,42 @@ int guac_protocol_send_cstroke(guac_socket* socket,
int guac_protocol_send_cursor(guac_socket* socket, int x, int y, int guac_protocol_send_cursor(guac_socket* socket, int x, int y,
const guac_layer* srcl, int srcx, int srcy, int w, int h); const guac_layer* srcl, int srcx, int srcy, int w, int h);
/**
* Sends an lfill 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 mode The composite mode to use.
* @param layer The destination layer.
* @param srcl The source layer.
* @return Zero on success, non-zero on error.
*/
int guac_protocol_send_lfill(guac_socket* socket,
guac_composite_mode mode, const guac_layer* layer,
const guac_layer* srcl);
/**
* Sends an lstroke 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 mode The composite mode to use.
* @param layer The destination layer.
* @param cap The style of line cap to use when drawing the stroke.
* @param join The style of line join to use when drawing the stroke.
* @param thickness The thickness of the stroke in pixels.
* @param srcl The source layer.
* @return Zero on success, non-zero on error.
*/
int guac_protocol_send_lstroke(guac_socket* socket,
guac_composite_mode mode, const guac_layer* layer,
guac_line_cap_style cap, guac_line_join_style join, int thickness,
const guac_layer* srcl);
/** /**
* Sends a path instruction over the given guac_socket connection. * Sends a path instruction over the given guac_socket connection.
* *
@ -565,50 +601,6 @@ int guac_protocol_send_rect(guac_socket* socket, const guac_layer* layer,
*/ */
int guac_protocol_send_reset(guac_socket* socket, const guac_layer* layer); int guac_protocol_send_reset(guac_socket* socket, const guac_layer* layer);
/**
* Sends an rfill 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 mode The composite mode to use.
* @param layer The destination layer.
* @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_rfill(guac_socket* socket,
guac_composite_mode mode, const guac_layer* layer,
const guac_layer* srcl, int srcx, int srcy, int w, int h);
/**
* Sends an rstroke 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 mode The composite mode to use.
* @param layer The destination layer.
* @param cap The style of line cap to use when drawing the stroke.
* @param join The style of line join to use when drawing the stroke.
* @param thickness The thickness of the stroke in pixels.
* @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_rstroke(guac_socket* socket,
guac_composite_mode mode, const guac_layer* layer,
guac_line_cap_style cap, guac_line_join_style join, int thickness,
const guac_layer* srcl, int srcx, int srcy, int w, int h);
/** /**
* Sends a transfer instruction over the given guac_socket connection. * Sends a transfer instruction over the given guac_socket connection.
* *

View File

@ -673,6 +673,44 @@ int guac_protocol_send_error(guac_socket* socket, const char* error) {
} }
int guac_protocol_send_lfill(guac_socket* socket,
guac_composite_mode mode, const guac_layer* layer,
const guac_layer* srcl) {
return
guac_socket_write_string(socket, "5.lfill,")
|| __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, srcl->index)
|| guac_socket_write_string(socket, ";");
}
int guac_protocol_send_lstroke(guac_socket* socket,
guac_composite_mode mode, const guac_layer* layer,
guac_line_cap_style cap, guac_line_join_style join, int thickness,
const guac_layer* srcl) {
return
guac_socket_write_string(socket, "7.lstroke,")
|| __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, srcl->index)
|| guac_socket_write_string(socket, ";");
}
int guac_protocol_send_move(guac_socket* socket, const guac_layer* layer, int guac_protocol_send_move(guac_socket* socket, const guac_layer* layer,
const guac_layer* parent, int x, int y, int z) { const guac_layer* parent, int x, int y, int z) {
@ -794,61 +832,6 @@ int guac_protocol_send_reset(guac_socket* socket, const guac_layer* layer) {
} }
int guac_protocol_send_rfill(guac_socket* socket,
guac_composite_mode mode, const guac_layer* layer,
const guac_layer* srcl, int srcx, int srcy, int w, int h) {
return
guac_socket_write_string(socket, "5.rfill,")
|| __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, 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, ";");
}
int guac_protocol_send_rstroke(guac_socket* socket,
guac_composite_mode mode, const guac_layer* layer,
guac_line_cap_style cap, guac_line_join_style join, int thickness,
const guac_layer* srcl, int srcx, int srcy, int w, int h) {
return
guac_socket_write_string(socket, "7.rstroke,")
|| __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, 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, ";");
}
int guac_protocol_send_set(guac_socket* socket, const char* name, int guac_protocol_send_set(guac_socket* socket, const char* name,
const char* value) { const char* value) {