libguac  0.9.7
client.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_CLIENT_H
24 #define _GUAC_CLIENT_H
25 
32 #include "client-fntypes.h"
33 #include "client-types.h"
34 #include "client-constants.h"
35 #include "instruction-types.h"
36 #include "layer-types.h"
37 #include "pool-types.h"
38 #include "socket-types.h"
39 #include "stream-types.h"
40 #include "timestamp-types.h"
41 
42 #include <stdarg.h>
43 
45 
53 
61 
66  const char** audio_mimetypes;
67 
72  const char** video_mimetypes;
73 
82 
83 };
84 
85 struct guac_client {
86 
95 
103 
109 
115 
121 
127  void* data;
128 
144 
171 
189 
210 
227 
246 
265 
284 
303 
321 
344 
368 
374  guac_pool* __buffer_pool;
375 
381  guac_pool* __layer_pool;
382 
386  guac_pool* __stream_pool;
387 
391  guac_stream* __output_streams;
392 
396  guac_stream* __input_streams;
397 
406 
407 };
408 
416 
422 void guac_client_free(guac_client* client);
423 
435 
447  const char* format, ...);
448 
461  const char* format, va_list ap);
462 
470 void guac_client_stop(guac_client* client);
471 
484  const char* format, ...);
485 
499  const char* format, va_list ap);
500 
509 
518 
526 void guac_client_free_buffer(guac_client* client, guac_layer* layer);
527 
535 void guac_client_free_layer(guac_client* client, guac_layer* layer);
536 
545 
553 void guac_client_free_stream(guac_client* client, guac_stream* stream);
554 
558 extern const guac_layer* GUAC_DEFAULT_LAYER;
559 
560 #endif
561 
void vguac_client_abort(guac_client *client, guac_protocol_status status, const char *format, va_list ap)
Signals the given client to stop gracefully, while also signalling via the Guacamole protocol that an...
guac_client_blob_handler * blob_handler
Handler for blob events sent by the Guacamole web-client.
Definition: client.h:302
int guac_client_end_handler(guac_client *client, guac_stream *stream)
Handler for Guacamole stream end events.
Definition: client-fntypes.h:93
const guac_layer * GUAC_DEFAULT_LAYER
The default Guacamole client layer, layer 0.
Constants related to the Guacamole client structure, guac_client.
guac_client_ack_handler * ack_handler
Handler for ack events sent by the Guacamole web-client.
Definition: client.h:283
int guac_client_blob_handler(guac_client *client, guac_stream *stream, void *data, int length)
Handler for Guacamole stream blob events.
Definition: client-fntypes.h:81
Type definitions related to the guac_socket object.
guac_socket * socket
The guac_socket structure to be used to communicate with the web-client.
Definition: client.h:94
guac_timestamp last_sent_timestamp
The time (in milliseconds) that the last sync message was sent to the client.
Definition: client.h:114
Type definitions related to Guacamole protocol streams.
The core I/O object of Guacamole.
Definition: socket.h:41
guac_stream * guac_client_alloc_stream(guac_client *client)
Allocates a new stream.
int guac_client_size_handler(guac_client *client, int width, int height)
Handler for Guacamole screen size events.
Definition: client-fntypes.h:63
guac_client_state
Possible current states of the Guacamole client.
Definition: client-types.h:44
void * data
Arbitrary reference to proxy client-specific data.
Definition: client.h:127
const char ** audio_mimetypes
NULL-terminated array of client-supported audio mimetypes.
Definition: client.h:66
void guac_client_free_layer(guac_client *client, guac_layer *layer)
Returns the given layer to the pool of available layers, such that it can be reused by any subsequent...
Type definitions related to the Guacamole client structure, guac_client.
guac_client_file_handler * file_handler
Handler for file events sent by the Guacamole web-client.
Definition: client.h:245
int guac_client_file_handler(guac_client *client, guac_stream *stream, char *mimetype, char *filename)
Handler for Guacamole file transfer events.
Definition: client-fntypes.h:69
guac_layer * guac_client_alloc_buffer(guac_client *client)
Allocates a new buffer (invisible layer).
void guac_client_abort(guac_client *client, guac_protocol_status status, const char *format,...)
Signals the given client to stop gracefully, while also signalling via the Guacamole protocol that an...
guac_client_info info
Information structure containing properties exposed by the remote client during the initial handshake...
Definition: client.h:120
int guac_client_pipe_handler(guac_client *client, guac_stream *stream, char *mimetype, char *name)
Handler for Guacamole pipe events.
Definition: client-fntypes.h:75
void vguac_client_log(guac_client *client, guac_client_log_level level, const char *format, va_list ap)
Writes a message in the log used by the given client.
guac_client_log_handler * log_handler
Logging handler.
Definition: client.h:367
const char ** video_mimetypes
NULL-terminated array of client-supported video mimetypes.
Definition: client.h:72
guac_client_size_handler * size_handler
Handler for size events sent by the Guacamole web-client.
Definition: client.h:226
int guac_client_key_handler(guac_client *client, int keysym, int pressed)
Handler for Guacamole key events.
Definition: client-fntypes.h:53
void guac_client_free_buffer(guac_client *client, guac_layer *layer)
Returns the given buffer to the pool of available buffers, such that it can be reused by any subseque...
Information exposed by the remote client during the connection handshake which can be used by a clien...
Definition: client.h:44
guac_client_clipboard_handler * clipboard_handler
Handler for clipboard events sent by the Guacamole web-client.
Definition: client.h:209
int guac_client_free_handler(guac_client *client)
Handler for freeing up any extra data allocated by the client implementation.
Definition: client-fntypes.h:109
int guac_client_ack_handler(guac_client *client, guac_stream *stream, char *error, guac_protocol_status status)
Handler for Guacamole stream ack events.
Definition: client-fntypes.h:87
int guac_client_clipboard_handler(guac_client *client, guac_stream *stream, char *mimetype)
Handler for Guacamole clipboard events.
Definition: client-fntypes.h:58
guac_client_mouse_handler * mouse_handler
Handler for mouse events sent by the Gaucamole web-client.
Definition: client.h:170
Type definitions related to the guac_pool pool of unique integers.
guac_client_state state
The current state of the client.
Definition: client.h:102
int guac_client_handle_instruction(guac_client *client, guac_instruction *instruction)
Call the appropriate handler defined by the given client for the given instruction.
int64_t guac_timestamp
An arbitrary timestamp denoting a relative time value in milliseconds.
Definition: timestamp-types.h:37
Function type definitions related to the Guacamole client structure, guac_client. ...
int guac_client_mouse_handler(guac_client *client, int x, int y, int button_mask)
Handler for Guacamole mouse events.
Definition: client-fntypes.h:48
Guacamole proxy client.
Definition: client.h:85
A pool of integers.
Definition: pool.h:35
guac_client * guac_client_alloc()
Returns a new, barebones guac_client.
int optimal_width
The number of pixels the remote client requests for the display width.
Definition: client.h:52
void guac_client_free(guac_client *client)
Free all resources associated with the given client.
guac_client_end_handler * end_handler
Handler for stream end events sent by the Guacamole web-client.
Definition: client.h:320
guac_layer * guac_client_alloc_layer(guac_client *client)
Allocates a new layer.
Type definitions related to Guacamole layers.
guac_client_pipe_handler * pipe_handler
Handler for pipe events sent by the Guacamole web-client.
Definition: client.h:264
guac_client_free_handler * free_handler
Handler for freeing data when the client is being unloaded.
Definition: client.h:343
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
void guac_client_stop(guac_client *client)
Signals the given client to stop gracefully.
Represents a single stream within the Guacamole protocol.
Definition: stream.h:35
void guac_client_log_handler(guac_client *client, guac_client_log_level level, const char *format, va_list args)
Handler for logging messages.
Definition: client-fntypes.h:114
guac_client_key_handler * key_handler
Handler for key events sent by the Guacamole web-client.
Definition: client.h:188
int optimal_resolution
The DPI of the physical remote display if configured for the optimal width/height combination describ...
Definition: client.h:81
int guac_client_handle_messages(guac_client *client)
Handler for server messages (where "server" refers to the server that the proxy client is connected t...
Definition: client-fntypes.h:43
guac_client_handle_messages * handle_messages
Handler for server messages.
Definition: client.h:143
Type definitions related to Guacamole instructions.
guac_client_log_level
All supported log levels used by the logging subsystem of each Guacamole client.
Definition: client-types.h:65
Represents a single instruction within the Guacamole protocol.
Definition: instruction.h:38
int optimal_height
The number of pixels the remote client requests for the display height.
Definition: client.h:60
void guac_client_free_stream(guac_client *client, guac_stream *stream)
Returns the given stream to the pool of available streams, such that it can be reused by any subseque...
guac_timestamp last_received_timestamp
The time (in milliseconds) of receipt of the last sync message from the client.
Definition: client.h:108
Type definitions related to Guacamole protocol timestamps.
char * connection_id
The unique identifier allocated for the connection, which may be used within the Guacamole protocol t...
Definition: client.h:405
void guac_client_log(guac_client *client, guac_client_log_level level, const char *format,...)
Writes a message in the log used by the given client.