libguac  1.4.0
protocol.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
20 #ifndef _GUAC_PROTOCOL_H
21 #define _GUAC_PROTOCOL_H
22 
31 #include "layer-types.h"
32 #include "object-types.h"
33 #include "protocol-constants.h"
34 #include "protocol-types.h"
35 #include "socket-types.h"
36 #include "stream-types.h"
37 #include "timestamp-types.h"
38 
39 #include <cairo/cairo.h>
40 #include <stdarg.h>
41 
42 /* CONTROL INSTRUCTIONS */
43 
59  const char* error, guac_protocol_status status);
60 
71 int guac_protocol_send_args(guac_socket* socket, const char** args);
72 
83 int guac_protocol_send_connect(guac_socket* socket, const char** args);
84 
95 
107 int guac_protocol_send_error(guac_socket* socket, const char* error,
108  guac_protocol_status status);
109 
133 int guac_protocol_send_key(guac_socket* socket, int keysym, int pressed,
134  guac_timestamp timestamp);
135 
148 int guac_protocol_send_log(guac_socket* socket, const char* format, ...);
149 
171 int vguac_protocol_send_log(guac_socket* socket, const char* format,
172  va_list args);
173 
209 int guac_protocol_send_mouse(guac_socket* socket, int x, int y,
210  int button_mask, guac_timestamp timestamp);
211 
255 int guac_protocol_send_touch(guac_socket* socket, int id, int x, int y,
256  int x_radius, int y_radius, double angle, double force,
257  guac_timestamp timestamp);
258 
279 int guac_protocol_send_nest(guac_socket* socket, int index,
280  const char* data);
281 
293 
304 int guac_protocol_send_ready(guac_socket* socket, const char* id);
305 
318 int guac_protocol_send_set(guac_socket* socket, const guac_layer* layer,
319  const char* name, const char* value);
320 
344 int guac_protocol_send_set_int(guac_socket* socket, const guac_layer* layer,
345  const char* name, int value);
346 
357 int guac_protocol_send_select(guac_socket* socket, const char* protocol);
358 
370 int guac_protocol_send_sync(guac_socket* socket, guac_timestamp timestamp);
371 
372 /* OBJECT INSTRUCTIONS */
373 
399 int guac_protocol_send_body(guac_socket* socket, const guac_object* object,
400  const guac_stream* stream, const char* mimetype, const char* name);
401 
421  const guac_object* object, const char* name);
422 
439  const guac_object* object);
440 
441 /* MEDIA INSTRUCTIONS */
442 
461 int guac_protocol_send_audio(guac_socket* socket, const guac_stream* stream,
462  const char* mimetype);
463 
476 int guac_protocol_send_file(guac_socket* socket, const guac_stream* stream,
477  const char* mimetype, const char* name);
478 
491 int guac_protocol_send_pipe(guac_socket* socket, const guac_stream* stream,
492  const char* mimetype, const char* name);
493 
508 int guac_protocol_send_blob(guac_socket* socket, const guac_stream* stream,
509  const void* data, int count);
510 
539 int guac_protocol_send_blobs(guac_socket* socket, const guac_stream* stream,
540  const void* data, int count);
541 
552 int guac_protocol_send_end(guac_socket* socket, const guac_stream* stream);
553 
575 int guac_protocol_send_video(guac_socket* socket, const guac_stream* stream,
576  const guac_layer* layer, const char* mimetype);
577 
578 /* DRAWING INSTRUCTIONS */
579 
597 int guac_protocol_send_arc(guac_socket* socket, const guac_layer* layer,
598  int x, int y, int radius, double startAngle, double endAngle,
599  int negative);
600 
617  guac_composite_mode mode, const guac_layer* layer,
618  int r, int g, int b, int a);
619 
630 int guac_protocol_send_clip(guac_socket* socket, const guac_layer* layer);
631 
642 int guac_protocol_send_close(guac_socket* socket, const guac_layer* layer);
643 
665  const guac_layer* srcl, int srcx, int srcy, int w, int h,
666  guac_composite_mode mode, const guac_layer* dstl, int dstx, int dsty);
667 
687  guac_composite_mode mode, const guac_layer* layer,
688  guac_line_cap_style cap, guac_line_join_style join, int thickness,
689  int r, int g, int b, int a);
690 
707 int guac_protocol_send_cursor(guac_socket* socket, int x, int y,
708  const guac_layer* srcl, int srcx, int srcy, int w, int h);
709 
726 int guac_protocol_send_curve(guac_socket* socket, const guac_layer* layer,
727  int cp1x, int cp1y, int cp2x, int cp2y, int x, int y);
728 
739 int guac_protocol_send_identity(guac_socket* socket, const guac_layer* layer);
740 
754  guac_composite_mode mode, const guac_layer* layer,
755  const guac_layer* srcl);
756 
769 int guac_protocol_send_line(guac_socket* socket, const guac_layer* layer,
770  int x, int y);
771 
788  guac_composite_mode mode, const guac_layer* layer,
789  guac_line_cap_style cap, guac_line_join_style join, int thickness,
790  const guac_layer* srcl);
791 
825 int guac_protocol_send_img(guac_socket* socket, const guac_stream* stream,
826  guac_composite_mode mode, const guac_layer* layer,
827  const char* mimetype, int x, int y);
828 
839 int guac_protocol_send_pop(guac_socket* socket, const guac_layer* layer);
840 
851 int guac_protocol_send_push(guac_socket* socket, const guac_layer* layer);
852 
867 int guac_protocol_send_rect(guac_socket* socket, const guac_layer* layer,
868  int x, int y, int width, int height);
869 
884 int guac_protocol_send_required(guac_socket* socket, const char** required);
885 
896 int guac_protocol_send_reset(guac_socket* socket, const guac_layer* layer);
897 
910 int guac_protocol_send_start(guac_socket* socket, const guac_layer* layer,
911  int x, int y);
912 
934  const guac_layer* srcl, int srcx, int srcy, int w, int h,
935  guac_transfer_function fn, const guac_layer* dstl, int dstx, int dsty);
936 
954  const guac_layer* layer,
955  double a, double b, double c,
956  double d, double e, double f);
957 
958 /* LAYER INSTRUCTIONS */
959 
970 int guac_protocol_send_dispose(guac_socket* socket, const guac_layer* layer);
971 
989  const guac_layer* layer,
990  double a, double b, double c,
991  double d, double e, double f);
992 
1008 int guac_protocol_send_move(guac_socket* socket, const guac_layer* layer,
1009  const guac_layer* parent, int x, int y, int z);
1010 
1022 int guac_protocol_send_shade(guac_socket* socket, const guac_layer* layer,
1023  int a);
1024 
1037 int guac_protocol_send_size(guac_socket* socket, const guac_layer* layer,
1038  int w, int h);
1039 
1040 /* TEXT INSTRUCTIONS */
1041 
1064 int guac_protocol_send_argv(guac_socket* socket, guac_stream* stream,
1065  const char* mimetype, const char* name);
1066 
1078 int guac_protocol_send_clipboard(guac_socket* socket, const guac_stream* stream,
1079  const char* mimetype);
1080 
1088 int guac_protocol_send_name(guac_socket* socket, const char* name);
1089 
1097 int guac_protocol_decode_base64(char* base64);
1098 
1111 guac_protocol_version guac_protocol_string_to_version(const char* version_string);
1112 
1125 
1126 #endif
1127 
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_blobs(guac_socket *socket, const guac_stream *stream, const void *data, int count)
Sends a series of blob instructions, splitting the given data across the number of instructions requi...
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_video(guac_socket *socket, const guac_stream *stream, const guac_layer *layer, const char *mimetype)
Sends a video 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.
guac_protocol_version
The set of protocol versions known to guacd to handle negotiation or feature support between differin...
Definition: protocol-types.h:283
Type definitions related to Guacamole protocol streams.
The core I/O object of Guacamole.
Definition: socket.h:39
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_audio(guac_socket *socket, const guac_stream *stream, const char *mimetype)
Sends an audio instruction over the given guac_socket connection.
guac_line_join_style
Supported line join styles.
Definition: protocol-types.h:273
int guac_protocol_send_disconnect(guac_socket *socket)
Sends a disconnect instruction over the given guac_socket connection.
Constants related to the Guacamole protocol.
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:32
int guac_protocol_send_blob(guac_socket *socket, const guac_stream *stream, const void *data, int count)
Writes a block of data to the currently in-progress blob which was already created.
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_touch(guac_socket *socket, int id, int x, int y, int x_radius, int y_radius, double angle, double force, guac_timestamp timestamp)
Sends a touch 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.
guac_transfer_function
Default transfer functions.
Definition: protocol-types.h:219
int guac_protocol_send_dispose(guac_socket *socket, const guac_layer *layer)
Sends a dispose instruction over the given guac_socket connection.
const char * guac_protocol_version_to_string(guac_protocol_version version)
Given the enum value of the protocol version, return a pointer to the string representation of the ve...
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:264
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_mouse(guac_socket *socket, int x, int y, int button_mask, guac_timestamp timestamp)
Sends a mouse 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:34
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_argv(guac_socket *socket, guac_stream *stream, const char *mimetype, const char *name)
Sends an argv 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_required(guac_socket *socket, const char **required)
Sends a "required" 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:170
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:44
Represents a single layer within the Guacamole protocol.
Definition: layer.h:34
Represents a single stream within the Guacamole protocol.
Definition: stream.h:32
guac_protocol_version guac_protocol_string_to_version(const char *version_string)
Given a string representation of a protocol version, return the enum value of that protocol version...
int guac_protocol_send_key(guac_socket *socket, int keysym, int pressed, guac_timestamp timestamp)
Sends a key instruction over the given guac_socket connection.
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_set_int(guac_socket *socket, const guac_layer *layer, const char *name, int value)
Sends a set 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.