From 194a76df115db3b6fe62adbccfe4181ed46d2c52 Mon Sep 17 00:00:00 2001 From: dscho Date: Thu, 6 Oct 2005 19:26:41 +0000 Subject: add an extension mechanism for LibVNCClient, modify the client data handling so that more than one data structure can be attached, and add an example to speak the client part of the back channel. --- rfb/rfbclient.h | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'rfb') diff --git a/rfb/rfbclient.h b/rfb/rfbclient.h index 5d34526..c99f4f9 100644 --- a/rfb/rfbclient.h +++ b/rfb/rfbclient.h @@ -63,6 +63,15 @@ typedef struct { rfbBool doNotSleep; } rfbVNCRec; +/* client data */ + +typedef struct rfbClientData { + void* tag; + void* data; + struct rfbClientData* next; +} rfbClientData; + +/* app data (belongs into rfbClient?) */ typedef struct { rfbBool shareDesktop; @@ -181,7 +190,7 @@ typedef struct _rfbClient { uint8_t *rcSource, *rcMask; /* private data pointer */ - void* clientData; + rfbClientData* clientData; rfbVNCRec* vncRec; @@ -223,6 +232,26 @@ extern rfbBool HandleRFBServerMessage(rfbClient* client); extern void PrintPixelFormat(rfbPixelFormat *format); +/* client data */ + +void rfbClientSetClientData(rfbClient* client, void* tag, void* data); +void* rfbClientGetClientData(rfbClient* client, void* tag); + +/* protocol extensions */ + +typedef struct _rfbClientProtocolExtension { + int* encodings; + /* returns TRUE if the encoding was handled */ + rfbBool (*handleEncoding)(rfbClient* cl, + rfbFramebufferUpdateRectHeader* rect); + /* returns TRUE if it handled the message */ + rfbBool (*handleMessage)(rfbClient* cl, + rfbServerToClientMsg* message); + struct _rfbClientProtocolExtension* next; +} rfbClientProtocolExtension; + +void rfbClientRegisterExtension(rfbClientProtocolExtension* e); + /* sockets.c */ extern rfbBool errorMessageOnReadFailure; -- cgit v1.2.3