GUAC-656: Add instructions to stubs. Match prototype of surface function to that of protocol function.

This commit is contained in:
Michael Jumper 2014-04-29 19:15:21 -07:00
parent 5d6e04171c
commit f6ccfd1211
2 changed files with 40 additions and 10 deletions

View File

@ -55,29 +55,60 @@ void guac_common_surface_free(guac_common_surface* surface) {
free(surface);
}
void guac_common_surface_draw(guac_common_surface* surface, cairo_surface_t* src, int x, int y) {
void guac_common_surface_draw(guac_common_surface* surface, int x, int y, cairo_surface_t* src) {
guac_socket* socket = surface->socket;
const guac_layer* layer = surface->layer;
/* STUB */
guac_protocol_send_png(socket, GUAC_COMP_OVER, layer, x, y, src);
}
void guac_common_surface_copy(guac_common_surface* src, int sx, int sy, int w, int h,
guac_common_surface* dst, int dx, int dy) {
guac_socket* socket = dst->socket;
const guac_layer* src_layer = src->layer;
const guac_layer* dst_layer = dst->layer;
/* STUB */
guac_protocol_send_copy(socket, src_layer, sx, sy, w, h, GUAC_COMP_OVER, dst_layer, dx, dy);
}
void guac_common_surface_transfer(guac_transfer_function op,
guac_common_surface* src, int sx, int sy, int w, int h,
guac_common_surface* dst, int dx, int dy) {
void guac_common_surface_transfer(guac_common_surface* src, int sx, int sy, int w, int h,
guac_transfer_function op, guac_common_surface* dst, int dx, int dy) {
guac_socket* socket = dst->socket;
const guac_layer* src_layer = src->layer;
const guac_layer* dst_layer = dst->layer;
/* STUB */
guac_protocol_send_transfer(socket, src_layer, sx, sy, w, h, op, dst_layer, dx, dy);
}
void guac_common_surface_resize(guac_common_surface* surface, int w, int h) {
guac_socket* socket = surface->socket;
const guac_layer* layer = surface->layer;
/* STUB */
guac_protocol_send_size(socket, layer, w, h);
}
void guac_common_surface_rect(guac_common_surface* surface,
int x, int y, int w, int h,
int red, int green, int blue) {
guac_socket* socket = surface->socket;
const guac_layer* layer = surface->layer;
/* STUB */
guac_protocol_send_rect(socket, layer, x, y, w, h);
guac_protocol_send_cfill(socket, GUAC_COMP_OVER, layer, red, green, blue, 0xFF);
}
void guac_common_surface_flush(guac_common_surface* surface) {

View File

@ -126,11 +126,11 @@ void guac_common_surface_free(guac_common_surface* surface);
* Draws the given data to the given guac_common_surface.
*
* @param surface The surface to draw to.
* @param src The Cairo surface to retrieve data from.
* @param x The X coordinate of the draw location.
* @param y The Y coordinate of the draw location.
* @param src The Cairo surface to retrieve data from.
*/
void guac_common_surface_draw(guac_common_surface* surface, cairo_surface_t* src, int x, int y);
void guac_common_surface_draw(guac_common_surface* surface, int x, int y, cairo_surface_t* src);
/**
* Copies a rectangle of data between two surfaces.
@ -150,19 +150,18 @@ void guac_common_surface_copy(guac_common_surface* src, int sx, int sy, int w, i
/**
* Transfers a rectangle of data between two surfaces.
*
* @param op The transfer function.
* @param src The source surface.
* @param sx The X coordinate of the upper-left corner of the source rect.
* @param sy The Y coordinate of the upper-left corner of the source rect.
* @param w The width of the source rect.
* @param h The height of the source rect.
* @param op The transfer function.
* @param dst The destination surface.
* @param dx The X coordinate of the upper-left corner of the destination rect.
* @param dy The Y coordinate of the upper-left corner of the destination rect.
*/
void guac_common_surface_transfer(guac_transfer_function op,
guac_common_surface* src, int sx, int sy, int w, int h,
guac_common_surface* dst, int dx, int dy);
void guac_common_surface_transfer(guac_common_surface* src, int sx, int sy, int w, int h,
guac_transfer_function op, guac_common_surface* dst, int dx, int dy);
/**
* Resizes the given surface to the given size.