summaryrefslogtreecommitdiffstats
path: root/rfb
diff options
context:
space:
mode:
Diffstat (limited to 'rfb')
-rw-r--r--rfb/rfb.h172
-rw-r--r--rfb/rfbclient.h76
-rw-r--r--rfb/rfbconfig.h.in119
-rw-r--r--rfb/rfbproto.h29
-rwxr-xr-xrfb/rfbregion.h16
5 files changed, 197 insertions, 215 deletions
diff --git a/rfb/rfb.h b/rfb/rfb.h
index 7acec11..0d3944e 100644
--- a/rfb/rfb.h
+++ b/rfb/rfb.h
@@ -37,11 +37,11 @@ extern "C"
#include <string.h>
#include <rfb/rfbproto.h>
-#ifdef HAVE_SYS_TYPES_H
+#ifdef LIBVNCSERVER_HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#ifdef HAVE_LIBPTHREAD
+#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
#include <pthread.h>
#if 0 /* debugging */
#define LOCK(mutex) (rfbLog("%s:%d LOCK(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_lock(&(mutex)))
@@ -84,18 +84,18 @@ extern "C"
/* end of stuff for autoconf */
-/* if you use pthreads, but don't define HAVE_LIBPTHREAD, the structs
+/* if you use pthreads, but don't define LIBVNCSERVER_HAVE_LIBPTHREAD, the structs
get all mixed up. So this gives a linker error reminding you to compile
the library and your application (at least the parts including rfb.h)
with the same support for pthreads. */
-#ifdef HAVE_LIBPTHREAD
-#ifdef HAVE_ZRLE
+#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
+#ifdef LIBVNCSERVER_HAVE_ZRLE
#define rfbInitServer rfbInitServerWithPthreadsAndZRLE
#else
#define rfbInitServer rfbInitServerWithPthreadsButWithoutZRLE
#endif
#else
-#ifdef HAVE_ZRLE
+#ifdef LIBVNCSERVER_HAVE_ZRLE
#define rfbInitServer rfbInitServerWithoutPthreadsButWithZRLE
#else
#define rfbInitServer rfbInitServerWithoutPthreadsAndZRLE
@@ -112,19 +112,19 @@ enum rfbNewClientAction {
RFB_CLIENT_REFUSE
};
-typedef void (*KbdAddEventProcPtr) (Bool down, KeySym keySym, struct _rfbClientRec* cl);
+typedef void (*KbdAddEventProcPtr) (rfbBool down, rfbKeySym keySym, struct _rfbClientRec* cl);
typedef void (*KbdReleaseAllKeysProcPtr) (struct _rfbClientRec* cl);
typedef void (*PtrAddEventProcPtr) (int buttonMask, int x, int y, struct _rfbClientRec* cl);
typedef void (*SetXCutTextProcPtr) (char* str,int len, struct _rfbClientRec* cl);
typedef struct rfbCursor* (*GetCursorProcPtr) (struct _rfbClientRec* pScreen);
-typedef Bool (*SetTranslateFunctionProcPtr)(struct _rfbClientRec* cl);
-typedef Bool (*PasswordCheckProcPtr)(struct _rfbClientRec* cl,const char* encryptedPassWord,int len);
+typedef rfbBool (*SetTranslateFunctionProcPtr)(struct _rfbClientRec* cl);
+typedef rfbBool (*PasswordCheckProcPtr)(struct _rfbClientRec* cl,const char* encryptedPassWord,int len);
typedef enum rfbNewClientAction (*NewClientHookPtr)(struct _rfbClientRec* cl);
typedef void (*DisplayHookPtr)(struct _rfbClientRec* cl);
typedef struct {
uint32_t count;
- Bool is16; /* is the data format short? */
+ rfbBool is16; /* is the data format short? */
union {
uint8_t* bytes;
uint16_t* shorts;
@@ -146,8 +146,8 @@ typedef struct _rfbScreenInfo
int bitsPerPixel;
int sizeInBytes;
- Pixel blackPixel;
- Pixel whitePixel;
+ rfbPixel blackPixel;
+ rfbPixel whitePixel;
/* some screen specific data can be put into a struct where screenData
* points to. You need this if you have more than one screen at the
@@ -192,8 +192,8 @@ typedef struct _rfbScreenInfo
dontSendFramebufferUpdate to TRUE, and all the drawing routines check
this before calling rfbSendFramebufferUpdate. */
- Bool cursorIsDrawn; /* TRUE if the cursor is currently drawn */
- Bool dontSendFramebufferUpdate; /* TRUE while removing or drawing the
+ rfbBool cursorIsDrawn; /* TRUE if the cursor is currently drawn */
+ rfbBool dontSendFramebufferUpdate; /* TRUE while removing or drawing the
cursor */
/* additions by libvncserver */
@@ -203,28 +203,28 @@ typedef struct _rfbScreenInfo
const char* desktopName;
char rfbThisHost[255];
- Bool autoPort;
+ rfbBool autoPort;
int rfbPort;
SOCKET rfbListenSock;
int maxSock;
int maxFd;
fd_set allFds;
- Bool socketInitDone;
+ rfbBool socketInitDone;
SOCKET inetdSock;
- Bool inetdInitDone;
+ rfbBool inetdInitDone;
int udpPort;
SOCKET udpSock;
struct _rfbClientRec* udpClient;
- Bool udpSockConnected;
+ rfbBool udpSockConnected;
struct sockaddr_in udpRemoteAddr;
int rfbMaxClientWait;
/* http stuff */
- Bool httpInitDone;
- Bool httpEnableProxyConnect;
+ rfbBool httpInitDone;
+ rfbBool httpEnableProxyConnect;
int httpPort;
char* httpDir;
SOCKET httpListenSock;
@@ -242,15 +242,15 @@ typedef struct _rfbScreenInfo
* an update. */
int rfbDeferUpdateTime;
char* rfbScreen;
- Bool rfbAlwaysShared;
- Bool rfbNeverShared;
- Bool rfbDontDisconnect;
+ rfbBool rfbAlwaysShared;
+ rfbBool rfbNeverShared;
+ rfbBool rfbDontDisconnect;
struct _rfbClientRec* rfbClientHead;
/* cursor */
int cursorX, cursorY,underCursorBufferLen;
char* underCursorBuffer;
- Bool dontConvertRichCursorToXCursor;
+ rfbBool dontConvertRichCursorToXCursor;
struct rfbCursor* cursor;
/* the frameBufferhas to be supplied by the serving process.
@@ -269,9 +269,9 @@ typedef struct _rfbScreenInfo
/* displayHook is called just before a frame buffer update */
DisplayHookPtr displayHook;
-#ifdef HAVE_LIBPTHREAD
+#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
MUTEX(cursorMutex);
- Bool backgroundLoop;
+ rfbBool backgroundLoop;
#endif
} rfbScreenInfo, *rfbScreenInfoPtr;
@@ -316,7 +316,7 @@ typedef struct _rfbClientRec {
SOCKET sock;
char *host;
-#ifdef HAVE_LIBPTHREAD
+#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
pthread_t client_thread;
#endif
/* Possible client states: */
@@ -327,14 +327,14 @@ typedef struct _rfbClientRec {
RFB_NORMAL /* normal protocol messages */
} state;
- Bool reverseConnection;
- Bool onHold;
- Bool readyForSetColourMapEntries;
- Bool useCopyRect;
+ rfbBool reverseConnection;
+ rfbBool onHold;
+ rfbBool readyForSetColourMapEntries;
+ rfbBool useCopyRect;
int preferredEncoding;
int correMaxWidth, correMaxHeight;
- Bool viewOnly;
+ rfbBool viewOnly;
/* The following member is only used during VNC authentication */
uint8_t authChallenge[CHALLENGESIZE];
@@ -415,42 +415,42 @@ typedef struct _rfbClientRec {
int rfbKeyEventsRcvd;
int rfbPointerEventsRcvd;
-#ifdef HAVE_LIBZ
+#ifdef LIBVNCSERVER_HAVE_LIBZ
/* zlib encoding -- necessary compression state info per client */
struct z_stream_s compStream;
- Bool compStreamInited;
+ rfbBool compStreamInited;
uint32_t zlibCompressLevel;
-#ifdef HAVE_LIBJPEG
+#ifdef LIBVNCSERVER_HAVE_LIBJPEG
/* tight encoding -- preserve zlib streams' state for each client */
- //#ifdef HAVE_LIBJPEG
+ //#ifdef LIBVNCSERVER_HAVE_LIBJPEG
z_stream zsStruct[4];
- Bool zsActive[4];
+ rfbBool zsActive[4];
int zsLevel[4];
int tightCompressLevel;
int tightQualityLevel;
#endif
#endif
- Bool enableLastRectEncoding; /* client supports LastRect encoding */
- Bool enableCursorShapeUpdates; /* client supports cursor shape updates */
- Bool enableCursorPosUpdates; /* client supports cursor position updates */
- Bool useRichCursorEncoding; /* rfbEncodingRichCursor is preferred */
- Bool cursorWasChanged; /* cursor shape update should be sent */
- Bool cursorWasMoved; /* cursor position update should be sent */
+ rfbBool enableLastRectEncoding; /* client supports LastRect encoding */
+ rfbBool enableCursorShapeUpdates; /* client supports cursor shape updates */
+ rfbBool enableCursorPosUpdates; /* client supports cursor position updates */
+ rfbBool useRichCursorEncoding; /* rfbEncodingRichCursor is preferred */
+ rfbBool cursorWasChanged; /* cursor shape update should be sent */
+ rfbBool cursorWasMoved; /* cursor position update should be sent */
- Bool useNewFBSize; /* client supports NewFBSize encoding */
- Bool newFBSizePending; /* framebuffer size was changed */
+ rfbBool useNewFBSize; /* client supports NewFBSize encoding */
+ rfbBool newFBSizePending; /* framebuffer size was changed */
-#ifdef BACKCHANNEL
- Bool enableBackChannel; /* custom channel for special clients */
+#ifdef LIBVNCSERVER_BACKCHANNEL
+ rfbBool enableBackChannel; /* custom channel for special clients */
#endif
struct _rfbClientRec *prev;
struct _rfbClientRec *next;
-#ifdef HAVE_LIBPTHREAD
+#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
/* whenever a client is referenced, the refCount has to be incremented
and afterwards decremented, so that the client is not cleaned up
while being referenced.
@@ -465,7 +465,7 @@ typedef struct _rfbClientRec {
COND(updateCond);
#endif
-#ifdef HAVE_ZRLE
+#ifdef LIBVNCSERVER_HAVE_ZRLE
void* zrleData;
#endif
@@ -543,33 +543,33 @@ extern void rfbProcessClientMessage(rfbClientPtr cl);
extern void rfbClientConnFailed(rfbClientPtr cl, char *reason);
extern void rfbNewUDPConnection(rfbScreenInfoPtr rfbScreen,int sock);
extern void rfbProcessUDPInput(rfbScreenInfoPtr rfbScreen);
-extern Bool rfbSendFramebufferUpdate(rfbClientPtr cl, sraRegionPtr updateRegion);
-extern Bool rfbSendRectEncodingRaw(rfbClientPtr cl, int x,int y,int w,int h);
-extern Bool rfbSendUpdateBuf(rfbClientPtr cl);
+extern rfbBool rfbSendFramebufferUpdate(rfbClientPtr cl, sraRegionPtr updateRegion);
+extern rfbBool rfbSendRectEncodingRaw(rfbClientPtr cl, int x,int y,int w,int h);
+extern rfbBool rfbSendUpdateBuf(rfbClientPtr cl);
extern void rfbSendServerCutText(rfbScreenInfoPtr rfbScreen,char *str, int len);
-extern Bool rfbSendCopyRegion(rfbClientPtr cl,sraRegionPtr reg,int dx,int dy);
-extern Bool rfbSendLastRectMarker(rfbClientPtr cl);
-extern Bool rfbSendNewFBSize(rfbClientPtr cl, int w, int h);
-extern Bool rfbSendSetColourMapEntries(rfbClientPtr cl, int firstColour, int nColours);
+extern rfbBool rfbSendCopyRegion(rfbClientPtr cl,sraRegionPtr reg,int dx,int dy);
+extern rfbBool rfbSendLastRectMarker(rfbClientPtr cl);
+extern rfbBool rfbSendNewFBSize(rfbClientPtr cl, int w, int h);
+extern rfbBool rfbSendSetColourMapEntries(rfbClientPtr cl, int firstColour, int nColours);
extern void rfbSendBell(rfbScreenInfoPtr rfbScreen);
void rfbGotXCutText(rfbScreenInfoPtr rfbScreen, char *str, int len);
-#ifdef BACKCHANNEL
+#ifdef LIBVNCSERVER_BACKCHANNEL
extern void rfbSendBackChannel(rfbScreenInfoPtr s,char* message,int len);
#endif
/* translate.c */
-extern Bool rfbEconomicTranslate;
+extern rfbBool rfbEconomicTranslate;
extern void rfbTranslateNone(char *table, rfbPixelFormat *in,
rfbPixelFormat *out,
char *iptr, char *optr,
int bytesBetweenInputLines,
int width, int height);
-extern Bool rfbSetTranslateFunction(rfbClientPtr cl);
-extern Bool rfbSetClientColourMap(rfbClientPtr cl, int firstColour, int nColours);
+extern rfbBool rfbSetTranslateFunction(rfbClientPtr cl);
+extern rfbBool rfbSetClientColourMap(rfbClientPtr cl, int firstColour, int nColours);
extern void rfbSetClientColourMaps(rfbScreenInfoPtr rfbScreen, int firstColour, int nColours);
/* httpd.c */
@@ -587,21 +587,21 @@ extern void rfbAuthProcessClientMessage(rfbClientPtr cl);
/* rre.c */
-extern Bool rfbSendRectEncodingRRE(rfbClientPtr cl, int x,int y,int w,int h);
+extern rfbBool rfbSendRectEncodingRRE(rfbClientPtr cl, int x,int y,int w,int h);
/* corre.c */
-extern Bool rfbSendRectEncodingCoRRE(rfbClientPtr cl, int x,int y,int w,int h);
+extern rfbBool rfbSendRectEncodingCoRRE(rfbClientPtr cl, int x,int y,int w,int h);
/* hextile.c */
-extern Bool rfbSendRectEncodingHextile(rfbClientPtr cl, int x, int y, int w,
+extern rfbBool rfbSendRectEncodingHextile(rfbClientPtr cl, int x, int y, int w,
int h);
-#ifdef HAVE_LIBZ
+#ifdef LIBVNCSERVER_HAVE_LIBZ
/* zlib.c */
/* Minimum zlib rectangle size in bytes. Anything smaller will
@@ -616,18 +616,18 @@ extern Bool rfbSendRectEncodingHextile(rfbClientPtr cl, int x, int y, int w,
#define ZLIB_MAX_SIZE(min) ((( min * 2 ) > ZLIB_MAX_RECT_SIZE ) ? \
( min * 2 ) : ZLIB_MAX_RECT_SIZE )
-extern Bool rfbSendRectEncodingZlib(rfbClientPtr cl, int x, int y, int w,
+extern rfbBool rfbSendRectEncodingZlib(rfbClientPtr cl, int x, int y, int w,
int h);
-#ifdef HAVE_LIBJPEG
+#ifdef LIBVNCSERVER_HAVE_LIBJPEG
/* tight.c */
#define TIGHT_DEFAULT_COMPRESSION 6
-extern Bool rfbTightDisableGradient;
+extern rfbBool rfbTightDisableGradient;
extern int rfbNumCodedRectsTight(rfbClientPtr cl, int x,int y,int w,int h);
-extern Bool rfbSendRectEncodingTight(rfbClientPtr cl, int x,int y,int w,int h);
+extern rfbBool rfbSendRectEncodingTight(rfbClientPtr cl, int x,int y,int w,int h);
#endif
#endif
@@ -636,7 +636,7 @@ extern Bool rfbSendRectEncodingTight(rfbClientPtr cl, int x,int y,int w,int h);
typedef struct rfbCursor {
/* set this to true if LibVNCServer has to free this cursor */
- Bool cleanup, cleanupSource, cleanupMask, cleanupRichSource;
+ rfbBool cleanup, cleanupSource, cleanupMask, cleanupRichSource;
unsigned char *source; /* points to bits */
unsigned char *mask; /* points to bits */
unsigned short width, height, xhot, yhot; /* metrics */
@@ -646,8 +646,8 @@ typedef struct rfbCursor {
} rfbCursor, *rfbCursorPtr;
extern unsigned char rfbReverseByte[0x100];
-extern Bool rfbSendCursorShape(rfbClientPtr cl/*, rfbScreenInfoPtr pScreen*/);
-extern Bool rfbSendCursorPos(rfbClientPtr cl);
+extern rfbBool rfbSendCursorShape(rfbClientPtr cl/*, rfbScreenInfoPtr pScreen*/);
+extern rfbBool rfbSendCursorPos(rfbClientPtr cl);
extern void rfbConvertLSBCursorBitmapOrMask(int width,int height,unsigned char* bitmap);
extern rfbCursorPtr rfbMakeXCursor(int width,int height,char* cursorString,char* maskString);
extern char* rfbMakeMaskForXCursor(int width,int height,char* cursorString);
@@ -656,14 +656,14 @@ extern void MakeRichCursorFromXCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr cu
extern void rfbFreeCursor(rfbCursorPtr cursor);
extern void rfbDrawCursor(rfbScreenInfoPtr rfbScreen);
extern void rfbUndrawCursor(rfbScreenInfoPtr rfbScreen);
-extern void rfbSetCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr c,Bool freeOld);
+extern void rfbSetCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr c,rfbBool freeOld);
/* cursor handling for the pointer */
extern void defaultPtrAddEvent(int buttonMask,int x,int y,rfbClientPtr cl);
/* zrle.c */
-#ifdef HAVE_ZRLE
-extern Bool rfbSendRectEncodingZRLE(rfbClientPtr cl, int x, int y, int w,int h);
+#ifdef LIBVNCSERVER_HAVE_ZRLE
+extern rfbBool rfbSendRectEncodingZRLE(rfbClientPtr cl, int x, int y, int w,int h);
extern void FreeZrleData(rfbClientPtr cl);
#endif
@@ -684,11 +684,11 @@ typedef struct rfbFontData {
int* metaData;
} rfbFontData,* rfbFontDataPtr;
-int rfbDrawChar(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,int x,int y,unsigned char c,Pixel colour);
-void rfbDrawString(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,int x,int y,const char* string,Pixel colour);
+int rfbDrawChar(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,int x,int y,unsigned char c,rfbPixel colour);
+void rfbDrawString(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,int x,int y,const char* string,rfbPixel colour);
/* if colour==backColour, background is transparent */
-int rfbDrawCharWithClip(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,int x,int y,unsigned char c,int x1,int y1,int x2,int y2,Pixel colour,Pixel backColour);
-void rfbDrawStringWithClip(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,int x,int y,const char* string,int x1,int y1,int x2,int y2,Pixel colour,Pixel backColour);
+int rfbDrawCharWithClip(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,int x,int y,unsigned char c,int x1,int y1,int x2,int y2,rfbPixel colour,rfbPixel backColour);
+void rfbDrawStringWithClip(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,int x,int y,const char* string,int x1,int y1,int x2,int y2,rfbPixel colour,rfbPixel backColour);
int rfbWidthOfString(rfbFontDataPtr font,const char* string);
int rfbWidthOfChar(rfbFontDataPtr font,unsigned char c);
void rfbFontBBox(rfbFontDataPtr font,unsigned char c,int* x1,int* y1,int* x2,int* y2);
@@ -703,9 +703,9 @@ void rfbFreeFont(rfbFontDataPtr font);
/* draw.c */
/* You have to call rfbUndrawCursor before using these functions */
-void rfbFillRect(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2,Pixel col);
-void rfbDrawPixel(rfbScreenInfoPtr s,int x,int y,Pixel col);
-void rfbDrawLine(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2,Pixel col);
+void rfbFillRect(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2,rfbPixel col);
+void rfbDrawPixel(rfbScreenInfoPtr s,int x,int y,rfbPixel col);
+void rfbDrawLine(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2,rfbPixel col);
/* selbox.c */
@@ -717,15 +717,15 @@ typedef void (*SelectionChangedHookPtr)(int index);
extern int rfbSelectBox(rfbScreenInfoPtr rfbScreen,
rfbFontDataPtr font, char** list,
int x1, int y1, int x2, int y2,
- Pixel foreColour, Pixel backColour,
+ rfbPixel foreColour, rfbPixel backColour,
int border,SelectionChangedHookPtr selChangedHook);
/* cargs.c */
extern void rfbUsage(void);
extern void rfbPurgeArguments(int* argc,int* position,int count,char *argv[]);
-extern void rfbProcessArguments(rfbScreenInfoPtr rfbScreen,int* argc, char *argv[]);
-extern void rfbProcessSizeArguments(int* width,int* height,int* bpp,int* argc, char *argv[]);
+extern rfbBool rfbProcessArguments(rfbScreenInfoPtr rfbScreen,int* argc, char *argv[]);
+extern rfbBool rfbProcessSizeArguments(int* width,int* height,int* bpp,int* argc, char *argv[]);
/* main.c */
@@ -745,7 +745,7 @@ void doNothingWithClient(rfbClientPtr cl);
enum rfbNewClientAction defaultNewClientHook(rfbClientPtr cl);
/* to check against plain passwords */
-Bool rfbCheckPasswordByList(rfbClientPtr cl,const char* response,int len);
+rfbBool rfbCheckPasswordByList(rfbClientPtr cl,const char* response,int len);
/* functions to make a vnc server */
extern rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
@@ -769,7 +769,7 @@ extern void rfbRefuseOnHoldClient(rfbClientPtr cl);
if you are using the event loop, set this to some value > 0, so the
server doesn't get a high load just by listening. */
-extern void rfbRunEventLoop(rfbScreenInfoPtr screenInfo, long usec, Bool runInBackground);
+extern void rfbRunEventLoop(rfbScreenInfoPtr screenInfo, long usec, rfbBool runInBackground);
extern void rfbProcessEvents(rfbScreenInfoPtr screenInfo,long usec);
#endif
diff --git a/rfb/rfbclient.h b/rfb/rfbclient.h
index d1b12dd..b53d36e 100644
--- a/rfb/rfbclient.h
+++ b/rfb/rfbclient.h
@@ -53,27 +53,27 @@
typedef struct {
- Bool shareDesktop;
- Bool viewOnly;
- Bool fullScreen;
- Bool grabKeyboard;
- Bool raiseOnBeep;
+ rfbBool shareDesktop;
+ rfbBool viewOnly;
+ rfbBool fullScreen;
+ rfbBool grabKeyboard;
+ rfbBool raiseOnBeep;
const char* encodingsString;
- Bool useBGR233;
+ rfbBool useBGR233;
int nColours;
- Bool useSharedColours;
- Bool forceOwnCmap;
- Bool forceTrueColour;
+ rfbBool useSharedColours;
+ rfbBool forceOwnCmap;
+ rfbBool forceTrueColour;
int requestedDepth;
- Bool useShm;
+ rfbBool useShm;
int wmDecorationWidth;
int wmDecorationHeight;
- Bool debug;
+ rfbBool debug;
int popupButtonCount;
@@ -82,19 +82,19 @@ typedef struct {
int compressLevel;
int qualityLevel;
- Bool enableJPEG;
- Bool useRemoteCursor;
+ rfbBool enableJPEG;
+ rfbBool useRemoteCursor;
} AppData;
struct _rfbClient;
-typedef Bool (*HandleCursorPosProc)(struct _rfbClient* client, int x, int y);
+typedef rfbBool (*HandleCursorPosProc)(struct _rfbClient* client, int x, int y);
typedef void (*SoftCursorLockAreaProc)(struct _rfbClient* client, int x, int y, int w, int h);
typedef void (*SoftCursorUnlockScreenProc)(struct _rfbClient* client);
typedef void (*GotFrameBufferUpdateProc)(struct _rfbClient* client, int x, int y, int w, int h);
typedef char* (*GetPasswordProc)(struct _rfbClient* client);
-typedef Bool (*MallocFrameBufferProc)(struct _rfbClient* client);
+typedef rfbBool (*MallocFrameBufferProc)(struct _rfbClient* client);
typedef void (*BellProc)(struct _rfbClient* client);
typedef struct _rfbClient {
@@ -108,7 +108,7 @@ typedef struct _rfbClient {
const char* programName;
const char* serverHost;
int serverPort;
- Bool listenSpecified;
+ rfbBool listenSpecified;
int listenPort, flashPort;
/* Note that the CoRRE encoding uses this buffer and assumes it is big enough
@@ -122,13 +122,13 @@ typedef struct _rfbClient {
/* rfbproto.c */
int sock;
- Bool canUseCoRRE;
- Bool canUseHextile;
+ rfbBool canUseCoRRE;
+ rfbBool canUseHextile;
char *desktopName;
rfbPixelFormat format;
rfbServerInitMsg si;
char *serverCutText;
- Bool newServerCutText;
+ rfbBool newServerCutText;
/* cursor.c */
uint8_t *rcSource, *rcMask;
@@ -147,7 +147,7 @@ typedef struct _rfbClient {
// TODO: make callback
-extern Bool HandleCursorShape(rfbClient* client,int xhot, int yhot, int width, int height, uint32_t enc);
+extern rfbBool HandleCursorShape(rfbClient* client,int xhot, int yhot, int width, int height, uint32_t enc);
/* listen.c */
@@ -155,38 +155,38 @@ extern void listenForIncomingConnections(rfbClient* viewer);
/* rfbproto.c */
-extern Bool rfbEnableClientLogging;
+extern rfbBool rfbEnableClientLogging;
extern void rfbClientLog(const char *format, ...);
-extern Bool ConnectToRFBServer(rfbClient* client,const char *hostname, int port);
-extern Bool InitialiseRFBConnection(rfbClient* client);
-extern Bool SetFormatAndEncodings(rfbClient* client);
-extern Bool SendIncrementalFramebufferUpdateRequest(rfbClient* client);
-extern Bool SendFramebufferUpdateRequest(rfbClient* client,
+extern rfbBool ConnectToRFBServer(rfbClient* client,const char *hostname, int port);
+extern rfbBool InitialiseRFBConnection(rfbClient* client);
+extern rfbBool SetFormatAndEncodings(rfbClient* client);
+extern rfbBool SendIncrementalFramebufferUpdateRequest(rfbClient* client);
+extern rfbBool SendFramebufferUpdateRequest(rfbClient* client,
int x, int y, int w, int h,
- Bool incremental);
-extern Bool SendPointerEvent(rfbClient* client,int x, int y, int buttonMask);
-extern Bool SendKeyEvent(rfbClient* client,uint32_t key, Bool down);
-extern Bool SendClientCutText(rfbClient* client,char *str, int len);
-extern Bool HandleRFBServerMessage(rfbClient* client);
+ rfbBool incremental);
+extern rfbBool SendPointerEvent(rfbClient* client,int x, int y, int buttonMask);
+extern rfbBool SendKeyEvent(rfbClient* client,uint32_t key, rfbBool down);
+extern rfbBool SendClientCutText(rfbClient* client,char *str, int len);
+extern rfbBool HandleRFBServerMessage(rfbClient* client);
extern void PrintPixelFormat(rfbPixelFormat *format);
/* sockets.c */
-extern Bool errorMessageOnReadFailure;
+extern rfbBool errorMessageOnReadFailure;
-extern Bool ReadFromRFBServer(rfbClient* client, char *out, unsigned int n);
-extern Bool WriteToRFBServer(rfbClient* client, char *buf, int n);
+extern rfbBool ReadFromRFBServer(rfbClient* client, char *out, unsigned int n);
+extern rfbBool WriteToRFBServer(rfbClient* client, char *buf, int n);
extern int FindFreeTcpPort(void);
extern int ListenAtTcpPort(int port);
extern int ConnectClientToTcpAddr(unsigned int host, int port);
extern int AcceptTcpConnection(int listenSock);
-extern Bool SetNonBlocking(int sock);
+extern rfbBool SetNonBlocking(int sock);
-extern Bool StringToIPAddr(const char *str, unsigned int *addr);
-extern Bool SameMachine(int sock);
+extern rfbBool StringToIPAddr(const char *str, unsigned int *addr);
+extern rfbBool SameMachine(int sock);
/* vncviewer.c */
rfbClient* rfbGetClient(int* argc,char** argv,int bitsPerSample,int samplesPerPixel,int bytesPerPixel);
-Bool rfbInitClient(rfbClient* client,const char* vncServerHost,int vncServerPort);
+rfbBool rfbInitClient(rfbClient* client,const char* vncServerHost,int vncServerPort);
void rfbClientCleanup(rfbClient* client);
diff --git a/rfb/rfbconfig.h.in b/rfb/rfbconfig.h.in
index bd65138..5736804 100644
--- a/rfb/rfbconfig.h.in
+++ b/rfb/rfbconfig.h.in
@@ -1,4 +1,4 @@
-/* rfb/rfbconfig.h.in. Generated from configure.ac by autoheader. */
+/* rfb/rfbconfig.h.in. Generated automatically from configure.ac by autoheader. */
/* Enable 24 bit per pixel in native framebuffer */
#undef ALLOW24BPP
@@ -6,161 +6,146 @@
/* Enable BackChannel communication */
#undef BACKCHANNEL
-/* Define to 1 if you have the <arpa/inet.h> header file. */
+/* Define if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
-/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+/* Define if you don't have `vprintf' but do have `_doprnt.' */
#undef HAVE_DOPRNT
-/* Define to 1 if you have the <fcntl.h> header file. */
+/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
-/* Define to 1 if you have the `ftime' function. */
+/* Define if you have the `ftime' function. */
#undef HAVE_FTIME
-/* Define to 1 if you have the `gethostbyname' function. */
+/* Define if you have the `gethostbyname' function. */
#undef HAVE_GETHOSTBYNAME
-/* Define to 1 if you have the `gethostname' function. */
+/* Define if you have the `gethostname' function. */
#undef HAVE_GETHOSTNAME
-/* Define to 1 if you have the `gettimeofday' function. */
+/* Define if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
-/* Define to 1 if you have the `inet_ntoa' function. */
+/* Define if you have the `inet_ntoa' function. */
#undef HAVE_INET_NTOA
-/* Define to 1 if you have the <inttypes.h> header file. */
+/* Define if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
-/* Define to 1 if you have the `jpeg' library (-ljpeg). */
+/* Define if you have the `jpeg' library (-ljpeg). */
#undef HAVE_LIBJPEG
-/* Define to 1 if you have the `nsl' library (-lnsl). */
+/* Define if you have the `nsl' library (-lnsl). */
#undef HAVE_LIBNSL
-/* Define to 1 if you have the `pthread' library (-lpthread). */
+/* Define if you have the `pthread' library (-lpthread). */
#undef HAVE_LIBPTHREAD
-/* Define to 1 if you have the `socket' library (-lsocket). */
+/* Define if you have the `socket' library (-lsocket). */
#undef HAVE_LIBSOCKET
-/* Define to 1 if you have the `z' library (-lz). */
+/* Define if you have the `z' library (-lz). */
#undef HAVE_LIBZ
-/* Define to 1 if your system has a working `malloc' function. */
+/* Define if your system has a working `malloc' function. */
#undef HAVE_MALLOC
-/* Define to 1 if you have the `memmove' function. */
+/* Define if you have the `memmove' function. */
#undef HAVE_MEMMOVE
-/* Define to 1 if you have the <memory.h> header file. */
+/* Define if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
-/* Define to 1 if you have the `memset' function. */
+/* Define if you have the `memset' function. */
#undef HAVE_MEMSET
-/* Define to 1 if you have the `mkfifo' function. */
+/* Define if you have the `mkfifo' function. */
#undef HAVE_MKFIFO
-/* Define to 1 if you have the <netdb.h> header file. */
+/* Define if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
-/* Define to 1 if you have the <netinet/in.h> header file. */
+/* Define if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
-/* Define to 1 if you have the `select' function. */
+/* Define if you have the `select' function. */
#undef HAVE_SELECT
-/* Define to 1 if you have the `socket' function. */
+/* Define if you have the `socket' function. */
#undef HAVE_SOCKET
-/* Define to 1 if `stat' has the bug that it succeeds when given the
- zero-length file name argument. */
+/* Define if `stat' has the bug that it succeeds when given the zero-length
+ file name argument. */
#undef HAVE_STAT_EMPTY_STRING_BUG
-/* Define to 1 if you have the <stdint.h> header file. */
+/* Define if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
-/* Define to 1 if you have the <stdlib.h> header file. */
+/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
-/* Define to 1 if you have the `strchr' function. */
+/* Define if you have the `strchr' function. */
#undef HAVE_STRCHR
-/* Define to 1 if you have the `strcspn' function. */
+/* Define if you have the `strcspn' function. */
#undef HAVE_STRCSPN
-/* Define to 1 if you have the `strdup' function. */
+/* Define if you have the `strdup' function. */
#undef HAVE_STRDUP
-/* Define to 1 if you have the `strerror' function. */
+/* Define if you have the `strerror' function. */
#undef HAVE_STRERROR
-/* Define to 1 if you have the `strftime' function. */
+/* Define if you have the `strftime' function. */
#undef HAVE_STRFTIME
-/* Define to 1 if you have the <strings.h> header file. */
+/* Define if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
-/* Define to 1 if you have the <string.h> header file. */
+/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
-/* Define to 1 if you have the `strstr' function. */
+/* Define if you have the `strstr' function. */
#undef HAVE_STRSTR
-/* Define to 1 if you have the <syslog.h> header file. */
+/* Define if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
-/* Define to 1 if you have the <sys/socket.h> header file. */
+/* Define if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
-/* Define to 1 if you have the <sys/stat.h> header file. */
+/* Define if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
-/* Define to 1 if you have the <sys/timeb.h> header file. */
+/* Define if you have the <sys/timeb.h> header file. */
#undef HAVE_SYS_TIMEB_H
-/* Define to 1 if you have the <sys/time.h> header file. */
+/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
-/* Define to 1 if you have the <sys/types.h> header file. */
+/* Define if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
-/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
-/* Define to 1 if you have the <unistd.h> header file. */
+/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* Define to 1 if you have the `vprintf' function. */
+/* Define if you have the `vprintf' function. */
#undef HAVE_VPRINTF
/* Use zrle compression; needs a c++ compiler */
#undef HAVE_ZRLE
-/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
- slash. */
+/* Define if `lstat' dereferences a symlink specified with a trailing slash.
+ */
#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
/* Name of package */
#undef PACKAGE
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
/* The number of bytes in type char */
#undef SIZEOF_CHAR
@@ -176,20 +161,20 @@
/* The number of bytes in type void* */
#undef SIZEOF_VOIDP
-/* Define to 1 if you have the ANSI C header files. */
+/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Version number of package */
#undef VERSION
-/* Define to 1 if your processor stores words with the most significant byte
- first (like Motorola and SPARC, unlike Intel and VAX). */
+/* Define if your processor stores words with the most significant byte first
+ (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
-/* Define to 1 if the X Window System is missing or not being used. */
+/* Define if the X Window System is missing or not being used. */
#undef X_DISPLAY_MISSING
/* Define to empty if `const' does not conform to ANSI C. */
diff --git a/rfb/rfbproto.h b/rfb/rfbproto.h
index 718b04f..72017e6 100644
--- a/rfb/rfbproto.h
+++ b/rfb/rfbproto.h
@@ -52,39 +52,36 @@
#include <rfb/rfbint.h>
#include <rfb/keysym.h>
-#ifdef HAVE_LIBZ
+#ifdef LIBVNCSERVER_HAVE_LIBZ
#include <zlib.h>
#endif
#if defined(WIN32)
#define WORDS_BIGENDIAN
-#undef Bool
-#define Bool int
+#define rfbBool int
#include <sys/timeb.h>
#include <winsock.h>
#undef SOCKET
#define SOCKET int
#else
#define max(a,b) (((a)>(b))?(a):(b))
-#ifdef HAVE_SYS_TIME_H
+#ifdef LIBVNCSERVER_HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
-#ifdef HAVE_NETINET_IN_H
+#ifdef LIBVNCSERVER_HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#define SOCKET int
-#ifndef Bool
-typedef int8_t Bool;
+typedef int8_t rfbBool;
#undef FALSE
#define FALSE 0
#undef TRUE
#define TRUE -1
#endif
-#endif
-typedef uint32_t KeySym;
-typedef uint32_t Pixel;
+typedef uint32_t rfbKeySym;
+typedef uint32_t rfbPixel;
#ifndef INADDR_NONE
#define INADDR_NONE ((in_addr_t) 0xffffffff)
@@ -313,7 +310,7 @@ typedef struct {
#define rfbSetColourMapEntries 1
#define rfbBell 2
#define rfbServerCutText 3
-#ifdef BACKCHANNEL
+#ifdef LIBVNCSERVER_BACKCHANNEL
#define rfbBackChannel 15
#endif
@@ -341,15 +338,15 @@ typedef struct {
#define rfbEncodingRRE 2
#define rfbEncodingCoRRE 4
#define rfbEncodingHextile 5
-#ifdef HAVE_LIBZ
+#ifdef LIBVNCSERVER_HAVE_LIBZ
#define rfbEncodingZlib 6
#define rfbEncodingTight 7
#define rfbEncodingZlibHex 8
#endif
-#ifdef BACKCHANNEL
+#ifdef LIBVNCSERVER_BACKCHANNEL
#define rfbEncodingBackChannel 15
#endif
-#ifdef HAVE_ZRLE
+#ifdef LIBVNCSERVER_HAVE_ZRLE
#define rfbEncodingZRLE 16
#endif
@@ -537,7 +534,7 @@ typedef struct {
#define rfbHextileExtractW(byte) (((byte) >> 4) + 1)
#define rfbHextileExtractH(byte) (((byte) & 0xf) + 1)
-#ifdef HAVE_LIBZ
+#ifdef LIBVNCSERVER_HAVE_LIBZ
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* zlib - zlib compressed Encoding. We have an rfbZlibHeader structure
* giving the number of bytes following. Finally the data follows is
@@ -798,7 +795,7 @@ typedef struct {
#define sz_rfbServerCutTextMsg 8
-#ifdef BACKCHANNEL
+#ifdef LIBVNCSERVER_BACKCHANNEL
typedef rfbServerCutTextMsg rfbBackChannelMsg;
#define sz_rfbBackChannelMsg 8
#endif
diff --git a/rfb/rfbregion.h b/rfb/rfbregion.h
index 95f73e2..8c07054 100755
--- a/rfb/rfbregion.h
+++ b/rfb/rfbregion.h
@@ -25,38 +25,38 @@ extern sraRegion *sraRgnCreateRgn(const sraRegion *src);
extern void sraRgnDestroy(sraRegion *rgn);
extern void sraRgnMakeEmpty(sraRegion *rgn);
-extern Bool sraRgnAnd(sraRegion *dst, const sraRegion *src);
+extern rfbBool sraRgnAnd(sraRegion *dst, const sraRegion *src);
extern void sraRgnOr(sraRegion *dst, const sraRegion *src);
-extern Bool sraRgnSubtract(sraRegion *dst, const sraRegion *src);
+extern rfbBool sraRgnSubtract(sraRegion *dst, const sraRegion *src);
extern void sraRgnOffset(sraRegion *dst, int dx, int dy);
-extern Bool sraRgnPopRect(sraRegion *region, sraRect *rect,
+extern rfbBool sraRgnPopRect(sraRegion *region, sraRect *rect,
unsigned long flags);
extern unsigned long sraRgnCountRects(const sraRegion *rgn);
-extern Bool sraRgnEmpty(const sraRegion *rgn);
+extern rfbBool sraRgnEmpty(const sraRegion *rgn);
extern sraRegion *sraRgnBBox(const sraRegion *src);
/* -=- rectangle iterator */
typedef struct sraRectangleIterator {
- Bool reverseX,reverseY;
+ rfbBool reverseX,reverseY;
int ptrSize,ptrPos;
struct sraSpan** sPtrs;
} sraRectangleIterator;
extern sraRectangleIterator *sraRgnGetIterator(sraRegion *s);
-extern sraRectangleIterator *sraRgnGetReverseIterator(sraRegion *s,Bool reverseX,Bool reverseY);
-extern Bool sraRgnIteratorNext(sraRectangleIterator *i,sraRect *r);
+extern sraRectangleIterator *sraRgnGetReverseIterator(sraRegion *s,rfbBool reverseX,rfbBool reverseY);
+extern rfbBool sraRgnIteratorNext(sraRectangleIterator *i,sraRect *r);
extern void sraRgnReleaseIterator(sraRectangleIterator *i);
void sraRgnPrint(const sraRegion *s);
/* -=- Rectangle clipper (for speed) */
-extern Bool sraClipRect(int *x, int *y, int *w, int *h,
+extern rfbBool sraClipRect(int *x, int *y, int *w, int *h,
int cx, int cy, int cw, int ch);
#endif