libguac  0.9.8
protocol.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 Glyptodon LLC
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20  * THE SOFTWARE.
21  */
22 
23 #ifndef _GUAC_PROTOCOL_H
24 #define _GUAC_PROTOCOL_H
25 
34 #include "layer-types.h"
35 #include "object-types.h"
36 #include "protocol-types.h"
37 #include "socket-types.h"
38 #include "stream-types.h"
39 #include "timestamp-types.h"
40 
41 #include <cairo/cairo.h>
42 #include <stdarg.h>
43 
44 /* CONTROL INSTRUCTIONS */
45 
61  const char* error, guac_protocol_status status);
62 
73 int guac_protocol_send_args(guac_socket* socket, const char** args);
74 
85 int guac_protocol_send_connect(guac_socket* socket, const char** args);
86 
97 
109 int guac_protocol_send_error(guac_socket* socket, const char* error,
110  guac_protocol_status status);
111 
124 int guac_protocol_send_log(guac_socket* socket, const char* format, ...);
125 
138 int vguac_protocol_send_log(guac_socket* socket, const char* format,
139  va_list args);
140 
154 int guac_protocol_send_nest(guac_socket* socket, int index,
155  const char* data);
156 
168 
179 int guac_protocol_send_ready(guac_socket* socket, const char* id);
180 
193 int guac_protocol_send_set(guac_socket* socket, const guac_layer* layer,
194  const char* name, const char* value);
195 
206 int guac_protocol_send_select(guac_socket* socket, const char* protocol);
207 
219 int guac_protocol_send_sync(guac_socket* socket, guac_timestamp timestamp);
220 
221 /* OBJECT INSTRUCTIONS */
222 
248 int guac_protocol_send_body(guac_socket* socket, const guac_object* object,
249  const guac_stream* stream, const char* mimetype, const char* name);
250 
270  const guac_object* object, const char* name);
271 
288  const guac_object* object);
289 
290 /* MEDIA INSTRUCTIONS */
291 
305 int guac_protocol_send_audio(guac_socket* socket, const guac_stream* stream,
306  int channel, const char* mimetype, double duration);
307 
320 int guac_protocol_send_file(guac_socket* socket, const guac_stream* stream,
321  const char* mimetype, const char* name);
322 
335 int guac_protocol_send_pipe(guac_socket* socket, const guac_stream* stream,
336  const char* mimetype, const char* name);
337 
352 int guac_protocol_send_blob(guac_socket* socket, const guac_stream* stream,
353  void* data, int count);
354 
365 int guac_protocol_send_end(guac_socket* socket, const guac_stream* stream);
366 
380 int guac_protocol_send_video(guac_socket* socket, const guac_stream* stream,
381  const guac_layer* layer, const char* mimetype, double duration);
382 
383 /* DRAWING INSTRUCTIONS */
384 
402 int guac_protocol_send_arc(guac_socket* socket, const guac_layer* layer,
403  int x, int y, int radius, double startAngle, double endAngle,
404  int negative);
405 
422  guac_composite_mode mode, const guac_layer* layer,
423  int r, int g, int b, int a);
424 
435 int guac_protocol_send_clip(guac_socket* socket, const guac_layer* layer);
436 
447 int guac_protocol_send_close(guac_socket* socket, const guac_layer* layer);
448 
470  const guac_layer* srcl, int srcx, int srcy, int w, int h,
471  guac_composite_mode mode, const guac_layer* dstl, int dstx, int dsty);
472 
492  guac_composite_mode mode, const guac_layer* layer,
493  guac_line_cap_style cap, guac_line_join_style join, int thickness,
494  int r, int g, int b, int a);
495 
512 int guac_protocol_send_cursor(guac_socket* socket, int x, int y,
513  const guac_layer* srcl, int srcx, int srcy, int w, int h);
514 
531 int guac_protocol_send_curve(guac_socket* socket, const guac_layer* layer,
532  int cp1x, int cp1y, int cp2x, int cp2y, int x, int y);
533 
544 int guac_protocol_send_identity(guac_socket* socket, const guac_layer* layer);
545 
559  guac_composite_mode mode, const guac_layer* layer,
560  const guac_layer* srcl);
561 
574 int guac_protocol_send_line(guac_socket* socket, const guac_layer* layer,
575  int x, int y);
576 
593  guac_composite_mode mode, const guac_layer* layer,
594  guac_line_cap_style cap, guac_line_join_style join, int thickness,
595  const guac_layer* srcl);
596 
627 int guac_protocol_send_img(guac_socket* socket, const guac_stream* stream,
628  guac_composite_mode mode, const guac_layer* layer,
629  const char* mimetype, int x, int y);
630 
641 int guac_protocol_send_pop(guac_socket* socket, const guac_layer* layer);
642 
653 int guac_protocol_send_push(guac_socket* socket, const guac_layer* layer);
654 
669 int guac_protocol_send_rect(guac_socket* socket, const guac_layer* layer,
670  int x, int y, int width, int height);
671 
682 int guac_protocol_send_reset(guac_socket* socket, const guac_layer* layer);
683 
696 int guac_protocol_send_start(guac_socket* socket, const guac_layer* layer,
697  int x, int y);
698 
720  const guac_layer* srcl, int srcx, int srcy, int w, int h,
721  guac_transfer_function fn, const guac_layer* dstl, int dstx, int dsty);
722 
740  const guac_layer* layer,
741  double a, double b, double c,
742  double d, double e, double f);
743 
744 /* LAYER INSTRUCTIONS */
745 
756 int guac_protocol_send_dispose(guac_socket* socket, const guac_layer* layer);
757 
775  const guac_layer* layer,
776  double a, double b, double c,
777  double d, double e, double f);
778 
794 int guac_protocol_send_move(guac_socket* socket, const guac_layer* layer,
795  const guac_layer* parent, int x, int y, int z);
796 
808 int guac_protocol_send_shade(guac_socket* socket, const guac_layer* layer,
809  int a);
810 
823 int guac_protocol_send_size(guac_socket* socket, const guac_layer* layer,
824  int w, int h);
825 
826 /* TEXT INSTRUCTIONS */
827 
839 int guac_protocol_send_clipboard(guac_socket* socket, const guac_stream* stream,
840  const char* mimetype);
841 
849 int guac_protocol_send_name(guac_socket* socket, const char* name);
850 
858 int guac_protocol_decode_base64(char* base64);
859 
860 #endif
861 
int guac_protocol_send_set(guac_socket *socket, const guac_layer *layer, const char *name, const char *value)
Sends a set instruction over the given guac_socket connection.
int guac_protocol_send_args(guac_socket *socket, const char **args)
Sends an args instruction over the given guac_socket connection.
int guac_protocol_send_end(guac_socket *socket, const guac_stream *stream)
Sends an end instruction over the given guac_socket connection.
int guac_protocol_send_distort(guac_socket *socket, const guac_layer *layer, double a, double b, double c, double d, double e, double f)
Sends a distort instruction over the given guac_socket connection.
int guac_protocol_send_select(guac_socket *socket, const char *protocol)
Sends a select instruction over the given guac_socket connection.
int guac_protocol_send_filesystem(guac_socket *socket, const guac_object *object, const char *name)
Sends a filesystem instruction over the given guac_socket connection.
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 an lstroke instruction over the given guac_socket connection.
int guac_protocol_send_clipboard(guac_socket *socket, const guac_stream *stream, const char *mimetype)
Sends a clipboard instruction over the given guac_socket connection.
int guac_protocol_send_ready(guac_socket *socket, const char *id)
Sends a ready instruction over the given guac_socket connection.
Type definitions related to the guac_socket object.
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)
Sends a cstroke instruction over the given guac_socket connection.
int guac_protocol_send_reset(guac_socket *socket, const guac_layer *layer)
Sends a reset instruction over the given guac_socket connection.
int guac_protocol_decode_base64(char *base64)
Decodes the given base64-encoded string in-place.
Type definitions related to Guacamole protocol streams.
The core I/O object of Guacamole.
Definition: socket.h:41
int guac_protocol_send_img(guac_socket *socket, const guac_stream *stream, guac_composite_mode mode, const guac_layer *layer, const char *mimetype, int x, int y)
Sends an img instruction over the given guac_socket connection.
Type definitions related to Guacamole protocol objects.
int guac_protocol_send_nop(guac_socket *socket)
Sends a nop instruction (null-operation) over the given guac_socket connection.
int guac_protocol_send_name(guac_socket *socket, const char *name)
Sends a name instruction over the given guac_socket connection.
int guac_protocol_send_transfer(guac_socket *socket, const guac_layer *srcl, int srcx, int srcy, int w, int h, guac_transfer_function fn, const guac_layer *dstl, int dstx, int dsty)
Sends a transfer instruction over the given guac_socket connection.
int guac_protocol_send_blob(guac_socket *socket, const guac_stream *stream, void *data, int count)
Writes a block of data to the currently in-progress blob which was already created.
guac_line_join_style
Supported line join styles.
Definition: protocol-types.h:241
int guac_protocol_send_disconnect(guac_socket *socket)
Sends a disconnect instruction over the given guac_socket connection.
int guac_protocol_send_arc(guac_socket *socket, const guac_layer *layer, int x, int y, int radius, double startAngle, double endAngle, int negative)
Sends an arc instruction over the given guac_socket connection.
int vguac_protocol_send_log(guac_socket *socket, const char *format, va_list args)
Sends a log instruction over the given guac_socket connection.
int guac_protocol_send_move(guac_socket *socket, const guac_layer *layer, const guac_layer *parent, int x, int y, int z)
Sends a move instruction over the given guac_socket connection.
Represents a single object within the Guacamole protocol.
Definition: object.h:35
int guac_protocol_send_rect(guac_socket *socket, const guac_layer *layer, int x, int y, int width, int height)
Sends a rect instruction over the given guac_socket connection.
int guac_protocol_send_cursor(guac_socket *socket, int x, int y, const guac_layer *srcl, int srcx, int srcy, int w, int h)
Sends a cursor instruction over the given guac_socket connection.
int guac_protocol_send_log(guac_socket *socket, const char *format,...)
Sends a log instruction over the given guac_socket connection.
int guac_protocol_send_identity(guac_socket *socket, const guac_layer *layer)
Sends an identity instruction over the given guac_socket connection.
int guac_protocol_send_curve(guac_socket *socket, const guac_layer *layer, int cp1x, int cp1y, int cp2x, int cp2y, int x, int y)
Sends a curve instruction over the given guac_socket connection.
int guac_protocol_send_close(guac_socket *socket, const guac_layer *layer)
Sends a close instruction over the given guac_socket connection.
int guac_protocol_send_audio(guac_socket *socket, const guac_stream *stream, int channel, const char *mimetype, double duration)
Sends an audio instruction over the given guac_socket connection.
guac_transfer_function
Default transfer functions.
Definition: protocol-types.h:187
int guac_protocol_send_dispose(guac_socket *socket, const guac_layer *layer)
Sends a dispose instruction over the given guac_socket connection.
int guac_protocol_send_start(guac_socket *socket, const guac_layer *layer, int x, int y)
Sends a start instruction over the given guac_socket connection.
int guac_protocol_send_sync(guac_socket *socket, guac_timestamp timestamp)
Sends a sync instruction over the given guac_socket connection.
int guac_protocol_send_lfill(guac_socket *socket, guac_composite_mode mode, const guac_layer *layer, const guac_layer *srcl)
Sends an lfill instruction over the given guac_socket connection.
guac_line_cap_style
Supported line cap styles.
Definition: protocol-types.h:232
int guac_protocol_send_nest(guac_socket *socket, int index, const char *data)
Sends a nest instruction over the given guac_socket connection.
int guac_protocol_send_body(guac_socket *socket, const guac_object *object, const guac_stream *stream, const char *mimetype, const char *name)
Sends a body instruction over the given guac_socket connection.
int guac_protocol_send_line(guac_socket *socket, const guac_layer *layer, int x, int y)
Sends a line instruction over the given guac_socket connection.
Type definitions related to the Guacamole protocol.
int guac_protocol_send_copy(guac_socket *socket, const guac_layer *srcl, int srcx, int srcy, int w, int h, guac_composite_mode mode, const guac_layer *dstl, int dstx, int dsty)
Sends a copy instruction over the given guac_socket connection.
int guac_protocol_send_push(guac_socket *socket, const guac_layer *layer)
Sends a push instruction over the given guac_socket connection.
int guac_protocol_send_video(guac_socket *socket, const guac_stream *stream, const guac_layer *layer, const char *mimetype, double duration)
Sends a video instruction over the given guac_socket connection.
int64_t guac_timestamp
An arbitrary timestamp denoting a relative time value in milliseconds.
Definition: timestamp-types.h:37
int guac_protocol_send_shade(guac_socket *socket, const guac_layer *layer, int a)
Sends a shade instruction over the given guac_socket connection.
int guac_protocol_send_clip(guac_socket *socket, const guac_layer *layer)
Sends a clip instruction over the given guac_socket connection.
int guac_protocol_send_file(guac_socket *socket, const guac_stream *stream, const char *mimetype, const char *name)
Sends a file instruction over the given guac_socket connection.
int guac_protocol_send_undefine(guac_socket *socket, const guac_object *object)
Sends an undefine instruction over the given guac_socket connection.
int guac_protocol_send_pop(guac_socket *socket, const guac_layer *layer)
Sends a pop instruction over the given guac_socket connection.
int guac_protocol_send_transform(guac_socket *socket, const guac_layer *layer, double a, double b, double c, double d, double e, double f)
Sends a transform instruction over the given guac_socket connection.
int guac_protocol_send_size(guac_socket *socket, const guac_layer *layer, int w, int h)
Sends a size instruction over the given guac_socket connection.
Type definitions related to Guacamole layers.
guac_composite_mode
Composite modes used by Guacamole draw instructions.
Definition: protocol-types.h:138
int guac_protocol_send_pipe(guac_socket *socket, const guac_stream *stream, const char *mimetype, const char *name)
Sends a pipe instruction over the given guac_socket connection.
guac_protocol_status
Set of all possible status codes returned by protocol operations.
Definition: protocol-types.h:47
Represents a single layer within the Guacamole protocol.
Definition: layer.h:37
Represents a single stream within the Guacamole protocol.
Definition: stream.h:35
int guac_protocol_send_connect(guac_socket *socket, const char **args)
Sends a connect instruction over the given guac_socket connection.
int guac_protocol_send_error(guac_socket *socket, const char *error, guac_protocol_status status)
Sends an error instruction over the given guac_socket connection.
int guac_protocol_send_ack(guac_socket *socket, guac_stream *stream, const char *error, guac_protocol_status status)
Sends an ack instruction over the given guac_socket connection.
int guac_protocol_send_cfill(guac_socket *socket, guac_composite_mode mode, const guac_layer *layer, int r, int g, int b, int a)
Sends a cfill instruction over the given guac_socket connection.
Type definitions related to Guacamole protocol timestamps.