Commit 705a5d46 authored by Christian Beier's avatar Christian Beier

Add doxygen documentation support.

    Adds automagically generating libvncserver/libvncclient API
    documentation using doxygen. This gives a nice overview on both APIs,
    include dependencies and function call/caller dependencies.

    TODO: Modify all the explaining comments in the .c files for use with
          doxygen as well.

    This patch only changes comments, no functional changes at all!
Signed-off-by: 's avatarChristian Beier <dontmind@freeshell.org>
parent a5f8d3a3
/**
* @example SDLvncviewer.c
*/
#include <SDL.h> #include <SDL.h>
#include <signal.h> #include <signal.h>
#include <rfb/rfbclient.h> #include <rfb/rfbclient.h>
......
/* A simple example of an RFB client */ /**
* @example backchannel-client.c
* A simple example of an RFB client
*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
/* A simple example of an RFB client */ /**
* @example ppmtest.c
* A simple example of an RFB client
*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
/* /**
* @example vnc2mpg.c
* Simple movie writer for vnc; based on Libavformat API example from FFMPEG * Simple movie writer for vnc; based on Libavformat API example from FFMPEG
* *
* Copyright (c) 2003 Fabrice Bellard, 2004 Johannes E. Schindelin * Copyright (c) 2003 Fabrice Bellard, 2004 Johannes E. Schindelin
......
#include <rfb/rfb.h> #include <rfb/rfb.h>
/* /**
* @example backchannel.c
* This is a simple example demonstrating a protocol extension. * This is a simple example demonstrating a protocol extension.
* *
* The "back channel" permits sending commands between client and server. * The "back channel" permits sending commands between client and server.
......
/* /**
* @example camera.c
* Question: I need to display a live camera image via VNC. Until now I just * Question: I need to display a live camera image via VNC. Until now I just
* grab an image, set the rect to modified and do a 0.1 s sleep to give the * grab an image, set the rect to modified and do a 0.1 s sleep to give the
* system time to transfer the data. * system time to transfer the data.
......
/* /**
* * @example example.c
* This is an example of how to use libvncserver. * This is an example of how to use libvncserver.
* *
* libvncserver example * libvncserver example
......
/**
* @example filetransfer.c
*/
#include <rfb/rfb.h> #include <rfb/rfb.h>
int main(int argc,char** argv) int main(int argc,char** argv)
......
/**
* @example pnmshow.c
*/
#include <stdio.h> #include <stdio.h>
#include <rfb/rfb.h> #include <rfb/rfb.h>
#include <rfb/keysym.h> #include <rfb/keysym.h>
......
/**
* @example pnmshow24.c
*/
#include <stdio.h> #include <stdio.h>
#include <rfb/rfb.h> #include <rfb/rfb.h>
#include <rfb/keysym.h> #include <rfb/keysym.h>
......
/* This program is a simple server to show events coming from the client */ /**
* @example vncev.c
* This program is a simple server to show events coming from the client
*/
#ifdef __STRICT_ANSI__ #ifdef __STRICT_ANSI__
#define _BSD_SOURCE #define _BSD_SOURCE
#endif #endif
......
This diff is collapsed.
#ifndef RFBCLIENT_H #ifndef RFBCLIENT_H
#define RFBCLIENT_H #define RFBCLIENT_H
/**
* @defgroup libvncclient_api LibVNCClient API Reference
* @{
*/
/* /*
* Copyright (C) 2000, 2001 Const Kaplinsky. All Rights Reserved. * Copyright (C) 2000, 2001 Const Kaplinsky. All Rights Reserved.
* Copyright (C) 2000 Tridia Corporation. All Rights Reserved. * Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
...@@ -22,8 +27,8 @@ ...@@ -22,8 +27,8 @@
* USA. * USA.
*/ */
/* /**
* vncviewer.h * @file rfbclient.h
*/ */
#include <stdio.h> #include <stdio.h>
...@@ -72,7 +77,7 @@ extern "C" ...@@ -72,7 +77,7 @@ extern "C"
{ {
#endif #endif
/* vncrec */ /** vncrec */
typedef struct { typedef struct {
FILE* file; FILE* file;
...@@ -81,7 +86,7 @@ typedef struct { ...@@ -81,7 +86,7 @@ typedef struct {
rfbBool doNotSleep; rfbBool doNotSleep;
} rfbVNCRec; } rfbVNCRec;
/* client data */ /** client data */
typedef struct rfbClientData { typedef struct rfbClientData {
void* tag; void* tag;
...@@ -89,7 +94,7 @@ typedef struct rfbClientData { ...@@ -89,7 +94,7 @@ typedef struct rfbClientData {
struct rfbClientData* next; struct rfbClientData* next;
} rfbClientData; } rfbClientData;
/* app data (belongs into rfbClient?) */ /** app data (belongs into rfbClient?) */
typedef struct { typedef struct {
rfbBool shareDesktop; rfbBool shareDesktop;
...@@ -107,14 +112,14 @@ typedef struct { ...@@ -107,14 +112,14 @@ typedef struct {
int qualityLevel; int qualityLevel;
rfbBool enableJPEG; rfbBool enableJPEG;
rfbBool useRemoteCursor; rfbBool useRemoteCursor;
rfbBool palmVNC; /* use palmvnc specific SetScale (vs ultravnc) */ rfbBool palmVNC; /**< use palmvnc specific SetScale (vs ultravnc) */
int scaleSetting; /* 0 means no scale set, else 1/scaleSetting */ int scaleSetting; /**< 0 means no scale set, else 1/scaleSetting */
} AppData; } AppData;
/* For GetCredentialProc callback function to return */ /** For GetCredentialProc callback function to return */
typedef union _rfbCredential typedef union _rfbCredential
{ {
/* X509 (VeNCrypt) */ /** X509 (VeNCrypt) */
struct struct
{ {
char *x509CACertFile; char *x509CACertFile;
...@@ -122,7 +127,7 @@ typedef union _rfbCredential ...@@ -122,7 +127,7 @@ typedef union _rfbCredential
char *x509ClientCertFile; char *x509ClientCertFile;
char *x509ClientKeyFile; char *x509ClientKeyFile;
} x509Credential; } x509Credential;
/* Plain (VeNCrypt), MSLogon (UltraVNC) */ /** Plain (VeNCrypt), MSLogon (UltraVNC) */
struct struct
{ {
char *username; char *username;
...@@ -162,7 +167,7 @@ typedef struct _rfbClient { ...@@ -162,7 +167,7 @@ typedef struct _rfbClient {
const char* programName; const char* programName;
char* serverHost; char* serverHost;
int serverPort; /* if -1, then use file recorded by vncrec */ int serverPort; /**< if -1, then use file recorded by vncrec */
rfbBool listenSpecified; rfbBool listenSpecified;
int listenPort, flashPort; int listenPort, flashPort;
...@@ -170,7 +175,7 @@ typedef struct _rfbClient { ...@@ -170,7 +175,7 @@ typedef struct _rfbClient {
int x, y, w, h; int x, y, w, h;
} updateRect; } updateRect;
/* Note that the CoRRE encoding uses this buffer and assumes it is big enough /** Note that the CoRRE encoding uses this buffer and assumes it is big enough
to hold 255 * 255 * 32 bits -> 260100 bytes. 640*480 = 307200 bytes. to hold 255 * 255 * 32 bits -> 260100 bytes. 640*480 = 307200 bytes.
Hextile also assumes it is big enough to hold 16 * 16 * 32 bits. Hextile also assumes it is big enough to hold 16 * 16 * 32 bits.
Tight encoding assumes BUFFER_SIZE is at least 16384 bytes. */ Tight encoding assumes BUFFER_SIZE is at least 16384 bytes. */
...@@ -221,7 +226,7 @@ typedef struct _rfbClient { ...@@ -221,7 +226,7 @@ typedef struct _rfbClient {
* Variables for the ``tight'' encoding implementation. * Variables for the ``tight'' encoding implementation.
*/ */
/* Separate buffer for compressed data. */ /** Separate buffer for compressed data. */
#define ZLIB_BUFFER_SIZE 30000 #define ZLIB_BUFFER_SIZE 30000
char zlib_buffer[ZLIB_BUFFER_SIZE]; char zlib_buffer[ZLIB_BUFFER_SIZE];
...@@ -236,7 +241,7 @@ typedef struct _rfbClient { ...@@ -236,7 +241,7 @@ typedef struct _rfbClient {
uint8_t tightPrevRow[2048*3*sizeof(uint16_t)]; uint8_t tightPrevRow[2048*3*sizeof(uint16_t)];
#ifdef LIBVNCSERVER_HAVE_LIBJPEG #ifdef LIBVNCSERVER_HAVE_LIBJPEG
/* JPEG decoder state. */ /** JPEG decoder state. */
rfbBool jpegError; rfbBool jpegError;
struct jpeg_source_mgr* jpegSrcManager; struct jpeg_source_mgr* jpegSrcManager;
...@@ -250,7 +255,7 @@ typedef struct _rfbClient { ...@@ -250,7 +255,7 @@ typedef struct _rfbClient {
/* cursor.c */ /* cursor.c */
uint8_t *rcSource, *rcMask; uint8_t *rcSource, *rcMask;
/* private data pointer */ /** private data pointer */
rfbClientData* clientData; rfbClientData* clientData;
rfbVNCRec* vncRec; rfbVNCRec* vncRec;
...@@ -269,7 +274,7 @@ typedef struct _rfbClient { ...@@ -269,7 +274,7 @@ typedef struct _rfbClient {
SoftCursorUnlockScreenProc SoftCursorUnlockScreen; SoftCursorUnlockScreenProc SoftCursorUnlockScreen;
GotFrameBufferUpdateProc GotFrameBufferUpdate; GotFrameBufferUpdateProc GotFrameBufferUpdate;
FinishedFrameBufferUpdateProc FinishedFrameBufferUpdate; FinishedFrameBufferUpdateProc FinishedFrameBufferUpdate;
/* the pointer returned by GetPassword will be freed after use! */ /** the pointer returned by GetPassword will be freed after use! */
GetPasswordProc GetPassword; GetPasswordProc GetPassword;
MallocFrameBufferProc MallocFrameBuffer; MallocFrameBufferProc MallocFrameBuffer;
GotXCutTextProc GotXCutText; GotXCutTextProc GotXCutText;
...@@ -278,7 +283,7 @@ typedef struct _rfbClient { ...@@ -278,7 +283,7 @@ typedef struct _rfbClient {
GotCursorShapeProc GotCursorShape; GotCursorShapeProc GotCursorShape;
GotCopyRectProc GotCopyRect; GotCopyRectProc GotCopyRect;
/* Which messages are supported by the server /** Which messages are supported by the server
* This is a *guess* for most servers. * This is a *guess* for most servers.
* (If we can even detect the type of server) * (If we can even detect the type of server)
* *
...@@ -288,18 +293,18 @@ typedef struct _rfbClient { ...@@ -288,18 +293,18 @@ typedef struct _rfbClient {
*/ */
rfbSupportedMessages supportedMessages; rfbSupportedMessages supportedMessages;
/* negotiated protocol version */ /** negotiated protocol version */
int major, minor; int major, minor;
/* The selected security types */ /** The selected security types */
uint32_t authScheme, subAuthScheme; uint32_t authScheme, subAuthScheme;
#ifdef LIBVNCSERVER_WITH_CLIENT_TLS #ifdef LIBVNCSERVER_WITH_CLIENT_TLS
/* The TLS session for Anonymous TLS and VeNCrypt */ /** The TLS session for Anonymous TLS and VeNCrypt */
gnutls_session_t tlsSession; gnutls_session_t tlsSession;
#endif #endif
/* To support security types that requires user input (except VNC password /** To support security types that requires user input (except VNC password
* authentication), for example VeNCrypt and MSLogon, this callback function * authentication), for example VeNCrypt and MSLogon, this callback function
* must be set before the authentication. Otherwise, it implicates that the * must be set before the authentication. Otherwise, it implicates that the
* caller application does not support it and related security types should * caller application does not support it and related security types should
...@@ -307,18 +312,18 @@ typedef struct _rfbClient { ...@@ -307,18 +312,18 @@ typedef struct _rfbClient {
*/ */
GetCredentialProc GetCredential; GetCredentialProc GetCredential;
/* The 0-terminated security types supported by the client. /** The 0-terminated security types supported by the client.
* Set by function SetClientAuthSchemes() */ * Set by function SetClientAuthSchemes() */
uint32_t *clientAuthSchemes; uint32_t *clientAuthSchemes;
/* When the server is a repeater, this specifies the final destination */ /** When the server is a repeater, this specifies the final destination */
char *destHost; char *destHost;
int destPort; int destPort;
/* the QoS IP DSCP for this client */ /** the QoS IP DSCP for this client */
int QoS_DSCP; int QoS_DSCP;
/* hook to handle xvp server messages */ /** hook to handle xvp server messages */
HandleXvpMsgProc HandleXvpMsg; HandleXvpMsgProc HandleXvpMsg;
} rfbClient; } rfbClient;
...@@ -372,10 +377,10 @@ void* rfbClientGetClientData(rfbClient* client, void* tag); ...@@ -372,10 +377,10 @@ void* rfbClientGetClientData(rfbClient* client, void* tag);
typedef struct _rfbClientProtocolExtension { typedef struct _rfbClientProtocolExtension {
int* encodings; int* encodings;
/* returns TRUE if the encoding was handled */ /** returns TRUE if the encoding was handled */
rfbBool (*handleEncoding)(rfbClient* cl, rfbBool (*handleEncoding)(rfbClient* cl,
rfbFramebufferUpdateRectHeader* rect); rfbFramebufferUpdateRectHeader* rect);
/* returns TRUE if it handled the message */ /** returns TRUE if it handled the message */
rfbBool (*handleMessage)(rfbClient* cl, rfbBool (*handleMessage)(rfbClient* cl,
rfbServerToClientMsg* message); rfbServerToClientMsg* message);
struct _rfbClientProtocolExtension* next; struct _rfbClientProtocolExtension* next;
...@@ -405,12 +410,21 @@ extern int WaitForMessage(rfbClient* client,unsigned int usecs); ...@@ -405,12 +410,21 @@ extern int WaitForMessage(rfbClient* client,unsigned int usecs);
/* vncviewer.c */ /* vncviewer.c */
rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,int bytesPerPixel); rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,int bytesPerPixel);
rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv); rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv);
/* rfbClientCleanup() does not touch client->frameBuffer */ /** rfbClientCleanup() does not touch client->frameBuffer */
void rfbClientCleanup(rfbClient* client); void rfbClientCleanup(rfbClient* client);
#if(defined __cplusplus) #if(defined __cplusplus)
} }
#endif #endif
#endif /**
* @}
*/
/**
@page libvncclient_doc LibVNCClient Documentation
@section example_code Example Code
See SDLvncviewer.c for a rather complete client example.
*/
#endif
#ifndef RFBPROTO_H #ifndef RFBPROTO_H
#define RFBPROTO_H #define RFBPROTO_H
/**
@mainpage
@li @ref libvncserver_api
@li @ref libvncserver_doc
@li @ref libvncclient_api
@li @ref libvncclient_doc
*/
/* /*
* Copyright (C) 2005 Rohit Kumar, Johannes E. Schindelin * Copyright (C) 2005 Rohit Kumar, Johannes E. Schindelin
* Copyright (C) 2000-2002 Constantin Kaplinsky. All Rights Reserved. * Copyright (C) 2000-2002 Constantin Kaplinsky. All Rights Reserved.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment