
 VNC server
 ==========

 This is a small, simple, inefficient VNC server for RISC OS.
 Some things aren't quite working yet.


 In use
 ------
 Modify the obey file 'start' to use the port no. and password
 you want to use. Notice that the password can be at most 8
 chars.

 Select a suitable screen mode (see Optimizing).

 If you plan to use a client with a 2 button mouse, you may want
 to enable the line 'vncserv_swap_adjust_menu 1' in the 'start'
 obey file.

 Double click on 'start' and the server will load and start
 listening for an incoming connection; the server hardly uses
 any CPU when no client is connected, so you may have the server
 running constantly. The server uses approx. 3*screensize bytes,
 so in a 800x600x256 mode, it'll use 1.5 Mbytes.

    DO NOT CHANGE SCREEN MODE WHILST THE SERVER IS RUNNING

 Set up the VNC client/viewer to use the selected port no. and
 password and connect to the RiscPC running the server.

 If possible, make sure the client runs in 8bpp - this uses
 less network bandwidth than 16 or 32bpp.


 Optimizing
 ----------
 The backdrop should be monochrome. Use !CloseUp to check that the
 backdrop isn't a dithered pattern. Disabling textured windows is
 also a good idea, so is using simple toolsprites.
 Using a smaller screen mode helps.
 Antialiased text does not compress well with VNC - try disabling
 antialising and use the system font in the Wimp.
 If possible, run the desktop in a 16 colour mode.


 In a test with 4 Filer windows opened, the desktop I normally
 uses compressed to ~600kbytes.
 If I selected a backdrop without dithering, the size dropped
 to 200kbytes.
 Disabling textured windows futher halved the size.
 And using the System.Font the desktop could be compressed to
 ~60kbytes.


 A bit of fun
 ------------
 Try connecting to the server from the same RiscPC running the
 server!! (This is best done using a client which can display
 the desktop scaled down to eg. 50%).


 Missing/bugs
 ------------
 There are still a few keys that don't work (eg. Ctrl+A - Ctrl+Z).

 Sometimes dragging a window freezes the network and locks the
 mouse buttons; this happens if no callbacks are generated
 whilst dragging - why this is so for some windows and not for
 others is not known. I've tried forcing a callback to happen,
 but that seemed a little unstable. There now is a watchdog
 which nudges the mouse if no callbacks have happened for about
 1/4 second; this seems to unfreeze the network. The watchdog
 can be disabled using *vncserv_dont_nudge_mouse.

 The server does not always discover when the client closes
 the connection.

 Better colour matching in pixtrans.c - the current algorithm
 does not like the RGB332 (3bits red, 3bits green, 2bits blue)
 palette used by eg. xvncviewer.


 License
 -------
 This program is released under the GPL version 2.


 Requirements
 ------------
 RISC OS 3.5 or later.
 10Mbit ethernet and StrongARM recommended.


 Recompilation
 -------------
 To compile you need OSLib, Netlib and Acorn C/C++.
 You can compile the VNC server as either a module or an
 application - follow the instructions in the Makefile.
 Running the server as an application (eg. in a taskwindow)
 makes it much easier to debug.

 The program is organised like this:

    vncserv.c     provides the API for the VNC server library
    ipserv.c      listens on a port for incoming connections
    server.c      is the user of the VNC server library - it
                  provides all the platform specific handling of
                  keys, mouse & reading/writing over network
    frontend.c    is the frontend for the whole stuff - it simply
                  initialises and polls server.c

 The VNC library is platform independent and consists of the files
   areas.c d3des.c hextile.c pixtrans.c vncauth.c vncbuffer.c
   vncserv.c areas.h d3des.h hextile.h pixtrans.h proto.h
   vncauth.h vncbuffer.h vnckeys.h vncserv.h


 Copyright
 ---------
 Henrik Bjerregaard Pedersen
 henrik@login.dknet.dk


 History
 -------
 0.01     2002-01-13
          * first version

 0.02     2002-01-17
          * fixed 100000 bugs

 0.03     2002-01-18
          * some screen-scanning optimization
          * improved changed-rectangle detection
          * now keeps track of which keys are pressed

 0.04     2002-01-19
          * split main.c into frontend.c and server.c
          * server quits and restarts on network error
          * better handling of keys

 0.05     2002-01-21
          * fixed problem with F10, F11, F12

 0.06     2002-01-27
          * attempt to fix the 'freezing when dragging window'
            problem
