1 #ifndef _LIBRFB_DECODER_H_
2 #define _LIBRFB_DECODER_H_
17 #define IS_VERSION(x, ma, mi) ((x->protocol_major == ma) && (x->protocol_minor == mi))
18 #define IS_VERSION_3_3(x) IS_VERSION(x, 3, 3)
19 #define IS_VERSION_3_7(x) IS_VERSION(x, 3, 7)
20 #define IS_VERSION_3_8(x) IS_VERSION(x, 3, 8)
22 #define MESSAGE_TYPE_FRAMEBUFFER_UPDATE 0
24 #define ENCODING_TYPE_RAW 0
25 #define ENCODING_TYPE_COPYRECT 1
26 #define ENCODING_TYPE_RRE 2
27 #define ENCODING_TYPE_CORRE 4
28 #define ENCODING_TYPE_HEXTILE 5
30 #define SUBENCODING_RAW 1
31 #define SUBENCODING_BACKGROUND 2
32 #define SUBENCODING_FOREGROUND 4
33 #define SUBENCODING_ANYSUBRECTS 8
34 #define SUBENCODING_SUBRECTSCOLORED 16
36 typedef struct _RfbDecoder RfbDecoder;
41 gboolean (*state) (RfbDecoder * decoder);
43 gpointer buffer_handler_data;
45 GSocketClient *socket_client;
46 GSocketConnection *connection;
47 GCancellable *cancellable;
51 gpointer decoder_private;
57 /* settable properties */
60 /* readable properties */
68 gboolean use_copyrect;
85 /* information if we don't want to update the whole screen */
93 /* some many used values */
97 /* Seriliaze writes operations */
101 RfbDecoder *rfb_decoder_new (void);
102 void rfb_decoder_free (RfbDecoder * decoder);
103 gboolean rfb_decoder_connect_tcp (RfbDecoder * decoder,
104 gchar * host, guint port);
105 void rfb_decoder_disconnect (RfbDecoder * decoder);
106 gboolean rfb_decoder_iterate (RfbDecoder * decoder);
107 void rfb_decoder_send_update_request (RfbDecoder * decoder,
108 gboolean incremental, gint x, gint y, gint width, gint height);
109 void rfb_decoder_send_key_event (RfbDecoder * decoder,
110 guint key, gboolean down_flag);
111 void rfb_decoder_send_pointer_event (RfbDecoder * decoder,
112 gint button_mask, gint x, gint y);