summaryrefslogtreecommitdiffstats
path: root/rfb/rfbclient.h
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2017-10-14 18:50:54 +0200
committerSlávek Banko <slavek.banko@axis.cz>2017-10-14 18:50:54 +0200
commit68cb29a12f8f2a336088f087cdbc9e0e7aa92ae5 (patch)
treeb1a8739116bd994e85cfa4ac8a275b49678ba00b /rfb/rfbclient.h
parent27bc3dba7089268b0247e91957fff498a43d08dc (diff)
parent8415ff4c3517c6697d53e1a17bba35284f480891 (diff)
downloadlibtdevnc-68cb29a12f8f2a336088f087cdbc9e0e7aa92ae5.tar.gz
libtdevnc-68cb29a12f8f2a336088f087cdbc9e0e7aa92ae5.zip
Merge tag 'LibVNCServer-0.9.11' of https://github.com/LibVNC/libvncserver
Conflicts: CMakeLists.txt libvncserver/main.c
Diffstat (limited to 'rfb/rfbclient.h')
-rw-r--r--rfb/rfbclient.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/rfb/rfbclient.h b/rfb/rfbclient.h
index f3700ae..17ddba6 100644
--- a/rfb/rfbclient.h
+++ b/rfb/rfbclient.h
@@ -47,13 +47,13 @@
(*(char *)&client->endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s))
#define rfbClientSwap32IfLE(l) \
- (*(char *)&client->endianTest ? ((((l) & 0xff000000) >> 24) | \
+ (*(char *)&client->endianTest ? ((((l) >> 24) & 0x000000ff) | \
(((l) & 0x00ff0000) >> 8) | \
(((l) & 0x0000ff00) << 8) | \
(((l) & 0x000000ff) << 24)) : (l))
#define rfbClientSwap64IfLE(l) \
- (*(char *)&client->endianTest ? ((((l) & 0xff00000000000000ULL) >> 56) | \
+ (*(char *)&client->endianTest ? ((((l) >> 56 ) & 0x00000000000000ffULL) | \
(((l) & 0x00ff000000000000ULL) >> 40) | \
(((l) & 0x0000ff0000000000ULL) >> 24) | \
(((l) & 0x000000ff00000000ULL) >> 8) | \
@@ -175,9 +175,17 @@ typedef rfbCredential* (*GetCredentialProc)(struct _rfbClient* client, int crede
typedef rfbBool (*MallocFrameBufferProc)(struct _rfbClient* client);
typedef void (*GotXCutTextProc)(struct _rfbClient* client, const char *text, int textlen);
typedef void (*BellProc)(struct _rfbClient* client);
-
+/**
+ Called when a cursor shape update was received from the server. The decoded cursor shape
+ will be in client->rcSource. It's up to the application to do something with this, e.g. draw
+ into a viewer's window. If you want the server to draw the cursor into the framebuffer, be
+ careful not to announce remote cursor support, i.e. not include rfbEncodingXCursor or
+ rfbEncodingRichCursor in SetFormatAndEncodings().
+*/
typedef void (*GotCursorShapeProc)(struct _rfbClient* client, int xhot, int yhot, int width, int height, int bytesPerPixel);
typedef void (*GotCopyRectProc)(struct _rfbClient* client, int src_x, int src_y, int w, int h, int dest_x, int dest_y);
+typedef rfbBool (*LockWriteToTLSProc)(struct _rfbClient* client);
+typedef rfbBool (*UnlockWriteToTLSProc)(struct _rfbClient* client);
typedef struct _rfbClient {
uint8_t* frameBuffer;
@@ -272,6 +280,7 @@ typedef struct _rfbClient {
/* cursor.c */
+ /** Holds cursor shape data when received from server. */
uint8_t *rcSource, *rcMask;
/** private data pointer */
@@ -358,10 +367,19 @@ typedef struct _rfbClient {
/* Output Window ID. When set, client application enables libvncclient to perform direct rendering in its window */
unsigned long outputWindow;
+ /** Hooks for optional protection WriteToTLS() by mutex */
+ LockWriteToTLSProc LockWriteToTLS;
+ UnlockWriteToTLSProc UnlockWriteToTLS;
+
} rfbClient;
/* cursor.c */
-
+/**
+ * Handles XCursor and RichCursor shape updates from the server.
+ * We emulate cursor operating on the frame buffer (that is
+ * why we call it "software cursor"). This decodes the received cursor
+ * shape and hands it over to GotCursorShapeProc, if set.
+ */
extern rfbBool HandleCursorShape(rfbClient* client,int xhot, int yhot, int width, int height, uint32_t enc);
/* listen.c */