00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _GUAC_CLIENT_H
00021 #define _GUAC_CLIENT_H
00022
00029 #include "client-fntypes.h"
00030 #include "client-types.h"
00031 #include "client-constants.h"
00032 #include "layer-types.h"
00033 #include "object-types.h"
00034 #include "pool-types.h"
00035 #include "socket-types.h"
00036 #include "stream-types.h"
00037 #include "timestamp-types.h"
00038 #include "user-fntypes.h"
00039 #include "user-types.h"
00040
00041 #include <cairo/cairo.h>
00042
00043 #include <pthread.h>
00044 #include <stdarg.h>
00045
00046 struct guac_client {
00047
00057 guac_socket* socket;
00058
00065 guac_client_state state;
00066
00072 void* data;
00073
00078 guac_timestamp last_sent_timestamp;
00079
00101 guac_client_free_handler* free_handler;
00102
00125 guac_client_log_handler* log_handler;
00126
00132 guac_pool* __buffer_pool;
00133
00139 guac_pool* __layer_pool;
00140
00144 guac_pool* __stream_pool;
00145
00150 guac_stream* __output_streams;
00151
00159 char* connection_id;
00160
00165 pthread_rwlock_t __users_lock;
00166
00171 guac_user* __users;
00172
00178 guac_user* __owner;
00179
00184 int connected_users;
00185
00207 guac_user_join_handler* join_handler;
00208
00225 guac_user_leave_handler* leave_handler;
00226
00251 const char** args;
00252
00258 void* __plugin_handle;
00259
00260 };
00261
00268 guac_client* guac_client_alloc();
00269
00275 void guac_client_free(guac_client* client);
00276
00287 void guac_client_log(guac_client* client, guac_client_log_level level,
00288 const char* format, ...);
00289
00301 void vguac_client_log(guac_client* client, guac_client_log_level level,
00302 const char* format, va_list ap);
00303
00311 void guac_client_stop(guac_client* client);
00312
00324 void guac_client_abort(guac_client* client, guac_protocol_status status,
00325 const char* format, ...);
00326
00339 void vguac_client_abort(guac_client* client, guac_protocol_status status,
00340 const char* format, va_list ap);
00341
00349 guac_layer* guac_client_alloc_buffer(guac_client* client);
00350
00358 guac_layer* guac_client_alloc_layer(guac_client* client);
00359
00367 void guac_client_free_buffer(guac_client* client, guac_layer* layer);
00368
00376 void guac_client_free_layer(guac_client* client, guac_layer* layer);
00377
00388 guac_stream* guac_client_alloc_stream(guac_client* client);
00389
00400 void guac_client_free_stream(guac_client* client, guac_stream* stream);
00401
00414 int guac_client_add_user(guac_client* client, guac_user* user, int argc, char** argv);
00415
00423 void guac_client_remove_user(guac_client* client, guac_user* user);
00424
00445 void guac_client_foreach_user(guac_client* client,
00446 guac_user_callback* callback, void* data);
00447
00474 void* guac_client_for_owner(guac_client* client, guac_user_callback* callback,
00475 void* data);
00476
00507 void* guac_client_for_user(guac_client* client, guac_user* user,
00508 guac_user_callback* callback, void* data);
00509
00521 int guac_client_end_frame(guac_client* client);
00522
00535 int guac_client_load_plugin(guac_client* client, const char* protocol);
00536
00549 int guac_client_get_processing_lag(guac_client* client);
00550
00580 void guac_client_stream_png(guac_client* client, guac_socket* socket,
00581 guac_composite_mode mode, const guac_layer* layer, int x, int y,
00582 cairo_surface_t* surface);
00583
00618 void guac_client_stream_jpeg(guac_client* client, guac_socket* socket,
00619 guac_composite_mode mode, const guac_layer* layer, int x, int y,
00620 cairo_surface_t* surface, int quality);
00621
00663 void guac_client_stream_webp(guac_client* client, guac_socket* socket,
00664 guac_composite_mode mode, const guac_layer* layer, int x, int y,
00665 cairo_surface_t* surface, int quality, int lossless);
00666
00678 int guac_client_supports_webp(guac_client* client);
00679
00683 extern const guac_layer* GUAC_DEFAULT_LAYER;
00684
00685 #endif
00686